/* FireSync Córdoba — interfaz 0.2
   Criterio: superficie neutra y legible; el color se reserva para los datos de fuego. Un solo acento de interacción
   (tinta) y un azul sobrio para selección/foco. Tipografía IBM Plex (local). */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(../vendor/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(../vendor/fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url(../vendor/fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url(../vendor/fonts/ibm-plex-sans-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(../vendor/fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(../vendor/fonts/ibm-plex-sans-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(../vendor/fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(../vendor/fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); }

:root {
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --bg: #f3f2ef;
  --surface: #ffffff;
  --surface-2: #f7f6f3;
  --surface-3: #efede8;
  --ink: #17191c;
  --ink-2: #464b53;
  --ink-3: #6f757e;
  --ink-4: #a2a7ad;
  --rule: #e7e5e0;
  --rule-2: #d4d1ca;
  --fire: #c4361a;
  --fire-2: #e5702a;
  --fire-3: #f0ad4a;
  --fire-wash: #fbefe9;
  --sel: #1f4e8c;
  --sel-wash: #e9eff7;
  --ok: #2d6a44;
  --warn: #8a5a00;
  --warn-wash: #fbf3e2;
  --radius: 6px;
  --top-h: 52px;
  --panel-w: 404px;
  --shadow-1: 0 1px 2px rgba(23, 25, 28, .06), 0 2px 8px rgba(23, 25, 28, .06);
  --shadow-2: 0 2px 4px rgba(23, 25, 28, .06), 0 10px 28px rgba(23, 25, 28, .12);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 400 14px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: 'kern' 1; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sel); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ estructura */
.app { position: fixed; inset: 0; display: grid; grid-template-rows: var(--top-h) 1fr; grid-template-columns: var(--panel-w) 1fr; grid-template-areas: 'top top' 'panel map'; }
.top { grid-area: top; display: flex; align-items: center; gap: 28px; padding: 0 16px 0 20px; background: var(--surface); border-bottom: 1px solid var(--rule); z-index: 5; }
.panel { grid-area: panel; background: var(--surface); border-right: 1px solid var(--rule); overflow-y: auto; overflow-x: hidden; z-index: 4; scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
.stage { grid-area: map; position: relative; overflow: hidden; background: #eceae5; }
#map, #map-b { position: absolute; inset: 0; }
#map-b { z-index: 1; }

/* ------------------------------------------------------------------ barra superior */
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand img { display: block; height: 24px; width: auto; flex: none; }
.brand .logo-mark { display: none; }
.brand span { color: var(--ink-3); font-weight: 400; padding-left: 8px; border-left: 1px solid var(--rule-2); line-height: 18px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 2px; height: 100%; }
.nav a { position: relative; display: flex; align-items: center; padding: 0 12px; color: var(--ink-3); font-weight: 500; text-decoration: none; transition: color .15s; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current='page'] { color: var(--ink); }
.nav a[aria-current='page']::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--ink); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search { position: relative; width: 260px; }
.search input { width: 100%; height: 32px; padding: 0 10px 0 32px; border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--surface-2); outline: none; transition: border-color .15s, background .15s; }
.search input::placeholder { color: var(--ink-4); }
.search input:focus { background: var(--surface); border-color: var(--ink-3); }
.search > svg { position: absolute; left: 10px; top: 9px; width: 14px; height: 14px; stroke: var(--ink-3); fill: none; stroke-width: 2; }
.results { position: absolute; top: 38px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--rule-2); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 4px; max-height: 360px; overflow-y: auto; z-index: 20; }
.results button { display: flex; width: 100%; justify-content: space-between; gap: 12px; padding: 7px 10px; border: 0; background: none; border-radius: 4px; text-align: left; }
.results button:hover, .results button.on { background: var(--surface-2); }
.results small { color: var(--ink-3); white-space: nowrap; }
.results .none { padding: 8px 10px; color: var(--ink-3); }
.linkbtn { border: 0; background: none; padding: 6px 8px; color: var(--ink-3); font-weight: 500; border-radius: 4px; text-decoration: none; }
.linkbtn:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.linkbtn[aria-current='page'] { color: var(--ink); }
.linkbtn.about .i { display: none; width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* ------------------------------------------------------------------ panel */
.view { animation: fadein .18s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.ph { padding: 22px 24px 16px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow .live { display: inline-flex; align-items: center; gap: 6px; color: var(--fire); }
.eyebrow .live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--fire); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.ph h1 { margin: 6px 0 0; font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.012em; }
.ph .sub { margin: 6px 0 0; color: var(--ink-2); }
.back { display: inline-flex; align-items: center; gap: 4px; margin: -4px 0 10px -6px; padding: 4px 6px; border: 0; background: none; color: var(--ink-3); font-weight: 500; border-radius: 4px; }
.back:hover { color: var(--ink); background: var(--surface-2); }
.back svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

.blk { padding: 18px 24px; border-top: 1px solid var(--rule); }
.blk > h2, .h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--ink); display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.h2 small, .blk > h2 small { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.blk.flush { padding-left: 0; padding-right: 0; }
.blk.flush > h2 { padding: 0 24px; }
.lead { font-size: 15px; line-height: 1.5; color: var(--ink); margin: 0; }
.lead b { font-weight: 600; }
.lead .fire { color: var(--fire); }
p { margin: 0 0 10px; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.note { font-size: 12.5px; line-height: 1.5; color: var(--ink-3); margin: 10px 0 0; }
.note b { color: var(--ink-2); font-weight: 500; }
.src { margin-top: 10px; font-size: 11.5px; color: var(--ink-3); line-height: 1.45; }
.src::before { content: 'Fuente · '; color: var(--ink-4); }

/* control segmentado */
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-3); border-radius: 7px; }
.seg button { height: 28px; padding: 0 11px; border: 0; border-radius: 5px; background: none; color: var(--ink-2); font-weight: 500; font-size: 13px; white-space: nowrap; transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04); }
.seg.wrap { flex-wrap: wrap; }
.ctl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* cifras */
.figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 18px; border-top: 1px solid var(--rule); }
.figs.two { grid-template-columns: repeat(2, 1fr); }
.fig { padding: 12px 0 0; }
.fig + .fig { padding-left: 14px; border-left: 1px solid var(--rule); }
.fig .v { font-size: 28px; line-height: 1.1; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fig .v small { font-size: 14px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; margin-left: 2px; }
.fig .k { margin-top: 4px; font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.fig.fire .v { color: var(--fire); }

/* listas */
.list { list-style: none; margin: 0; padding: 0; }
.item { position: relative; display: block; width: 100%; padding: 13px 24px 13px 24px; border: 0; border-top: 1px solid var(--rule); background: none; text-align: left; transition: background .12s; }
.item:first-child { border-top: 0; }
.item:hover { background: var(--surface-2); }
.item.on { background: var(--sel-wash); }
.item.on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--sel); }
.item .r1 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.item .t { font-weight: 500; color: var(--ink); }
.item .when { flex: none; color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.item .when.fresh { color: var(--fire); font-weight: 500; }
.item .r2 { margin-top: 3px; color: var(--ink-3); font-size: 12.5px; }
.item .chev { position: absolute; right: 10px; top: 50%; width: 14px; height: 14px; margin-top: -7px; stroke: var(--ink-4); fill: none; stroke-width: 2; opacity: 0; transition: opacity .12s, transform .12s; }
.item:hover .chev { opacity: 1; transform: translateX(2px); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fire); vertical-align: 1px; margin-right: 8px; }
.dot.old { background: var(--fire-3); }
.dot.out { background: var(--ink-4); }
.empty { padding: 4px 0 0; }
.empty .t { font-weight: 500; }
.empty p { color: var(--ink-3); margin: 4px 0 0; }

/* tabla compacta */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; padding: 0 0 6px; border-bottom: 1px solid var(--rule); }
.tbl td { padding: 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td + td, .tbl th + th { padding-left: 10px; }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .sub { display: block; color: var(--ink-3); font-size: 12px; }
.tbl tr.dim td { color: var(--ink-4); }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--fire-2); border-radius: 3px; }

/* desplegables */
details.more { border-top: 1px solid var(--rule); }
details.more > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 24px; cursor: pointer; font-weight: 500; color: var(--ink-2); user-select: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary:hover { color: var(--ink); background: var(--surface-2); }
details.more > summary small { font-weight: 400; color: var(--ink-3); margin-left: auto; }
details.more > summary svg { width: 14px; height: 14px; stroke: var(--ink-3); fill: none; stroke-width: 2; transition: transform .2s var(--ease); flex: none; }
details.more[open] > summary svg { transform: rotate(180deg); }
details.more > .in { padding: 0 24px 18px; }
details.more > .in.flush { padding: 0 0 8px; }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 13px; transition: background .12s, border-color .12s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: var(--ink-4); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2c3036; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border: 1px solid var(--rule-2); border-radius: 12px; font-size: 12px; color: var(--ink-2); background: var(--surface); }
input[type='date'] { height: 32px; padding: 0 8px; border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--surface); }

