@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/vendor/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/vendor/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/vendor/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/vendor/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/vendor/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/vendor/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/vendor/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }
:root {
  --ground: #F3F5F4; --panel: #FFFFFF; --ink: #12201D; --muted: #51605C; --line: #D8DEDC;
  --line-soft: #EEF1F0; --field: #B9C3C0; --accent: #0E6B66; --accent-ink: #0A4F4B;
  --accent-soft: #E6F1F0; --hl: #B8521A; --warn-bg: #FBEFE6; --warn-line: #E9C7AE; --warn-ink: #6B3410;
  --dark: #12201D; --dark-2: #33433F; --on-dark: #F3F5F4; --on-dark-muted: #A9B8B4; --flag: #F1C9AC;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 15px; }
a { color: var(--accent); } a:hover { color: var(--accent-ink); }
input, select, button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
h1, h2 { margin: 0; }
h2 { font-size: 15px; font-weight: 600; }

.topbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--line); max-width: 1400px; margin: 0 auto; }
.brand { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.kicker { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.brand-name { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.page { max-width: 1400px; margin: 0 auto; padding: 20px 24px 48px; display: flex; flex-direction: column; gap: 20px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card > .card-head { margin: -18px -18px 14px; }
.card.flush > .card-head { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; align-items: baseline; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .grid5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; min-height: 44px; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select { min-height: 44px; border: 1px solid var(--field); border-radius: 8px; padding: 0 12px; background: #fff; color: var(--ink); font-size: 15px; width: 100%; }
.filters { align-items: end; }

.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.col-side { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-main { flex: 999 1 560px; min-width: 0; }

.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; background: #E7ECEA; border-radius: 10px; padding: 4px; }
.seg button { min-height: 44px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; }
.seg button[aria-pressed=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { min-height: 36px; padding: 0 12px; border: 1px solid var(--field); border-radius: 999px; background: #fff; cursor: pointer; font-size: 13px; }
.chip:hover { border-color: var(--accent); }

.results { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; }
.results li { display: flex; align-items: center; border-top: 1px solid var(--line-soft); }
.results li[data-sel=true] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.results li.excluded { opacity: .55; }
.results .pick { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; cursor: pointer; padding: 12px 0 12px 18px;
  display: grid; grid-template-columns: 58px minmax(0, 1fr) minmax(150px, 260px) 64px; gap: 12px; align-items: center; color: var(--ink); }
.results .clave { font-family: var(--mono); font-weight: 600; font-size: 14px; }
.results .name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.results .sub { font-size: 12.5px; color: var(--muted); display: block; margin-top: 2px; }
.results .span { display: flex; flex-direction: column; gap: 5px; }
.results .bar { position: relative; display: block; height: 8px; background: var(--line-soft); border-radius: 4px; }
.results .bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.results .bar i.s { background: #9AA6A3; }
.results .bar em { position: absolute; top: -4px; bottom: -4px; background: rgba(184,82,26,.18); border-left: 1px solid var(--hl); border-right: 1px solid var(--hl); }
.results .yrs { display: flex; justify-content: space-between; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.results .yrs b { color: var(--ink); font-weight: 600; }
.results .dist { font-family: var(--mono); text-align: right; font-weight: 500; font-size: 13px; }
.dl { flex: none; width: 44px; height: 44px; margin: 0 10px; border-radius: 8px; border: 1px solid var(--field); background: #fff; color: var(--dark-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.dl[data-saved=true] { background: var(--accent); border-color: var(--accent); color: #fff; }
.dl[data-busy=true] { opacity: .6; cursor: progress; }
.ruler { display: grid; grid-template-columns: 58px minmax(0, 1fr) minmax(150px, 260px) 64px 64px; gap: 12px; padding: 8px 0 6px 18px; background: #FAFBFB; border-bottom: 1px solid var(--line-soft); align-items: end; }
.ruler-scale { position: relative; height: 32px; }
.ruler-scale span { position: absolute; bottom: 0; font-family: var(--mono); font-size: 11px; color: var(--muted); transform: translateX(-50%); }
.ruler-scale span:first-child { transform: none; } .ruler-scale span.end { transform: translateX(-100%); }
.ruler-scale em { position: absolute; top: 0; height: 14px; background: var(--hl); border-radius: 3px; min-width: 3px; }
.ruler-scale b { position: absolute; top: -1px; font-family: var(--mono); font-size: 11px; color: #8A3C10; transform: translateX(-100%); padding-right: 6px; white-space: nowrap; }
.results-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--line-soft); }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.badge.op { color: var(--accent); background: var(--accent-soft); }
.badge.sus { color: #6B5A4E; background: #EFEBE7; }
.badge.ld { color: var(--hl); background: var(--warn-bg); }
.empty { padding: 18px; color: var(--muted); font-size: 14px; margin: 0; }

.map-card { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
#map { height: 560px; border-radius: 8px; background: #EAF1F3; }
@media (max-width: 700px) { #map { height: 380px; } }
.legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 0 6px 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.op { background: var(--accent); } .dot.sus { border: 1.5px solid #7E8B88; }
.dot.res { background: var(--hl); } .dot.loaded { background: #fff; border: 2.5px solid var(--ink); }

.selected { background: var(--dark); color: var(--on-dark); border-radius: 12px; padding: 18px 22px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.selected .k { font-family: var(--mono); font-size: 12px; color: var(--on-dark-muted); }
.selected .t { font-size: 21px; font-weight: 600; margin: 4px 0; }
.selected .d { font-size: 13px; color: #C9D3D0; }
.btn-light, .btn-dark, .btn-line { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 10px; font-weight: 600; text-decoration: none; cursor: pointer; border: 0; }
.btn-light { background: var(--on-dark); color: var(--ink); }
.btn-light:hover { color: var(--ink); background: #fff; }
.btn-dark { background: var(--dark); color: var(--on-dark); }
.btn-line { background: #fff; color: var(--ink); border: 1px solid var(--field); font-weight: 500; min-height: 40px; }
.btn-line:hover { border-color: var(--accent); }

.back { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; font-weight: 500; text-decoration: none; }
.st-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-top: -8px; }
.st-head h1 { font-size: 34px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; margin: 6px 0; }
.st-id { min-width: 0; flex: 1 1 360px; }
.rec-card { flex: 0 1 420px; min-width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(18,32,29,.05); }
.rec-k { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rec-range { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--ink); letter-spacing: -.01em; }
.rec-arrow { color: var(--accent); font-family: var(--sans); }
.rec-span { font-size: 13px; color: var(--accent-ink); font-weight: 500; }
.rec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0 0; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.rec-grid div { min-width: 0; }
.rec-grid dt { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.rec-grid dd { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-btn { align-self: flex-start; margin-top: 6px; }
#form-q input { flex: 1 1 360px; min-height: 48px; font-size: 16px; }
#form-q button { min-height: 48px; }
.builder { border-top: 1px solid var(--line-soft); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.builder p { margin: 0; }

.status { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 10px; font-size: 14px; }
.status.info { background: var(--accent-soft); color: var(--accent-ink); }
.status.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.answer-wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.answer { flex: 1 1 340px; min-width: 0; background: var(--dark); color: var(--on-dark); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.answer .k { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--on-dark-muted); }
.answer .v { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.answer .v b { font-size: 60px; line-height: 1; font-weight: 600; letter-spacing: -.02em; }
.answer .v span { font-size: 20px; color: #C9D3D0; }
.answer .ctx { font-size: 15px; color: #DDE5E2; }
.answer .facts { border-top: 1px solid var(--dark-2); padding-top: 12px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #C9D3D0; }
.answer .facts div { display: flex; justify-content: space-between; gap: 12px; }
.answer .facts b { font-family: var(--mono); font-weight: 500; color: var(--on-dark); text-align: right; }
.answer ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.answer li { font-size: 13px; color: var(--flag); padding-left: 22px; position: relative; }
.answer li::before { content: "⚠"; position: absolute; left: 0; }
.tag-doubt { align-self: flex-start; font-size: 12px; font-weight: 600; background: var(--hl); color: #fff; padding: 3px 8px; border-radius: 4px; }
.charts { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.chart { width: 100%; min-height: 120px; }
.alts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.alts button b { font-family: var(--mono); }
.nodata { border: 1px dashed var(--field); background: #fff; border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.nodata .t { font-size: 22px; font-weight: 600; }
.near { display: flex; flex-wrap: wrap; gap: 10px; }
.near a { flex: 1 1 260px; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 54px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.near a:hover { border-color: var(--accent); }
.prov { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 800px) { .prov { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.prov b { display: block; color: var(--ink); margin-bottom: 4px; }
.leaflet-container { font-family: var(--sans); }
.vega-embed { width: 100%; }
.vega-embed summary { display: none; }

/* ------------------------------------------------------------------ v5 */
.top-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.top-right #catalog-info { text-align: right; }
.conn { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--line-soft); color: var(--muted); }
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.conn.on { background: var(--accent-soft); color: var(--accent-ink); }
.conn.off { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.muted-weak { font-weight: 400; color: var(--muted); }
.strong { color: var(--ink); font-weight: 600; font-size: 14px; }
.combo { position: relative; display: flex; flex-direction: column; gap: 6px; }
.combo > label { flex-direction: row; gap: 4px; }
.combo ul { list-style: none; margin: 0; padding: 6px; position: absolute; top: 100%; left: 0; right: 0; z-index: 1000; margin-top: 4px; background: #fff;
  border: 1px solid var(--field); border-radius: 10px; box-shadow: 0 8px 24px rgba(18,32,29,.14); max-height: 320px; overflow-y: auto; }
.combo li { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 6px; cursor: pointer; font-size: 15px; }
.combo li .n { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.combo li[aria-selected=true], .combo li:hover { background: var(--accent-soft); }
.combo li.note { cursor: default; display: block; padding: 10px 12px; font-size: 14px; min-height: 0; background: transparent; }
.combo li.note button { margin-top: 8px; }
.combo li.hint { cursor: default; min-height: 0; padding: 8px 12px 4px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-soft); margin-top: 4px; background: transparent; }
.adv { border-top: 1px solid var(--line); padding-top: 6px; }
.adv summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; cursor: pointer; list-style: none; }
.adv summary::-webkit-details-marker { display: none; }
.adv summary::after { content: "▾"; color: var(--muted); }
.adv[open] summary::after { content: "▴"; }
.adv-badge { margin-left: auto; margin-right: 10px; font-size: 12px; font-family: var(--mono); background: var(--warn-bg); color: var(--warn-ink); padding: 2px 8px; border-radius: 999px; }
.adv-body { background: var(--ground); border-radius: 10px; padding: 14px; }
.adv-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.range-row { display: flex; align-items: flex-end; gap: 10px; }
.range-row label { flex: 1; }
.range-row > span { padding-bottom: 12px; }
.field-error { margin: 0; font-size: 14px; color: #8A3C10; font-weight: 500; }
input[aria-invalid=true] { border: 2px solid var(--hl) !important; }
.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.radio-cards label { flex-direction: row; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
.radio-cards label:has(input:checked) { border: 2px solid var(--accent); padding: 9px 11px; }
.radio-cards input { accent-color: var(--accent); margin-top: 3px; }
.radio-cards span { display: flex; flex-direction: column; gap: 2px; }
.radio-cards small { color: var(--muted); font-size: 12.5px; }
.seg3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg-sm button { min-height: 36px; padding: 0 14px; }

/* station header */
.st-head { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: stretch; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin: 0; }
.st-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.st-title { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.st-title h1 { font-size: 34px; font-weight: 700; letter-spacing: -.015em; margin: 0; line-height: 1.1; }
.clave-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--dark); color: var(--on-dark);
  font-family: var(--mono); font-size: 24px; font-weight: 600; cursor: pointer; }
.clave-btn svg { stroke: var(--on-dark-muted); }
.st-place { font-size: 18px; font-weight: 500; }
.st-dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.st-dl > div { padding: 12px 14px; border-right: 1px solid var(--line); min-width: 0; }
.st-dl > div:last-child { border-right: 0; display: flex; align-items: center; }
.st-dl dt { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.st-dl dd { margin: 4px 0 0; font-family: var(--mono); font-size: 16px; font-weight: 500; white-space: nowrap; }
.st-file { flex: 1 1 280px; max-width: 360px; background: var(--ground); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.st-file .fname { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.files-local { display: flex; flex-wrap: wrap; gap: 6px; }
.files-local span { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); }
.files-local span.ok { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.badge-op { padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.badge-sus { padding: 4px 10px; border-radius: 999px; background: #EEF1F0; color: #33433F; font-size: 13px; font-weight: 600; border: 1px solid #9AA6A3; }
.copied { font-size: 12px; color: var(--accent-ink); }

/* builder and picker */
.builder-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.builder-row > label { flex: 1 1 180px; }
.b-view { flex: 1 1 280px; display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.b-view .lbl { font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.iv-fields { flex: 2 1 360px; display: flex; border: 2px solid var(--accent); border-radius: 10px; overflow: hidden; background: #fff; }
.iv-fields button { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 14px; border: 0; background: #fff; cursor: pointer; text-align: left; min-height: 48px; }
.iv-fields button + button { border-left: 1px solid var(--line); }
.iv-fields button[aria-expanded=true] { background: var(--accent-soft); box-shadow: inset 0 -3px 0 var(--accent); }
.iv-fields b { font-size: 16px; }
.picker { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px rgba(18,32,29,.12); background: #fff; }
.picker-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.picker p { margin: 0; }
.picker-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.picker-sum { margin-left: auto; font-weight: 600; font-size: 14px; }
.mgrid-wrap { max-height: 380px; overflow: auto; }
.mgrid { border-collapse: separate; border-spacing: 3px; min-width: 700px; width: 100%; }
.mgrid th { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted); }
.mgrid th[scope=row] { font-size: 13.5px; color: var(--ink); font-weight: 600; text-align: left; padding-right: 6px; position: sticky; left: 0; background: #fff; }
.mgrid thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.cell { width: 100%; min-width: 44px; height: 34px; border-radius: 6px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; box-sizing: border-box; border: 0; }
.st-ok { background: var(--accent); color: #fff; }
.st-inc { background: #CDE5E2; color: var(--accent-ink); }
.st-zero { background: #F6D5C2; color: #6B3410; }
.st-none { background: #fff; color: var(--muted); border: 1px dashed #7E8B88 !important; }
.st-out { background: var(--line-soft); color: #9AA6A3; cursor: not-allowed; }
.cell.dim { opacity: .35; }
.cell.inr { box-shadow: inset 0 -4px 0 var(--hl); }
.cell.end { outline: 3px solid var(--hl); outline-offset: 1px; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.cal { display: flex; flex-wrap: wrap; gap: 28px; }
.cal-month { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cal-month h3 { margin: 0; text-align: center; font-size: 16px; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-grid .dow { text-align: center; font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 4px 0; }
.day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 50px; border-radius: 8px; font: inherit; cursor: pointer; box-sizing: border-box; border: 1px solid transparent; }
.day b { font-size: 14px; } .day small { font-family: var(--mono); font-size: 10.5px; min-height: 11px; }
.day.d-ok { background: var(--accent-soft); border-color: #7FB5B0; color: var(--ink); }
.day.d-wet { background: var(--accent); border-color: var(--accent); color: #fff; }
.day.d-zero { background: #F6D5C2; border-color: #E2A68A; color: #6B3410; }
.day.d-none { background: #fff; border: 1px dashed #7E8B88; color: var(--muted); }
.day.d-out { background: var(--line-soft); color: #9AA6A3; cursor: not-allowed; }
.day.inr { box-shadow: inset 0 -4px 0 var(--hl); }
.day.end { background: var(--hl); border-color: var(--hl); color: #fff; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--field); background: #fff; font-size: 18px; cursor: pointer; }

/* parse feedback and notices */
.fb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.tag-ok { padding: 4px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.tag-assumed { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 2px solid var(--hl); border-radius: 6px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; cursor: pointer; }
.tag-assumed u { font-weight: 400; }
.box { border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.box b.t { font-size: 17px; }
.box.ask { border: 2px solid var(--accent); background: #F6FAF9; }
.box.alert { border: 2px solid var(--hl); background: var(--warn-bg); color: var(--warn-ink); }
.box.alert .chip { color: var(--ink); }
.box.info { background: var(--accent-soft); color: var(--accent-ink); }
.crit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--dark-2); font-size: 13px; }
.crit span { color: var(--on-dark-muted); }
.crit button { margin-left: auto; background: none; border: 0; color: #9ED8D2; text-decoration: underline; cursor: pointer; font: inherit; }
.facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.facts-grid div { background: #1D2E2A; border-radius: 8px; padding: 12px; }
.facts-grid dt { font-size: 12.5px; color: var(--on-dark-muted); }
.facts-grid dd { margin: 4px 0 0; font-family: var(--mono); font-size: 17px; font-weight: 600; }
.facts-grid dd + dd { font-family: var(--sans); font-size: 12.5px; font-weight: 400; color: var(--on-dark-muted); margin-top: 2px; }
.tag-doubt { background: var(--flag); color: #4A2408; font-weight: 700; }

/* nearby + minimap */
.nearby { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.nearby-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-end; }
.radius { display: flex; flex-direction: column; gap: 4px; min-width: 280px; }
.radius label { flex-direction: row; justify-content: space-between; color: var(--ink); font-weight: 600; font-size: 13.5px; }
.radius input { width: 100%; accent-color: var(--accent); min-height: 28px; padding: 0; border: 0; }
.radius .ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.nearby-body { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.minimap-wrap { flex: 0 1 360px; display: flex; flex-direction: column; gap: 6px; }
#minimap { width: 100%; max-width: 360px; height: 360px; border-radius: 12px; border: 1px solid var(--field); }
.nearby-list { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ncard { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 10px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: #fff; }
.ncard:hover, .ncard.hot { border: 2px solid var(--ink); padding: 11px 13px; background: #F6FAF9; }
.num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--hl); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 600; font-size: 14px; }
.ncard .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ncard .right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.mun-other { padding: 0 6px; border-radius: 4px; background: #EEF1F0; color: #33433F; font-weight: 600; }
.divider { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: #33433F; }
.divider::after { content: ""; flex: 1; border-top: 1px dashed #9AA6A3; }
.mun-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.mun-chips b { padding: 2px 8px; border-radius: 999px; font-weight: 600; background: #EEF1F0; color: #33433F; border: 1px dashed #7E8B88; }
.mun-chips b.home { background: var(--accent-soft); color: var(--accent-ink); border: 0; }
.mm-pin { width: 22px !important; height: 22px !important; margin: -11px 0 0 -11px !important; border-radius: 50%; background: var(--hl); color: #fff; border: 2px solid #fff;
  display: flex !important; align-items: center; justify-content: center; font: 600 11.5px var(--mono); box-sizing: border-box; }
.mm-pin.hot { width: 30px !important; height: 30px !important; margin: -15px 0 0 -15px !important; border-color: var(--ink); font-size: 14px; z-index: 1000 !important; }
.mm-home { width: 16px !important; height: 16px !important; margin: -8px 0 0 -8px !important; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-sizing: border-box; }

/* dialogs and save progress */
dialog { border: 0; border-radius: 14px; padding: 24px; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(18,32,29,.3); color: var(--ink); }
dialog::backdrop { background: rgba(18,32,29,.4); }
dialog h2 { font-size: 19px; }
fieldset.cols { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
fieldset.cols legend { padding: 0 6px; font-size: 13.5px; font-weight: 600; }
fieldset.cols label.check { min-height: 36px; }
.save-list { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.save-list label.check { min-height: 40px; }
.pill { min-width: 72px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--field); border-radius: 8px; font-weight: 600; }
input[type=range] { accent-color: var(--accent); flex: 1; border: 0; padding: 0; }
.progress { height: 10px; border-radius: 5px; background: var(--line-soft); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); }
#save-status { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 760px) {
  .results .pick { grid-template-columns: 52px minmax(0, 1fr); }
  .results .span, .results .dist, .ruler { display: none; }
}

.answer .v b { font-size: 48px; white-space: nowrap; }
.mgrid thead th { box-shadow: 0 -4px 0 #fff, 0 4px 0 #fff; }
.mgrid th[scope=row] { box-shadow: -4px 0 0 #fff, 4px 0 0 #fff; z-index: 1; }

/* v5.1: results beside the map (side column), map sticky so it stays in view */
.split > .col-side { flex: 1 1 500px; max-width: 600px; }
.split > .map-col { flex: 999 1 460px; position: sticky; top: 12px; }
.map-col #map { height: calc(100vh - 230px); min-height: 420px; }
.results-card .card-head { padding: 12px 14px; }
.results-card .card-head .row { gap: 6px; }
.results-card .btn-line { min-height: 38px; padding: 0 12px; font-size: 13.5px; }
.results { max-height: calc(100vh - 260px); min-height: 280px; }
.results .pick { grid-template-columns: 52px minmax(0, 1fr) 54px; grid-template-rows: auto auto; row-gap: 6px; padding: 10px 0 10px 14px; }
.results .pick .clave { grid-row: 1 / span 2; align-self: start; padding-top: 2px; }
.results .pick .span { grid-column: 2 / span 2; grid-row: 2; }
.results .pick .dist { grid-column: 3; grid-row: 1; align-self: start; }
.dl { margin: 0 8px; }
.ruler { grid-template-columns: 52px minmax(0, 1fr) 60px; padding: 6px 0 4px 14px; }
.ruler > span:first-child { display: none; }
.ruler > .kicker { display: none; }
.ruler-scale { grid-column: 2; }
.results-foot { padding: 8px 14px; }
@media (max-width: 1050px) { .split > .map-col { position: static; } .map-col #map { height: 420px; } .split > .col-side { max-width: none; } }
.ruler { gap: 0; grid-template-columns: 52px 12px minmax(0, 1fr) 60px; }
.ruler-scale { grid-column: 3; }
.map-col #map { height: calc(100vh - 340px); min-height: 380px; }
@media (min-width: 1440px) {
  #view-search.page, .topbar { max-width: 1880px; }
  #view-search .split { display: grid; grid-template-columns: 360px minmax(460px, 1fr) minmax(480px, 1.15fr); align-items: start; gap: 20px; }
  #view-search .split > .col-side { display: contents; }
  #view-search .split > .col-side > .card:first-child { grid-column: 1; grid-row: 1; position: sticky; top: 12px; }
  #view-search .split > .col-side > .results-card { grid-column: 2; grid-row: 1; }
  #view-search .split > .map-col { grid-column: 3; grid-row: 1; max-width: none; }
  .results { max-height: calc(100vh - 200px); }
}
@media (min-width: 1440px) { .map-col #map { height: calc(100vh - 400px); } }

/* v5.2: compact station header, period tabs */
.st-head { padding: 16px 20px; gap: 16px; align-items: center; }
.st-main { flex: 999 1 560px; gap: 0; }
.st-title { flex-wrap: nowrap; align-items: center; gap: 16px; }
.st-name { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.st-name h1 { font-size: 26px; font-weight: 700; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.clave-btn { min-height: 64px; padding: 0 18px; font-size: 32px; border-radius: 12px; flex: none; }
.st-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 14px; color: var(--muted); }
.st-meta > * { display: inline-flex; align-items: center; gap: 4px; }
.st-meta > * + *::before { content: "·"; margin: 0 8px; color: #9AA6A3; }
.st-meta > .copied::before { content: none; }
.st-meta b { color: var(--ink); font-weight: 600; }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { stroke: var(--dark-2); }
details.st-file { flex: 0 1 auto; max-width: 380px; background: var(--ground); border-radius: 10px; padding: 0; font-size: 13.5px; }
details.st-file summary { min-height: 44px; padding: 0 14px; display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
details.st-file summary::-webkit-details-marker { display: none; }
details.st-file summary::after { content: "▾"; margin-left: 6px; color: var(--muted); }
details.st-file[open] summary::after { content: "▴"; }
.st-file-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
span.st-file { flex: none; }

.period-row { padding: 14px; margin: 0 -4px; background: var(--ground); border-radius: 12px; }
.period-row .b-view .lbl { font-weight: 600; color: var(--ink); }
.seg-period { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.seg-period button { min-height: 48px; padding: 0 16px; border: 1px solid var(--field); border-radius: 10px; background: #fff; color: var(--ink); font-weight: 500; font-size: 15px; cursor: pointer; }
.seg-period button:hover { border-color: var(--accent); }
.seg-period button[aria-pressed=true] { background: var(--dark); border-color: var(--dark); color: var(--on-dark); font-weight: 600; }
.period-row .iv-fields { background: #fff; }

@media (max-width: 640px) {
  .st-title { flex-wrap: wrap; }
  .clave-btn { min-height: 52px; font-size: 26px; }
  .st-name h1 { font-size: 22px; }
  .st-meta > * + *::before { content: none; }
  .st-meta { gap: 4px 14px; }
}

/* v5.3: tools on the left, results and charts on the right */
#view-station.page { max-width: 1680px; }
.st-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.st-side { flex: 1 1 320px; max-width: 380px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.st-results { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.st-side textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--field); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 15px; resize: vertical; min-height: 64px; }
.st-side .builder { border-top: 1px solid var(--line-soft); padding-top: 14px; gap: 12px; }
.period-block { display: flex; flex-direction: column; gap: 10px; padding: 12px; margin: 0 -6px; background: var(--ground); border-radius: 12px; }
.lbl-strong { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.seg-period button { min-height: 46px; padding: 0 8px; font-size: 14.5px; }
#b-my.one { grid-template-columns: 1fr; }
.period-block .iv-fields { flex: none; }
.crit-side { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--ground); font-size: 13px; color: var(--muted); }
.crit-side b { color: var(--ink); }
.linkish { background: none; border: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; min-height: 32px; }
.ex-menu { position: relative; }
.ex-menu summary { list-style: none; min-height: 46px; }
.ex-menu summary::-webkit-details-marker { display: none; }
.ex-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1000; width: 300px; background: #fff; border: 1px solid var(--field); border-radius: 10px; box-shadow: 0 8px 24px rgba(18,32,29,.14); padding: 6px; display: flex; flex-direction: column; }
.ex-list button { text-align: left; min-height: 44px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; font: inherit; font-size: 14px; cursor: pointer; }
.ex-list button:hover { background: var(--accent-soft); }
#parse-fb:empty { display: none; }
#parse-fb .box { padding: 12px; }
#parse-fb .box b.t { font-size: 15.5px; }

.st-results .answer-wrap { flex-direction: column; align-items: stretch; }
.st-results .charts { flex: none; }
.answer { flex-direction: row; flex-wrap: wrap; align-items: stretch; gap: 22px; }
.ans-main { flex: 1 1 280px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ans-main .row { gap: 10px; }
.ans-side { flex: 1 1 360px; min-width: 0; }
.ans-flags { flex: 1 1 100%; border-top: 1px solid var(--dark-2); padding-top: 12px !important; }
.picker { position: relative; }
@media (max-width: 1000px) {
  .st-side { position: static; max-height: none; max-width: none; }
}

.iv-fields b { font-size: 15.5px; white-space: nowrap; }
.ans-side .facts-grid dd { font-size: 15px; }
.ans-side .facts-grid dd + dd { font-size: 12.5px; }

/* ------------------------------------------------------------------ v5.4: semantic palette, alerts, disclosures */
:root {
  --ok: #0F766E; --ok-soft: #CCFBF1; --inc: #F59E0B; --inc-soft: #FDE68A; --zero: #E11D48; --zero-soft: #FECDD3;
  --none: #CBD5E1; --doubt: #7C3AED; --ans: #EA580C;
  --info-bg: #EFF6FF; --info-line: #93C5FD; --info-ink: #1E3A8A;
  --warn2-bg: #FFFBEB; --warn2-line: #FCD34D; --warn2-ink: #78350F;
  --err-bg: #FEF2F2; --err-line: #FCA5A5; --err-ink: #991B1B;
}
.status, .box, .nodata { position: relative; border-radius: 10px; }
.status { padding: 14px 18px 14px 48px; border: 1px solid transparent; border-left-width: 4px; }
.status.info, .box.info, .box.ask { background: var(--info-bg); border: 1px solid var(--info-line); border-left: 4px solid #2563EB; color: var(--info-ink); }
.status.warn, .box.alert, .nodata { background: var(--warn2-bg); border: 1px solid var(--warn2-line); border-left: 4px solid #D97706; color: var(--warn2-ink); }
.box.err { background: var(--err-bg); border: 1px solid var(--err-line); border-left: 4px solid #DC2626; color: var(--err-ink); }
.box, .nodata { padding: 16px 18px 16px 52px; }
.status::before, .box::before, .nodata::before { content: ""; position: absolute; left: 16px; top: 15px; width: 22px; height: 22px; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.status.info, .box.info, .box.ask { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-5M12 8h.01'/%3E%3C/svg%3E"); }
.status.warn, .box.alert, .nodata, .box.err { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E"); }
.status .spinner { position: absolute; left: 16px; top: 15px; }
.status:has(.spinner)::before { display: none; }
.nodata { border-style: solid; }
.nodata .t { color: #451A03; }
.nodata .kicker, .box .kicker { color: inherit; opacity: .85; }
.box .muted { color: inherit; opacity: .9; }
.box.alert .chip, .box.ask .chip, .box.err .chip { background: #fff; color: var(--ink); }
.box b.t { color: inherit; }
.alert-flags { list-style: none; margin: 0; padding: 14px 18px 14px 52px; display: flex; flex-direction: column; gap: 6px; font-size: 14px;
  background: var(--warn2-bg); border: 1px solid var(--warn2-line); border-left: 4px solid #D97706; color: var(--warn2-ink); border-radius: 10px; position: relative; }
.alert-flags::before { content: ""; position: absolute; left: 16px; top: 14px; width: 22px; height: 22px; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E"); }
.alert-flags b { font-weight: 700; }
.tag-doubt { background: #FDE68A; color: #78350F; border: 1px solid #F59E0B; }

/* disclosure controls: a visible chevron button */
.disc { cursor: pointer; list-style: none; }
.disc::-webkit-details-marker { display: none; }
.adv summary::after, details.st-file summary::after { content: none; }
.chev { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--dark-2); display: inline-flex; align-items: center; justify-content: center; transition: transform .15s; background: #fff; }
.chev::before { content: ""; width: 14px; height: 14px; background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; }
details[open] > summary .chev { transform: rotate(180deg); }
.chev.sm { width: 24px; height: 24px; } .chev.sm::before { width: 12px; height: 12px; }
.adv summary { gap: 10px; padding: 4px 0; }
.adv summary:hover .chev, details.st-file summary:hover .chev, .ex-menu summary:hover .chev { border-color: var(--accent); background: var(--accent-soft); }
.ex-menu summary { display: inline-flex; align-items: center; gap: 8px; }

/* station status colors (month grid, calendar) */
.st-ok { background: var(--ok); color: #fff; }
.st-inc { background: var(--inc-soft); color: #78350F; }
.st-zero { background: var(--zero-soft); color: #9F1239; }
.st-none { background: #fff; color: var(--muted); border: 1.5px dashed #94A3B8 !important; }
.day.d-ok { background: #F0FDFA; border-color: #99F6E4; }
.day.d-wet { background: var(--ok); border-color: var(--ok); }
.day.d-zero { background: #FFE4E6; border-color: #FDA4AF; color: #9F1239; }
.day.d-none { border: 1.5px dashed #94A3B8; }
.day.end { background: var(--ans); border-color: var(--ans); color: #fff; }
.day.inr { box-shadow: inset 0 -4px 0 var(--ans); }

/* month picker v2: compact heatmap with explicit steps */
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.step { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 52px; padding: 6px 14px; border: 1.5px solid var(--field); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; text-align: left; }
.step small { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.step b { font-size: 16px; }
.step[aria-pressed=true] { border: 2px solid var(--ans); background: #FFF7ED; }
.mh-wrap { max-height: 380px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 8px; padding: 6px 8px; }
.mh { border-collapse: separate; border-spacing: 3px; }
.mh th { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted); width: 32px; text-align: center; position: sticky; top: 0; background: #fff; z-index: 1; }
.mh th.yr-h { width: 64px; }
.mh td.cov { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-left: 8px; white-space: nowrap; }
.yr { min-height: 30px; width: 64px; border: 0; background: none; font: inherit; font-family: var(--mono); font-weight: 600; font-size: 13.5px; cursor: pointer; border-radius: 6px; text-align: left; padding: 0 6px; }
.yr:hover { background: var(--accent-soft); }
.mc { width: 32px; height: 30px; border-radius: 5px; border: 0; cursor: pointer; padding: 0; display: block; }
.mc.st-out { background: #F1F5F9; cursor: not-allowed; }
.mc.inr { box-shadow: inset 0 0 0 2.5px #111827; }
.mc.end { box-shadow: inset 0 0 0 3px var(--ans), 0 0 0 2px #fff, 0 0 0 4px var(--ans); }
.mc:focus-visible { outline: 2px solid var(--ans); outline-offset: 2px; }
.mlegend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); align-items: center; }
.mlegend i { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: 6px; }

.mh tbody th { position: static; width: auto; }
.mh thead th { position: sticky; top: 0; background: #fff; z-index: 2; box-shadow: 0 -6px 0 #fff, 0 3px 0 #fff; }

/* v5.5: month calendar (same model as the day calendar) */
.mcal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mday { height: 58px; }
.mday b { font-size: 15px; } .mday small { font-family: var(--sans); font-size: 11.5px; }
.day.d-inc { background: #FEF3C7; border-color: #FCD34D; color: #78350F; }
.cal-month h3 { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.yr-btn { border: 0; background: none; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; padding: 4px 8px; border-radius: 6px; text-decoration: underline dotted; text-underline-offset: 4px; }
.yr-btn:hover { background: var(--accent-soft); }
.round:disabled { opacity: .35; cursor: not-allowed; }

/* v5.6 */
.adv summary::after, .adv[open] summary::after, details.st-file summary::after, details.st-file[open] summary::after { content: none !important; }
.combo-input { position: relative; }
.combo-input input { padding-right: 48px; }
.combo-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
#mun[aria-expanded=true] + .combo-btn .chev { transform: rotate(180deg); }
.combo-btn:hover .chev { border-color: var(--accent); background: var(--accent-soft); }
.alert-flags { list-style: disc; padding-left: 70px; }
.alert-flags li::marker { color: #B45309; }
.picker-top { justify-content: flex-start; align-items: flex-end; gap: 16px; }
.prec-pick { display: flex; flex-direction: column; gap: 6px; }
.seg-period.prec { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
.seg-period.prec button { min-height: 44px; }

.st-results .answer { flex: none; }

/* v5.7: light, compact answer card with strong contrast */
.answer { background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 6px solid var(--ok); padding: 18px 20px; gap: 18px; }
.answer.doubt { border-left-color: #D97706; }
.answer .k { color: #33433F; }
.answer .v b { font-size: 44px; color: #0B1F1C; }
.answer .v span { color: #33433F; }
.answer .ctx { color: #1F2937; font-size: 15px; }
.answer .crit { background: #F1F5F9; color: #1F2937; }
.answer .crit span { color: #475569; }
.answer .crit button { color: var(--accent); }
.answer .facts-grid { gap: 8px; }
.answer .facts-grid div { background: #F1F5F9; border: 1px solid #E2E8F0; padding: 10px 12px; }
.answer .facts-grid dt { color: #475569; }
.answer .facts-grid dd { color: #0B1F1C; }
.answer .facts-grid dd + dd { color: #475569; }
#st-csv { width: 100%; }

/* ================================================================== v5.8 unified design (see canvas «Guía visual») */
:root { --primary: #0F766E; --primary-hover: #115E59; --primary-ink: #115E59; --sel: #2563EB; --sel-soft: #EFF6FF; --sel-ink: #1E3A8A;
  --ink: #0F172A; --muted: #475569; --line: #E2E8F0; --line-soft: #EEF2F1; --field: #CBD5E1; --ground: #F3F5F4; --toggle-bg: #E8EDEB; }
body { color: var(--ink); }
.card { border-color: var(--line); border-radius: 14px; }
/* 1. buttons: primary (filled teal) · secondary (outline) · toggles (soft) */
.btn-dark, button.btn-dark { background: var(--primary); color: #fff; border: 0; border-radius: 10px; font-weight: 600; min-height: 44px; padding: 0 18px; cursor: pointer; }
.btn-dark:hover { background: var(--primary-hover); }
.btn-dark:disabled { opacity: .5; cursor: not-allowed; }
.btn-line { border: 1px solid var(--field); border-radius: 10px; background: #fff; color: var(--ink); font-weight: 500; }
.btn-line:hover { border-color: var(--primary); background: #F0FDFA; }
.seg, .seg-period, .seg-toggle { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: var(--toggle-bg); border-radius: 12px; }
.seg button, .seg-period button, .seg-toggle button { min-height: 40px; padding: 0 12px; border: 1.5px solid transparent; border-radius: 9px; background: transparent; color: #334155; font: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer; box-shadow: none; }
.seg button:hover, .seg-period button:hover, .seg-toggle button:hover { background: rgba(255,255,255,.6); }
.seg button[aria-pressed=true], .seg-period button[aria-pressed=true], .seg-toggle button[aria-pressed=true] { background: #fff; border-color: var(--primary); color: var(--primary-ink); font-weight: 700; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.steps-toggle button[aria-pressed=true] { border-color: var(--sel); color: var(--sel-ink); }
.seg-period.prec { grid-template-columns: none; }
.picker-foot { gap: 10px; }
.picker-foot .picker-sum { font-size: 13.5px; }
/* 2. selects: one chevron for every dropdown */
select { -webkit-appearance: none; appearance: none; padding-right: 46px !important; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='12.5' fill='white' stroke='%23334155' stroke-width='1.5'/%3E%3Cpath d='m9.5 12 4.5 4.5 4.5-4.5' fill='none' stroke='%230F172A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 26px 26px; }
select:hover { border-color: var(--primary); }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { border-color: var(--field); border-radius: 10px; color: var(--ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
label .hint { font-size: 12.5px; font-weight: 400; color: var(--muted); }
/* 3. period selection is always blue */
.day.end, .day.end.d-ok, .day.end.d-zero, .day.end.d-inc, .day.end.d-none { background: var(--sel); border-color: var(--sel); color: #fff; }
.day.inr { box-shadow: inset 0 -4px 0 var(--sel); }
.iv-fields { border-color: var(--sel); }
.iv-fields button[aria-expanded=true] { background: var(--sel-soft); box-shadow: inset 0 -3px 0 var(--sel); }
.ruler-scale em, .results .bar em { background: rgba(37,99,235,.16); border-color: var(--sel); }
.ruler-scale em { background: var(--sel); }
.ruler-scale b { color: var(--sel-ink); }
.adv-badge { background: var(--sel-soft); color: var(--sel-ink); }
/* 4. summary card */
.answer { display: flex; flex-direction: column; gap: 14px; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--primary); border-radius: 14px; padding: 18px 20px; color: var(--ink); }
.answer.doubt { border-left-color: #D97706; }
.ans-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ans-main { display: flex; flex-direction: column; gap: 6px; flex: 1 1 320px; }
.answer .k { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #334155; }
.answer .v b { font-size: 44px; line-height: 1.05; color: #0B1F1C; white-space: nowrap; }
.answer .v span { font-size: 18px; color: #334155; }
.answer .ctx { font-size: 15px; color: #1F2937; }
.tiles-wrap { display: flex; flex-direction: column; gap: 8px; }
.tiles-h { font-size: 13px; font-weight: 600; color: #334155; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.stat-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #F8FAFC; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.stat-tile:hover { border-color: var(--primary); }
.stat-tile[aria-pressed=true] { border: 2px solid var(--primary); background: #F0FDFA; padding: 9px 11px; }
.stat-tile .tl { font-size: 12.5px; color: var(--muted); }
.stat-tile b { font-size: 18px; color: #0B1F1C; font-weight: 600; }
.stat-tile .tn { font-size: 12px; color: var(--muted); }
.ans-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 10px; }
.ans-meta b { color: var(--ink); font-weight: 600; }
.ans-meta .linkish { min-height: 0; padding: 0; }
.tag-doubt { flex: none; padding: 4px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 700; background: #FEF3C7; color: #78350F; border: 1px solid #F59E0B; }
/* 5. text contrast */
.muted { color: var(--muted); }
.kicker { color: #334155; }
.card-head { border-color: var(--line); }
.chip { border-color: var(--field); color: var(--ink); }
.chip:hover { border-color: var(--primary); background: #F0FDFA; }
.answer { flex-wrap: nowrap; height: auto; min-height: 0; }
.answer > * { flex: none; }
.stat-tiles { align-content: start; }

/* v5.9: Google-style (Material 3) buttons, prominent chart titles */
.btn-dark, button.btn-dark, .btn-line, .btn-light { border-radius: 999px; min-height: 40px; padding: 0 22px; font-size: 14.5px; font-weight: 500; letter-spacing: .01em; transition: box-shadow .15s, background .15s; }
.btn-dark:hover { box-shadow: 0 1px 3px rgba(15,23,42,.25), 0 1px 2px rgba(15,23,42,.15); }
.btn-dark:focus-visible, .btn-line:focus-visible { outline: 3px solid #99F6E4; outline-offset: 2px; }
.btn-line { border: 1px solid #94A3B8; color: var(--primary-ink); }
.btn-line:hover { background: #F0FDFA; border-color: var(--primary); }
.chip { border-radius: 8px; min-height: 34px; padding: 0 14px; font-size: 13.5px; font-weight: 500; }
.seg, .seg-period, .seg-toggle { border-radius: 999px; }
.seg button, .seg-period button, .seg-toggle button { border-radius: 999px; }
#picker-apply { padding: 0 26px; }
.dl { border-radius: 50%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pk-manual { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--ground); border-radius: 10px; }
.pk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pk-row input { width: 200px !important; min-height: 40px !important; }
.charts .card-head, .overview-card .card-head { background: #F8FAFC; }
.charts .card-head h2, .overview-card .card-head h2, #nb-title { font-size: 17px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.charts .card-head h2::before, .overview-card .card-head h2::before { content: ""; width: 4px; height: 20px; border-radius: 2px; background: var(--primary); flex: none; }
.card-head .muted.small { color: #334155; }

.nb-count { font-size: 14px; color: var(--ink); }
.nb-count b { font-weight: 700; }
.nb-more { gap: 8px; }
.nearby-list { max-height: none; }

/* v5.10: plain-language interval options, clear way back */
.radio-cards.stacked { grid-template-columns: 1fr; }
.radio-cards.stacked small { line-height: 1.4; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.back-btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin: 0 8px 0 4px; color: #94A3B8; }
.crumbs li a { color: var(--primary-ink); }
.crumbs li[aria-current] { color: var(--ink); }

/* ================= v6: state map landing, two-panel state page, answer-first station page ================= */
.page h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.home-head { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: flex-end; }
.home-head > div:first-child { flex: 1 1 380px; }
.home-head p { margin: 6px 0 0; max-width: 620px; }
.home-search { flex: 0 1 380px; }
.home-map-card { padding: 14px 18px; }
.mx-map svg { display: block; width: 100%; height: auto; max-height: calc(100vh - 300px); min-height: 300px; }
.mx-st path { stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; cursor: pointer; transition: fill .12s; }
.mx-st.lv0 path { fill: #DCE5E2; } .mx-st.lv1 path { fill: #8CC5BE; } .mx-st.lv2 path { fill: #0F766E; }
.mx-st:hover path, .mx-st:focus path { fill: #1D4ED8; }
.mx-st:focus { outline: none; } .mx-st:focus path { stroke: #0F172A; stroke-width: 2; }
.mx-lbl text { font-family: var(--mono); font-size: 12px; font-weight: 600; fill: #0F172A; text-anchor: middle; dominant-baseline: central; pointer-events: none;
  paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 3px; }
.mx-lbl text.sm { font-size: 10px; stroke-width: 2.5px; }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.sw-0 { background: #DCE5E2; } .sw-1 { background: #8CC5BE; } .sw-2 { background: #0F766E; }
.mx-hover { margin-left: auto; font-weight: 600; color: var(--ink); min-height: 18px; }
.state-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.state-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: baseline; padding: 10px 12px; background: #fff; border: 1px solid var(--line);
  border-left: 5px solid #DCE5E2; border-radius: 10px; text-decoration: none; color: var(--ink); min-height: 44px; }
.state-list a.lv1 { border-left-color: #8CC5BE; } .state-list a.lv2 { border-left-color: #0F766E; }
.state-list a:hover { border-color: var(--primary); }
.state-list a b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.state-list a .small { grid-column: 1 / -1; }

.state-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.state-title { flex: 1 1 300px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.state-save .badge { font-size: 13px; padding: 6px 12px; border-radius: 999px; }
.back-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 8px; text-decoration: none; }
.filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; padding: 14px 18px; }
.filterbar .seg { flex: 0 0 auto; }
.filterbar .seg button { padding: 0 16px; white-space: nowrap; }
.fb-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; flex: 1 1 420px; }
.fb-fields > * { flex: 1 1 190px; min-width: 0; }
.fb-fields .fb-note { flex: 1 1 100%; margin: 0; }
#form-coord.fb-fields > label { flex: 0 1 150px; }
#form-coord .fb-note { flex: 1 1 200px; align-self: center; }
.filterbar .check { min-height: 44px; white-space: nowrap; }
.filterbar .adv { border: 0; padding: 0; position: relative; }
.filterbar .adv summary { gap: 8px; padding: 0 14px; border: 1px solid var(--field); border-radius: 8px; background: #fff; font-weight: 500; }
.filterbar .adv-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1100; width: min(380px, 90vw); background: #fff; border: 1px solid var(--field); box-shadow: 0 10px 28px rgba(15,23,42,.16); }
.state-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.state-split .map-card { position: sticky; top: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.state-split #map { height: calc(100vh - 330px); min-height: 400px; }
.state-split .results { max-height: calc(100vh - 400px); min-height: 330px; }
@media (max-width: 1000px) { .state-split { grid-template-columns: 1fr; } .state-split .map-card { position: static; } .state-split #map { height: 380px; min-height: 0; } .state-split .results { max-height: none; } }
.results .go { flex: none; margin-right: 12px; display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; background: var(--primary); color: #fff;
  font-weight: 600; font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.results .go:hover { background: var(--primary-hover); color: #fff; }
.results .dl { margin: 0 8px 0 6px; width: 40px; height: 40px; }
.dl[data-saved=true] { background: #fff; border-color: var(--primary); color: var(--primary); cursor: default; }
.map-pop { font-family: var(--sans); font-size: 13.5px; line-height: 1.5; }
.map-pop b { display: block; font-size: 14.5px; }
.map-pop a { font-weight: 600; }
#save-status { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }

/* station page: the answer and its chart lead; readings as instrument tiles */
.card.hero { padding: 0; overflow: hidden; border-left: 6px solid var(--primary); }
.ans-hero { padding: 18px 22px 14px; display: flex; flex-direction: column; gap: 6px; }
.ans-hero.doubt { background: #FFFBEB; }
.card.hero:has(.ans-hero.doubt) { border-left-color: #D97706; }
.ans-hero .k { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #334155; }
.ans-hero .v { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.ans-hero .v b { font-size: 52px; line-height: 1.05; font-weight: 600; letter-spacing: -.02em; color: #0B1F1C; white-space: nowrap; }
.ans-hero .v > span:not(.tag-doubt) { font-size: 20px; color: #334155; }
.ans-hero .v .tag-doubt { align-self: center; margin-left: 6px; }
.ans-hero .ctx { font-size: 15px; color: #1F2937; }
.hero-sub { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; padding: 10px 22px; background: #F8FAFC; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-sub h2 { font-size: 15px; font-weight: 600; }
.card.hero > .chart { padding: 14px 18px 12px; }
.wx { display: flex; flex-direction: column; gap: 12px; }
.wx-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; }
.wx-h h2 { font-size: 16px; font-weight: 700; }
.wx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.wx-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px 12px; min-height: 196px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; color: var(--ink); text-align: center; cursor: pointer; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.wx-tile.static { cursor: default; background: #F8FAFC; }
button.wx-tile:hover { border-color: var(--primary); }
.wx-tile[aria-pressed=true] { border: 2px solid var(--primary); padding: 11px 9px; background: #F0FDFA; }
.wx-tile .tl { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #334155; min-height: 30px; display: flex; align-items: center; }
.wx-tile .g { width: 76px; height: 76px; flex: none; }
.wx-tile b { font-size: 24px; font-weight: 500; color: #0B1F1C; line-height: 1.1; white-space: nowrap; }
.wx-tile b small { font-size: 13px; font-weight: 500; color: #475569; margin-left: 4px; }
.wx-tile .tn { font-size: 12px; color: var(--muted); }
.wx .ans-meta { border-top: 0; padding-top: 0; }
.wx .alert-flags { margin: 0; }
.st-results .charts { gap: 16px; }
.st-results .answer-wrap { flex-wrap: nowrap; gap: 16px; }
.st-results .answer-wrap > * { min-width: 0; max-width: 100%; }
.wx-tile b.long { font-size: 18px; }

/* ================= v6.1: NWS-style state page — search module + list in a sidebar, big map beside ================= */
.nws { display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.nws-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.find { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.find-t { font-size: 15px; font-weight: 700; }
.seg-full { width: 100%; }
.seg-full button { padding: 0 8px; font-size: 14px; }
.find-fields { display: flex; flex-direction: column; gap: 12px; }
.find-fields .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.find-fields select { min-height: 44px; }
.find .adv { border-top: 1px solid var(--line); padding-top: 4px; }
.find .adv summary { min-height: 44px; font-weight: 600; }
.find .check { min-height: 32px; }
.nws-map { position: sticky; top: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.nws-map #map { height: calc(100vh - 190px); min-height: 460px; border-radius: 10px; }
.tile-note { margin-left: auto; color: #8A5A00; }

/* compact rows for the sidebar list */
.nws .results-card .card-head { padding: 12px 14px; flex-wrap: nowrap; }
.nws .results-card .card-head h2 { font-size: 14.5px; }
.nws .results { max-height: calc(100vh - 210px); min-height: 280px; }
.nws .ruler { display: block; padding: 6px 14px 4px 14px; }
.nws .ruler-scale { height: 18px; }
.nws .results li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0 8px; padding: 0 12px 10px 0; }
.nws .results .pick { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "clave name dist" "span span span";
  gap: 4px 10px; padding: 10px 2px 6px 14px; align-items: baseline; }
.nws .results .clave { grid-area: clave; font-size: 13px; }
.nws .results .pick > span:nth-child(2) { grid-area: name; }
.nws .results .span { grid-area: span; gap: 4px; }
.nws .results .dist { grid-area: dist; font-size: 12.5px; }
.nws .results .name { font-size: 14px; }
.nws .results .yrs { font-size: 11.5px; }
.nws .results .dl { grid-column: 2; margin: 0; width: 36px; height: 36px; }
.nws .results .go { grid-column: 3; margin: 0; min-height: 36px; padding: 0 12px; font-size: 13px; }
.nws .results li::before { content: ""; grid-column: 1; }
.nws .results-foot { padding: 8px 14px; font-size: 12px; }
#data-note { padding: 12px 16px; border-radius: 10px; }
#data-note code { font-size: 12.5px; word-break: break-all; background: rgba(255,255,255,.7); padding: 1px 4px; border-radius: 4px; }
@media (max-width: 960px) {
  .nws { grid-template-columns: 1fr; }
  .nws-map { position: static; order: -1; }
  .nws-map #map { height: 360px; min-height: 0; }
  .nws .results { max-height: none; }
}
/* actions to the right of each row: Ver datos on top, save state under it */
.nws .results li { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; padding: 0 12px 0 0; gap: 0 6px; }
.nws .results li::before { content: none; }
.nws .results .pick { grid-column: 1; grid-row: 1 / span 2; padding: 10px 0 10px 14px; }
.nws .results .go { grid-column: 2; grid-row: 1; align-self: end; margin-top: 10px; }
.nws .results .dl { grid-column: 2; grid-row: 2; justify-self: end; align-self: start; margin: 6px 0 10px; width: 32px; height: 32px; }
.nws .ruler { display: none; }

/* ================= v6.2: v5 three-panel look; module on the first screen; tabbed right panel ================= */
@media (min-width: 1440px) { .page, .topbar { max-width: 1880px; } }

/* first screen */
.home-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
.home-grid .find { position: sticky; top: 12px; }
.home-map-card { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.home-map-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.home-map-head h1 { font-size: 22px; }
.mx-map svg { max-height: calc(100vh - 290px); min-height: 280px; margin: 0 auto; }
.find .btn-dark { width: 100%; }
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } .home-grid .find { position: static; } }

/* second screen: module | minimap + radius + dark card | list */
.tri { display: grid; grid-template-columns: 340px minmax(0, 1fr) minmax(400px, 460px); gap: 20px; align-items: start; }
.tri > .find { position: sticky; top: 12px; }
.tri-mid { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 12px; min-width: 0; }
.tri-mid .map-card { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.tri-mid #map { height: calc(100vh - 430px); min-height: 360px; border-radius: 10px; }
.radius-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 16px; padding: 0 4px; }
.radius-row label { flex-direction: row; gap: 8px; font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; }
.radius-row input { width: 100%; accent-color: var(--accent); min-height: 28px; padding: 0; border: 0; }
.radius-row .ticks { grid-column: 2; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.tri .results-card .card-head { padding: 14px 16px; }
.tri .results { max-height: calc(100vh - 240px); min-height: 320px; }
.tri .ruler { display: none; }
.tri .results li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 4px; padding-right: 12px; }
.tri .results .pick { grid-column: 1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "clave name dist" "span span span";
  gap: 6px 12px; padding: 12px 4px 12px 16px; align-items: baseline; }
.tri .results .clave { grid-area: clave; }
.tri .results .pick > span:nth-child(2) { grid-area: name; }
.tri .results .span { grid-area: span; }
.tri .results .dist { grid-area: dist; }
.tri .results .dl { grid-column: 2; margin: 0; }
.tri .results-foot { padding: 10px 16px; }
.selected .btn-light { white-space: nowrap; }
@media (max-width: 1280px) {
  .tri { grid-template-columns: 320px minmax(0, 1fr); }
  .tri .results-card { grid-column: 1 / -1; }
  .tri .results { max-height: 520px; }
}
@media (max-width: 860px) {
  .tri { grid-template-columns: 1fr; }
  .tri > .find, .tri-mid { position: static; }
  .tri-mid #map { height: 360px; min-height: 0; }
}

/* third screen: consulta | answer | more views */
.st-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr) minmax(380px, 440px); gap: 20px; align-items: start; }
.st-side { max-width: none; }
.st-results { min-width: 0; }
.st-tabs { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.tabbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tabbtns [role=tab] { min-height: 52px; padding: 8px 10px; border: 1px solid #C9D1CF; border-radius: 10px; background: #EEF2F1; color: var(--ink);
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1.25; cursor: pointer; text-align: center; }
.tabbtns [role=tab]:hover { background: #E3E9E7; }
.tabbtns [role=tab][aria-selected=true] { background: #fff; border: 2px solid var(--primary); color: var(--primary); padding: 7px 9px; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.tabbtns [role=tab]:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 2px; }
.tabpane { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tabpane[hidden] { display: none; }
.tabpane h2 { font-size: 16px; font-weight: 700; }
.tabpane > p { margin: 0 0 4px; }
.st-tabs .nearby { border: 0; padding: 0; gap: 12px; }
.st-tabs .nearby-head { flex-direction: column; align-items: stretch; }
.st-tabs .nearby-head h2 { font-size: 16px; }
.st-tabs .radius { min-width: 0; }
.st-tabs .nearby-body { flex-direction: column; flex-wrap: nowrap; }
.st-tabs .minimap-wrap { flex: none; width: 100%; }
.st-tabs #minimap { max-width: none; height: 300px; }
.st-tabs .nearby-list { width: 100%; }
.q-sum { color: var(--muted); padding-top: 4px; }
@media (max-width: 1360px) {
  .st-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .st-tabs { grid-column: 1 / -1; position: static; max-height: none; }
  .tabbtns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) { .st-layout { grid-template-columns: 1fr; } .tabbtns { grid-template-columns: 1fr 1fr; } }

/* ================= v6.3 ================= */
/* radius slider: thick teal track, big thumb, value pill riding on it, −/+ steps */
.radius-row { grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; padding: 4px 4px 0; }
.rs { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 12px; }
.rs-step { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--primary); background: #fff; color: var(--primary); font: 600 22px/1 var(--sans); cursor: pointer; }
.rs-step:hover { background: var(--primary); color: #fff; }
.rs-step:focus-visible, .rs-track input:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 2px; }
.rs-track { position: relative; padding-top: 34px; }
.rs-pill { position: absolute; top: 0; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; pointer-events: none; }
.rs-pill::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: var(--primary); }
.rs-track input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; padding: 0; border: 0; cursor: pointer; --fill: 50%; }
.rs-track input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(to right, var(--primary) var(--fill), #D3DCDA var(--fill)); }
.rs-track input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: #D3DCDA; }
.rs-track input[type=range]::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--primary); }
.rs-track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%; background: var(--primary); border: 4px solid #fff; box-shadow: 0 1px 4px rgba(15,23,42,.35); }
.rs-track input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--primary); border: 4px solid #fff; box-shadow: 0 1px 4px rgba(15,23,42,.35); }
.rs-track .ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.radius-row > label { align-self: start; margin-top: 40px; }

/* criteria next to the station name, in the header bar */
.st-crit { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 10px; background: var(--ground); font-size: 13.5px; min-width: 0; }
.st-crit b { font-weight: 600; }
.st-crit .linkish { align-self: flex-start; }
#st-head { flex-wrap: wrap; }

/* swappable views */
.vblock { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.vb-head > div { min-width: 0; }
.vb-head h2 { font-size: 16px; font-weight: 700; }
.vb-head p { margin: 2px 0 0; }
.vb-swap { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--primary); background: #fff; color: var(--primary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.vb-swap:hover { background: var(--primary); color: #fff; }
.vb-swap:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 2px; }
#hero-slot .vblock { gap: 0; }
#hero-slot .vb-head { padding: 10px 22px; background: #F8FAFC; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); align-items: center; }
#hero-slot .vb-head h2 { font-size: 15px; font-weight: 600; }
#hero-slot .vblock > :not(.vb-head) { padding: 14px 18px 12px; }
#hero-slot .vblock.in-center:not([data-view=main]) { box-shadow: inset 4px 0 0 #E08A2E; }
.tabbtns [role=tab].holds-main { font-style: italic; }
.vblock[data-view=near] .vb-head > div:empty { display: none; }
.vblock[data-view=near] .vb-head { justify-content: flex-end; }

/* downloads */
.dl-box { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; position: sticky; bottom: -14px; background: #fff; padding-bottom: 14px; margin-bottom: -14px; }
.dl-box h2 { font-size: 15px; font-weight: 700; }
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dl-grid button { min-height: 44px; border-radius: 999px; font-size: 14px; }
.dl-grid .btn-line { border: 1.5px solid var(--primary); color: var(--primary); background: #fff; }
.dl-grid .btn-line:hover { background: #F0FDFA; }
.dl-opts summary { min-height: 36px; font-size: 13.5px; font-weight: 600; }
.dl-opts fieldset { border: 0; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.dl-opts legend { color: var(--muted); padding: 0; margin-bottom: 2px; }
.dl-opts .check { min-height: 32px; font-size: 13.5px; }
#dl-msg { margin: 0; min-height: 18px; }
#dl-msg.warn-t { color: #9A3412; }
/* Vega measures clientWidth (padding included): space charts with margin, never padding */
#hero-slot .vblock > :not(.vb-head) { padding: 0; margin: 14px 18px 12px; }
.card.hero > .chart { padding: 0; margin: 14px 18px 12px; }
#hero-slot .vblock > :not(.vb-head), .card.hero > .chart { width: auto !important; max-width: none; }

/* ================= v6.4 ================= */
/* steppers: − value + (as in the 'reglas' tool) */
.stepper { display: inline-grid; grid-template-columns: 40px minmax(56px, 72px) 40px auto; align-items: center; border: 1px solid var(--field); border-radius: 10px; background: #fff; overflow: hidden; max-width: 100%; }
.stepper input { border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; min-height: 42px; padding: 0 4px; font-size: 15px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button { min-height: 42px; border: 0; background: #F1F5F4; color: var(--ink); font: 600 19px/1 var(--sans); cursor: pointer; }
.stepper button:hover { background: var(--primary); color: #fff; }
.stepper button:focus-visible, .stepper input:focus-visible { outline: 3px solid #1D4ED8; outline-offset: -3px; }
.stepper .unit { padding: 0 12px; color: var(--muted); font-size: 13.5px; white-space: nowrap; }
#dlg-settings .stepper { margin-bottom: 2px; }

/* interval rules: highlighted box under Desde/Hasta */
.iv-rules { margin: 10px 0 0; padding: 12px 12px 10px; border: 2px solid var(--primary); border-radius: 12px; background: #F0FDFA; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.iv-rules[hidden] { display: none; }
.iv-rules legend { padding: 0 6px; font-weight: 700; font-size: 14px; color: var(--primary); }
.iv-rules > label { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-top: 4px; }
.iv-rules .stepper { grid-template-columns: 36px 56px 36px minmax(0, 1fr); width: 100%; }
.iv-rules .stepper .unit { white-space: normal; line-height: 1.2; padding: 0 8px; font-size: 12.5px; }
.iv-rules p { margin: 4px 0 0; }
.iv-rules .linkish { align-self: flex-start; font-size: 12.5px; }

/* period strip in the interval answer */
.periods { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 4px; }
.pstrip { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.pstrip li { min-width: 0; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; border: 1px solid transparent; }
.pstrip li b { font-family: var(--mono); font-size: 14px; }
.pstrip li small { font-family: var(--mono); font-size: 11.5px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstrip .ps-ok { background: #0E6B66; color: #fff; }
.pstrip .ps-bad { background: #8A3C10; color: #fff; }
.pstrip .ps-inc { background: #F1F5F4; color: var(--muted); border-color: var(--line); border-style: dashed; }

/* highlight: quality criteria + swap, in the dark shade of the station code */
.st-crit { background: var(--dark); color: var(--on-dark); }
.st-crit .muted { color: var(--on-dark-muted) !important; }
.st-crit b { color: #fff; }
.st-crit .linkish { background: var(--on-dark); color: var(--ink); text-decoration: none; border-radius: 999px; padding: 5px 14px; font-weight: 600; margin-top: 4px; }
.st-crit .linkish:hover { background: #fff; }
.vb-swap { background: var(--dark); border-color: var(--dark); color: #fff; }
.vb-swap:hover { background: #24342F; border-color: #24342F; color: #fff; }
#open-settings { background: var(--dark); border-color: var(--dark); color: #fff; }
#open-settings:hover { background: #24342F; color: #fff; }

/* ================= v6.5: responsive without overlaps; readable labels ================= */
/* Default for every width: nothing sticky. Sticky only when the three panels sit side by side. */
.home-grid .find, .tri > .find, .tri-mid, .st-side, .st-tabs { position: static; max-height: none; overflow: visible; }
.dl-box { position: static; margin-bottom: 0; }
.tri .results-card, .st-tabs { grid-column: auto; }

@media (min-width: 1100px) {
  .tri { grid-template-columns: clamp(260px, 20vw, 340px) minmax(0, 1fr) clamp(300px, 26vw, 460px); }
  .tri > .find, .tri-mid { position: sticky; top: 12px; }
  .tri .results { max-height: calc(100vh - 240px); }
  .tri-mid #map { height: clamp(320px, calc(100vh - 430px), 720px); min-height: 0; }
  .st-layout { grid-template-columns: clamp(250px, 19vw, 320px) minmax(0, 1fr) clamp(300px, 25vw, 440px); }
  .st-side, .st-tabs { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
  .tabbtns { grid-template-columns: 1fr 1fr; }
  .dl-box { position: sticky; bottom: -14px; margin-bottom: -14px; }
  .home-grid .find { position: sticky; top: 12px; }
}
@media (min-width: 760px) and (max-width: 1099.98px) {
  .tri { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
  .tri .results-card { grid-column: 1 / -1; }
  .tri .results { max-height: 560px; }
  .tri-mid #map { height: clamp(300px, 55vh, 520px); min-height: 0; }
  .st-layout { grid-template-columns: minmax(240px, 290px) minmax(0, 1fr); }
  .st-tabs { grid-column: 1 / -1; }
  .tabbtns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); }
}
@media (max-width: 759.98px) {
  .tri, .st-layout, .home-grid { grid-template-columns: 1fr; }
  .tri-mid #map { height: 340px; min-height: 0; }
  .tri .results { max-height: none; }
  .tabbtns { grid-template-columns: 1fr 1fr; }
  .st-crit, .st-head details.st-file { flex: 1 1 100%; max-width: none; }
  .selected { padding: 16px; }
  .selected .btn-light { width: 100%; }
  .page { padding-left: 12px; padding-right: 12px; }
}

/* labels everyone can read: bigger, bold, full contrast, plain questions */
.q-lbl { display: block; font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: 0; text-transform: none; margin: 0; }
.st-side > h2.q-lbl { font-size: 18px; }
.q-sub { font-size: 14px; font-weight: 500; color: var(--ink); }
.st-side label > .q-lbl { margin-bottom: 2px; }
.st-side .hint { color: #33433F; font-size: 13px; }
.st-crit > .muted:first-child { color: #fff !important; font-size: 15px; font-weight: 700; }
.st-crit b { font-size: 14.5px; font-weight: 500; color: #E6ECEA; }
.iv-rules legend { font-size: 16px; color: var(--ink); background: #F0FDFA; padding: 0 8px; }
.iv-rules > label { font-size: 14px; }
.tabpane h2, .vb-head h2 { color: var(--ink); }
.dl-box h2 { font-size: 16px; }
/* narrow left panel: let its controls fit instead of clipping */
.st-side #form-q .row { flex-wrap: wrap !important; }
.st-side #form-q .row > * { flex: 1 1 120px; }
.st-side .seg-period button { white-space: nowrap; padding: 0 6px; font-size: 14px; min-width: 0; }
.st-side #b-my { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.st-side select, .st-side input { min-width: 0; width: 100%; }
@media (min-width: 1100px) { .st-layout { grid-template-columns: clamp(270px, 20vw, 320px) minmax(0, 1fr) clamp(300px, 25vw, 440px); } }
@media (max-width: 759.98px) { .radius-row { grid-template-columns: 1fr; } .radius-row > label { margin-top: 0; } }

/* ================= v6.6: brand + credits ================= */
.topbar .brand { display: flex; flex-direction: row; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.topbar .brand img { flex: none; }
.brand-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-name { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; color: var(--ink); }
.brand-sub { font-size: 13.5px; color: #3D4B47; }
.about-link { text-decoration: none; }
.about-hero { display: flex; align-items: center; gap: 24px; padding: 24px 28px; }
.about-hero h1 { font-size: 34px; margin: 0; }
.about-title { font-size: 17px; margin: 2px 0 6px; color: var(--ink); }
.about-hero p { margin: 0; }
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.about-wide { grid-column: 1 / -1; }
.about-sec { padding: 22px 26px; display: flex; flex-direction: column; gap: 8px; }
.about-sec h2 { font-size: 18px; margin: 10px 0 2px; }
.about-sec h2:first-child { margin-top: 0; }
.about-sec h3 { font-size: 15px; margin: 8px 0 0; color: #3D4B47; }
.about-sec p { margin: 0; line-height: 1.5; }
.people, .data { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.people li, .data li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.people li b { font-size: 16px; }
.data li { flex-direction: column; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.cite { font-size: 14px; background: var(--ground); border-radius: 10px; padding: 10px 12px; }
.tbl-wrap { overflow-x: auto; }
.libs { width: 100%; border-collapse: collapse; font-size: 14px; }
.libs th, .libs td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.libs th { background: #F1F5F4; font-weight: 600; }
@media (max-width: 759.98px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-hero { flex-direction: column; align-items: flex-start; }
  .brand-name { font-size: 22px; } .brand-sub { display: none; }
}

/* ================= v6.9: map tooltip (fixes hover shake) ================= */
.mx-map { position: relative; }
.mx-tip { position: absolute; z-index: 5; pointer-events: none; display: flex; flex-direction: column; gap: 2px;
  background: #12201D; color: #fff; border-radius: 10px; padding: 9px 12px; font-size: 14px; line-height: 1.35;
  box-shadow: 0 6px 18px rgba(18, 32, 29, .25); max-width: 240px; }
.mx-tip[hidden] { display: none; }
.mx-tip b { font-size: 16px; font-weight: 700; }
.mx-tip .lv0 { color: #C9D4D1; } .mx-tip .lv1 { color: #8CE0D5; } .mx-tip .lv2 { color: #5EEAD4; font-weight: 600; }

/* ================= v6.10: typed interval + whole-interval rule ================= */
.iv-type { display: flex; flex-direction: column; gap: 8px; }
.iv-type[hidden] { display: none; }
.iv-pair { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--sel); border-radius: 10px; overflow: hidden; background: #fff; }
.iv-f { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px 7px; margin: 0; min-width: 0; }
.iv-f + .iv-f { border-left: 1px solid var(--line); }
.iv-f:focus-within { background: var(--sel-soft); box-shadow: inset 0 -3px 0 var(--sel); }
.iv-f .lbl { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: #3D4B47; }
.iv-f input { border: 0 !important; padding: 2px 0 !important; min-height: 0 !important; height: auto; font-size: 18px; font-weight: 600; background: transparent; width: 100%; box-shadow: none !important; outline: none; }
.iv-f input[aria-invalid=true] { color: #B91C1C; }
.iv-read { font-size: 12.5px; color: #3D4B47; }
.iv-help { margin: 0; font-size: 12.5px; color: #3D4B47; line-height: 1.35; }
.iv-type .field-error { margin: 0; }
.iv-cal { display: inline-flex; align-items: center; justify-content: center; gap: 8px; align-self: stretch; }
.iv-cal[aria-expanded=true] { background: var(--sel-soft); border-color: var(--sel); }
.ivrule { display: flex; gap: 16px; align-items: center; padding: 12px 16px; border-radius: 12px; border: 2px solid; }
.ivrule.ok { border-color: #99F6E4; background: #F0FDFA; }
.ivrule.bad { border-color: #FCA5A5; background: #FEF2F2; }
.ivr-num { display: flex; align-items: center; gap: 8px; flex: none; }
.ivr-num b { font-size: 34px; line-height: 1; }
.ivrule.ok .ivr-num b { color: #0F766E; } .ivrule.bad .ivr-num b { color: #B91C1C; }
.ivr-num span { font-size: 12.5px; color: #3D4B47; line-height: 1.25; }
.ivr-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.ivr-txt b { font-size: 16px; }
.ivr-txt small { color: #3D4B47; font-size: 12.5px; }
@media (max-width: 520px) { .ivrule { flex-direction: column; align-items: flex-start; } }

/* ================= v6.11: local program not answering ================= */
.srv-down { position: sticky; top: 0; z-index: 50; display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px;
  padding: 12px 20px; background: #7F1D1D; color: #fff; font-size: 15px; line-height: 1.4; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.srv-down[hidden] { display: none; }
.srv-down b { font-size: 17px; }
.srv-spin { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; opacity: .9; }
.srv-down .spinner { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
#state-msg:empty { display: none; }
#state-msg { margin: 0 0 12px; }

/* ================= v6.12: «Desde» on top, one calendar for «Hasta»; 3 panels from 1280 px ================= */
.pk-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 24px; }
.pk-from { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 8px 12px 10px; border: 2px solid var(--sel); border-radius: 10px; background: var(--sel-soft); min-width: 0; }
.pk-from legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--sel-ink); }
.pk-field { min-height: 40px !important; height: 40px; padding: 4px 10px !important; border: 1.5px solid #64748B !important; border-radius: 8px !important; background: #fff !important; font-size: 16px; font-weight: 600; }
#pkf-year, .pk-yearbox { width: 86px !important; text-align: center; }
#pkf-month, #pkt-month { width: auto !important; min-width: 130px; }
#pkf-day { width: 78px !important; }
.pk-field:focus { outline: 3px solid rgba(37, 99, 235, .35); border-color: var(--sel) !important; }
.pk-hint { margin: 2px 0 0; font-size: 14px; color: var(--ink); }
.pk-to { display: flex; flex-direction: column; gap: 10px; }
.pk-yearnav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.pk-yearnav .lbl-strong { font-size: 15px; }
.pk-yearnav .round:disabled { opacity: .35; cursor: default; }
.pk-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.day.before, .mday.before { background: repeating-linear-gradient(135deg, #F8FAFC 0 6px, #EEF2F6 6px 12px) !important; border-color: #E2E8F0 !important; color: #94A3B8 !important; box-shadow: none !important; cursor: not-allowed; }
.picker .cal-grid { max-width: 560px; }

/* side box: the two dates must look like fields you can type in */
.iv-f input { border: 1.5px solid #64748B !important; border-radius: 7px !important; background: #fff !important; padding: 3px 8px !important; margin-top: 2px; }
.iv-f input:hover { border-color: var(--sel) !important; }
.iv-f input:focus { border-color: var(--sel) !important; outline: 3px solid rgba(37, 99, 235, .3); }
.iv-f .lbl::after { content: " · escribe"; font-weight: 500; color: #64748B; }

/* the minimap (Leaflet panes use z-index 400+) must stay under the sticky download block */
/* every Leaflet map keeps its own positioning context wherever it is moved (v6.13: the v6.12 rule only applied
   inside the right panel, so Leaflet skipped its inline position:relative and «Ver al centro» threw the map to the page corner) */
.leaflet-container, .minimap-wrap { isolation: isolate; z-index: 0; position: relative; }
.dl-box { z-index: 5; background: #fff; }

/* station page: three panels only from 1280 px; below, question + result side by side, views underneath */
@media (min-width: 1100px) and (max-width: 1279.98px) {
  .st-layout { grid-template-columns: minmax(260px, 310px) minmax(0, 1fr); }
  .st-side, .st-tabs { position: static; max-height: none; overflow: visible; }
  .st-tabs { grid-column: 1 / -1; }
  .tabbtns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dl-box { position: static; margin-bottom: 0; }
}

/* ================= v6.13: record timeline (Desde / Hasta handles over the whole record) ================= */
.iv-timeline { padding: 14px 18px 10px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.iv-timeline[hidden] { display: none; }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.tl-head b { font-size: 16px; }
.tl-head .linkish { margin-left: auto; font-size: 14px; }
.tl { position: relative; height: 64px; margin: 30px 14px 0; touch-action: none; }
.tl-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 1px; cursor: pointer; }
.tl-bars i { flex: 1 1 0; min-width: 0; border-radius: 2px 2px 0 0; }
.tl-full { background: #0F766E; } .tl-part { background: #F59E0B; } .tl-bad { background: #FDA4AF; } .tl-none { background: #CBD5E1; }
.tl-sel { position: absolute; top: -4px; bottom: -4px; background: rgba(37, 99, 235, .14); border-top: 3px solid var(--sel); border-bottom: 3px solid var(--sel); pointer-events: none; }
.tl-h { position: absolute; top: -8px; bottom: -8px; width: 18px; margin-left: -9px; border: 0; border-radius: 6px; background: var(--sel); cursor: ew-resize; padding: 0; box-shadow: 0 1px 4px rgba(0,0,0,.25); touch-action: none; }
.tl-h::after { content: ""; position: absolute; left: 7px; right: 7px; top: 30%; bottom: 30%; border-left: 2px solid rgba(255,255,255,.8); border-right: 2px solid rgba(255,255,255,.8); }
.tl-h:focus-visible { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }
.tl-h span { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--sel); color: #fff; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 6px; pointer-events: none; }
.tl-hb span { background: #1E3A8A; }
.tl-ticks { position: relative; height: 18px; margin: 0 14px; font-family: var(--mono); font-size: 12px; color: #3D4B47; }
.tl-ticks span { position: absolute; transform: translateX(-50%); }
.st-results #minimap { max-width: none; height: clamp(360px, 55vh, 560px); }
.st-results .minimap-wrap { flex: 1 1 auto; width: 100%; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; } .tl-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ================= v6.14: «Periodo» card (dates first, timeline second, helpers third) ================= */
.period-card { padding: 16px 20px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.period-card[hidden] { display: none; }
.pc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.pc-head h2 { margin: 0; font-size: 20px; }
.pc-dates { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; }
.pc-arrow { align-self: center; font-size: 22px; color: #64748B; }
.pc-date { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 52px 10px 14px; border: 2px solid #CBD5E1; border-radius: 12px; background: #fff; min-width: 0; }
.pc-date:focus-within, .pc-date.editing { border-color: var(--sel); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.pc-lbl { font-size: 13px; font-weight: 700; color: #334155; }
.pc-in { border: 0 !important; outline: none; padding: 0 !important; min-height: 0 !important; height: auto; background: transparent !important; box-shadow: none !important; font-size: 22px; font-weight: 700; color: var(--ink); width: 100%; font-family: var(--sans, inherit); }
.pc-in[aria-invalid=true] { color: #B91C1C; }
.pc-read { font-size: 13px; color: #334155; }
.pc-cal { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid #CBD5E1; background: #F8FAFC; color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.pc-cal:hover, .pc-cal[aria-expanded=true] { border-color: var(--sel); background: var(--sel-soft); color: var(--sel-ink); }
.period-card .picker { border: 1.5px solid #BFDBFE; border-radius: 12px; padding: 12px 14px; background: #FAFCFF; display: flex; flex-direction: column; gap: 10px; }
.period-card .picker[hidden] { display: none; }
.pk-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.pk-top b { font-size: 16px; color: var(--sel-ink); }
.pk-top .btn-line { margin-left: auto; }
.mday.other, .day.other { box-shadow: inset 0 0 0 2px var(--sel) !important; }
.mday.d-ok, .day.d-ok { background: #ECFDF5; border-color: #6EE7B7; }
.mday.d-none, .day.d-none { background: #F1F5F9; border-color: #CBD5E1; border-style: solid; }
.pc-sum { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 10px; border-top: 1px solid var(--line-soft, #E2E8F0); }
.pc-count { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.pc-count b { font-size: 16px; margin-right: 4px; }
.pc-chip { padding: 2px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pc-chip.ok { background: #ECFDF5; color: #065F46; } .pc-chip.inc { background: #FEF3C7; color: #92400E; }
.pc-chip.zero { background: #FFE4E6; color: #9F1239; } .pc-chip.none { background: #F1F5F9; color: #334155; }
.iv-valid { padding: 4px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 700; }
.iv-valid.ok { background: #DCFCE7; color: #166534; } .iv-valid.bad { background: #FEE2E2; color: #991B1B; }
.iv-valid.wait, .iv-valid.na { background: #F1F5F9; color: #475569; font-weight: 600; }
.pc-help { margin: 0; font-size: 14px; color: #334155; line-height: 1.45; }
.pk-presets .chip[aria-pressed=true] { background: var(--sel-soft); border-color: var(--sel); color: var(--sel-ink); }
.iv-note { margin: 8px 0 0; font-size: 14px; color: #334155; }
.iv-note[hidden] { display: none; }
@media (max-width: 620px) { .pc-dates { grid-template-columns: 1fr; } .pc-arrow { display: none; } }

/* timeline v2: bigger handles, distinct selection, bars outside the period faded */
.iv-timeline { padding: 0; margin: 0; border: 0; box-shadow: none; }
.tl { height: 72px; margin: 34px 16px 0; }
.tl-bars i.out { opacity: .35; }
.tl-sel { top: -6px; bottom: -6px; background: repeating-linear-gradient(135deg, rgba(37,99,235,.10) 0 8px, rgba(37,99,235,.18) 8px 16px); border: 3px solid var(--sel); border-left: 0; border-right: 0; pointer-events: auto; cursor: grab; }
.tl-sel:active { cursor: grabbing; }
.tl-h { width: 26px; margin-left: -13px; top: -12px; bottom: -12px; border-radius: 8px; }
.tl-h::after { left: 9px; right: 9px; }
.tl-h span { font-size: 14px; padding: 3px 10px; }
.tl-h span.lft { transform: translateX(-100%); left: 100%; }
.tl-h span.rgt { transform: none; left: 0; }
.tl-selsw { background: repeating-linear-gradient(135deg, rgba(37,99,235,.15) 0 4px, rgba(37,99,235,.3) 4px 8px); border: 2px solid var(--sel); }

/* left panel: optional text question, collapsed */
.ask { border: 1.5px solid #CBD5E1; border-radius: 10px; padding: 0; margin-bottom: 12px; background: #fff; }
.ask[open] { padding-bottom: 12px; }
.ask-sum { list-style: none; cursor: pointer; padding: 10px 12px; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.ask-sum::-webkit-details-marker { display: none; }
.ask-sum .chev { margin-left: auto; }
.ask form { padding: 0 12px; }

/* state page: selected-station bar on top of the map */
.sel-bar { border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; gap: 10px 16px; }
.sel-bar.empty { background: #F1F5F9; color: #334155; border: 1.5px dashed #94A3B8; }
.sel-bar .sb-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sel-bar .sb-k { font-size: 12px; font-family: var(--mono); color: var(--on-dark-muted); }
.sel-bar .sb-t { font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-bar .sb-d { font-size: 13px; color: #C9D3D0; }
.sel-bar .sb-go { white-space: nowrap; }
.sel-bar .sb-go[aria-disabled=true] { opacity: .5; pointer-events: none; }

/* Lista desplegable abierta: el campo resalta y lo demás del panel se atenúa */
select option { background: #fff; color: #12201D; }
select option:checked { background: #DCE3F0; color: #12201D; font-weight: 600; }
select option:disabled { color: #9AA5B1; }
select.is-open { border: 2px solid var(--m-accent, var(--primary)); background-color: var(--m-softer, #F2F5FA); box-shadow: 0 0 0 4px rgba(52,79,131,.18), 0 10px 24px rgba(18,32,29,.22); position: relative; z-index: 5; }
.has-open > *:not(.is-open):not(:has(.is-open)) { opacity: .3; transition: opacity .12s; }
.has-open .is-open > span, .has-open label.is-open { color: var(--m-ink, var(--ink)); font-weight: 700; }

.about-lema, .pt-lema { margin: 2px 0 6px; font-weight: 600; font-style: italic; color: var(--primary, #0E6B66); letter-spacing: .01em; }
.about-name { max-width: 70ch; font-size: 14px; line-height: 1.55; color: #33433F; }

/* Modo servidor (demostración en línea) */
.conn.demo { background: #EAF2F1; color: #0E4F4B; border-color: #B9D3D0; }
.conn.demo::before { background: #0E6B66; }