/* avisos */
.callout { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2); font-size: 13px; line-height: 1.45; border-left: 3px solid var(--rule-2); }
.callout.warn { background: var(--warn-wash); border-left-color: #d9a441; color: #5b4313; }
.callout + .callout { margin-top: 8px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; padding: 6px 0; }
.loading::before { content: ''; width: 14px; height: 14px; border: 2px solid var(--rule-2); border-top-color: var(--ink-2); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { height: 12px; border-radius: 3px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* satélites */
.sats { width: 100%; border-collapse: collapse; font-size: 13px; }
.sats td { padding: 8px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.sats tr:first-child td { border-top: 0; }
.sats td + td { padding-left: 10px; }
.sats .nm { font-weight: 500; }
.sats .rs { display: block; color: var(--ink-3); font-size: 12px; font-weight: 400; }
.sats .nx { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sats .nx small { display: block; color: var(--ink-3); font-size: 12px; }
.sats tr.off td { color: var(--ink-4); }
.sats tr.off .rs { color: var(--ink-4); }
.glyph { display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border-radius: 50%; }
.glyph.viirs { background: var(--fire); width: 8px; height: 8px; margin: 0 10px 0 2px; vertical-align: 1px; }
.glyph.modis { background: var(--fire); border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--fire); width: 10px; height: 10px; margin: 0 9px 0 1px; }
.glyph.goes { border: 1.5px solid var(--fire); background: rgba(196, 54, 26, .14); }

/* gráficos */
.chart { width: 100%; height: 180px; }
.chart.tall { height: 230px; }
.chart.short { height: 130px; }
.strip { width: 100%; }

/* meteorología */
.wx { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.wx > div { padding: 2px 0; }
.wx > div + div { padding-left: 12px; border-left: 1px solid var(--rule); }
.wx .v { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.2; }
.wx .k { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.wx .arrow { display: inline-block; width: 13px; height: 13px; vertical-align: -1px; margin-right: 3px; }

/* definición */
.dl { display: grid; grid-template-columns: 128px 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; color: var(--ink); }

/* texto largo (Acerca) */
.prose { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.prose h3 { font-size: 14px; color: var(--ink); margin: 18px 0 6px; font-weight: 600; }
.prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 10px; }
.prose ul { margin: 0 0 10px; padding-left: 18px; }
.prose li { margin: 3px 0; }
.prose b { color: var(--ink); font-weight: 500; }

/* ------------------------------------------------------------------ mapa */
.mapctl { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.mapctl .grp { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule-2); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.mapctl button { width: 34px; height: 34px; border: 0; background: none; display: grid; place-items: center; color: var(--ink-2); }
.mapctl button + button { border-top: 1px solid var(--rule); }
.mapctl button:hover { background: var(--surface-2); color: var(--ink); }
.mapctl button[aria-pressed='true'] { color: var(--sel); background: var(--sel-wash); }
.mapctl svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.basepop { position: absolute; top: 12px; right: 56px; z-index: 4; width: 220px; background: var(--surface); border: 1px solid var(--rule-2); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 12px; }
.basepop h4 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.basepop h4 + .seg { margin-bottom: 12px; }
.basepop label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.basepop input { accent-color: var(--ink); }

.legend { position: absolute; left: 12px; bottom: 28px; z-index: 3; background: rgba(255, 255, 255, .96); border: 1px solid var(--rule-2); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 10px 12px; font-size: 12px; color: var(--ink-2); max-width: 250px; }
.legend h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.legend h4:not(:first-child) { margin-top: 10px; }
.legend .row { display: flex; align-items: center; gap: 2px; padding: 2px 0; }
.legend .row.kind { cursor: pointer; gap: 0; }
.legend .row.kind input { margin: 0 8px 0 0; accent-color: var(--ink); width: 13px; height: 13px; }
.legend .row.kind:has(input:not(:checked)) { color: var(--ink-4); }
.legend .ramp { height: 8px; border-radius: 2px; margin: 4px 0 3px; }
.legend .rl { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.legend .sw { width: 14px; height: 10px; border-radius: 2px; margin-right: 8px; flex: none; }
.legend .ln { width: 16px; height: 0; border-top: 2px solid var(--ink); margin-right: 8px; flex: none; }
.legend-toggle { display: none; }

.maplabel { position: absolute; z-index: 3; top: 12px; left: 12px; background: rgba(255, 255, 255, .96); border: 1px solid var(--rule-2); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 6px 10px; font-size: 12.5px; color: var(--ink-2); max-width: calc(100% - 80px); }
.maplabel b { color: var(--ink); font-weight: 600; }

/* comparación antes/después */
.swipe { position: absolute; top: 0; bottom: 0; width: 0; z-index: 2; left: 50%; }
.swipe::before { content: ''; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.swipe .handle { position: absolute; top: 50%; left: -18px; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-2); display: grid; place-items: center; cursor: ew-resize; touch-action: none; }
.swipe .handle svg { width: 18px; height: 18px; stroke: var(--ink-2); fill: none; stroke-width: 2; }
.ctag { position: absolute; top: 12px; z-index: 3; padding: 4px 8px; border-radius: 4px; background: rgba(23, 25, 28, .82); color: #fff; font-size: 12px; font-weight: 500; pointer-events: none; }
.ctag.a { left: 12px; }
.ctag.b { right: 58px; }

/* ventana emergente de MapLibre */
.maplibregl-popup.tip .maplibregl-popup-content { padding: 8px 10px; border-radius: var(--radius); box-shadow: var(--shadow-2); border: 1px solid var(--rule-2); font: 12.5px/1.4 var(--font); color: var(--ink); }
.maplibregl-popup.tip .maplibregl-popup-tip { display: none; }
.tip b { font-weight: 600; }
.tip .m { color: var(--ink-3); }
.maplibregl-ctrl-attrib { font-size: 10.5px; }
.maplibregl-ctrl-scale { border-color: var(--ink-3); color: var(--ink-2); background: rgba(255, 255, 255, .8); font: 10.5px var(--font); }

/* aviso global */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 14px; border-radius: var(--radius); font-size: 13px; z-index: 50; box-shadow: var(--shadow-2); max-width: min(560px, calc(100% - 32px)); }

/* carga inicial */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; transition: opacity .3s; }
.boot.done { opacity: 0; pointer-events: none; }
.boot div { display: flex; align-items: center; gap: 10px; color: var(--ink-3); }

/* ------------------------------------------------------------------ recorrido guiado */
.tourbtn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px 0 11px; border: 0; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 500; font-size: 13px; transition: background .15s; }
.tourbtn:hover { background: #2c3036; }
.tourbtn svg { width: 12px; height: 12px; fill: #ff8a3d; }
.tour { position: absolute; z-index: 8; left: 50%; bottom: 28px; transform: translateX(-50%); width: min(600px, calc(100% - 32px)); background: rgba(255, 255, 255, .97); border: 1px solid var(--rule-2); border-radius: 10px; box-shadow: 0 12px 40px rgba(23, 25, 28, .22); padding: 18px 22px 14px; overflow: hidden; animation: tourin .35s var(--ease); }
@keyframes tourin { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.tour-bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--surface-3); }
.tour-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff8a3d, var(--fire)); transform-origin: left; animation-name: tourbar; animation-timing-function: linear; animation-fill-mode: both; }
.tour.busy .tour-bar i { animation-play-state: paused !important; transform: scaleX(0); }
@keyframes tourbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.tour-k { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fire); }
.tour-k span { color: var(--ink-4); font-weight: 500; letter-spacing: .02em; }
.tour h2 { margin: 6px 0 6px; font-size: 22px; line-height: 1.22; font-weight: 600; letter-spacing: -.012em; }
.tour p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.tour-c { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.tour-c button { height: 32px; min-width: 32px; padding: 0 10px; border: 1px solid var(--rule-2); border-radius: 16px; background: var(--surface); font-size: 15px; line-height: 1; color: var(--ink); }
.tour-c button:hover:not(:disabled) { background: var(--surface-2); }
.tour-c button:disabled { opacity: .35; }
.tour-c .tour-x { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.tour-dots { display: flex; gap: 5px; margin-left: 8px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--rule-2); }
.tour-dots i.on { background: var(--fire); }
body.touring .legend { opacity: .35; }

/* ------------------------------------------------------------------ informe imprimible (ficha de localidad) */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { overflow: visible; background: #fff; }
  .app { position: static; display: block; }
  .top, .mapctl, .legend, .basepop, .tour, .no-print, details.more, .toast, .maplabel { display: none !important; }
  .stage { position: relative; height: 95mm; border: 1px solid var(--rule); break-inside: avoid; }
  .panel { border: 0; overflow: visible; }
  .ph, .blk { padding-left: 0; padding-right: 0; }
  .blk { break-inside: avoid; }
  .print-only { display: block; }
}

/* ------------------------------------------------------------------ pantallas medianas y teléfonos */
@media (max-width: 1100px) {
  :root { --panel-w: 360px; }
  .search { width: 200px; }
  .top { gap: 16px; }
}
@media (max-width: 820px) {
  :root { --top-h: 50px; }
  body { overflow: auto; }
  .app { position: static; display: flex; flex-direction: column; min-height: 100vh; }
  .top { position: sticky; top: 0; gap: 4px; padding: 0 6px 0 12px; }
  .brand span { display: none; }
  body { padding-bottom: 56px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; height: 56px; z-index: 40; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--rule); box-shadow: 0 -4px 14px rgba(0, 0, 0, .06); padding-bottom: env(safe-area-inset-bottom); gap: 0; }
  .nav a { flex: 1; justify-content: center; padding: 0 2px; font-size: 13px; }
  .nav a[aria-current='page'] { color: var(--fire); }
  .nav a[aria-current='page']::after { left: 22%; right: 22%; top: -1px; bottom: auto; height: 3px; background: var(--fire); border-radius: 0 0 2px 2px; }
  .top-r { gap: 0; }
  .search { position: relative; width: 34px; height: 34px; }
  .search input { width: 34px; height: 34px; padding: 0; border-color: transparent; background: transparent; color: transparent; cursor: pointer; }
  .search input::placeholder { color: transparent; }
  .search > svg { left: 10px; top: 10px; pointer-events: none; }
  .search.open { position: absolute; left: 8px; right: 8px; top: 8px; width: auto; z-index: 30; }
  .search.open input { width: 100%; padding: 0 10px 0 32px; color: var(--ink); background: var(--surface); border-color: var(--ink-3); cursor: text; }
  .search.open input::placeholder { color: var(--ink-4); }
  .tourbtn { width: 32px; padding: 0; justify-content: center; }
  .tourbtn span { display: none; }
  .tour { bottom: 10px; padding: 14px 16px 12px; }
  .tour h2 { font-size: 18px; }
  .tour p { font-size: 13.5px; }
  .tour-dots { display: none; }
  .tour-c .tour-x { font-size: 12px; padding: 0 8px; }
  .top-r { margin-left: auto; }
  .linkbtn.about { padding: 6px; }
  .linkbtn.about .t { display: none; }
  .linkbtn.about .i { display: block; }
  .stage { order: 1; position: sticky; top: var(--top-h); height: 46vh; height: 46svh; flex: none; z-index: 1; border-bottom: 1px solid var(--rule); }
  .panel { order: 2; flex: 1; position: relative; z-index: 2; border-right: 0; overflow: visible; min-height: 54vh; box-shadow: 0 -6px 16px rgba(0, 0, 0, .06); }
  .ph { padding: 18px 16px 14px; }
  .blk { padding: 16px; }
  .blk.flush > h2 { padding: 0 16px; }
  .item { padding: 12px 16px; }
  details.more > summary { padding: 14px 16px; }
  details.more > .in { padding: 0 16px 16px; }
  .ph h1 { font-size: 20px; }
  .fig .v { font-size: 24px; }
  .legend { top: 8px; bottom: auto; left: 8px; padding: 6px 8px; max-width: 220px; }
  .maplabel { top: auto; bottom: 40px; }
  .legend .body { display: none; }
  .legend.open .body { display: block; margin-top: 6px; }
  .legend-toggle { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font-size: 12px; font-weight: 500; color: var(--ink-2); }
  .mapctl { top: 8px; right: 8px; }
  .basepop { right: 50px; top: 8px; }
  .maplabel { top: 8px; left: 8px; font-size: 12px; }
  .ctag.b { right: 50px; }
  .wx { grid-template-columns: repeat(2, 1fr); row-gap: 10px; }
  .wx > div:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
