/* cauce. · dónde invertir — editorial priority atlas */
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/instrument-serif.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/instrument-serif-italic.woff2) format('woff2'); }
@font-face { font-family: 'Libre Franklin'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/libre-franklin-var.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/plexmono-400.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/plexmono-500.woff2) format('woff2'); }

:root {
  --paper: #f4f0e8;
  --paper-2: #ebe5d8;
  --paper-3: #e2dbcc;
  --ink: #17162a;
  --ink-2: #3e3b52;
  --muted: #7a7366;
  --rule: #d6cdbb;
  --water: #2196c4;
  --water-2: #98cfdc;
  --vuln: #d63f66;
  --vuln-2: #eba5b4;
  --both: #1f2a5e;
  --expo: #a7823a;
  --expo-2: #dcc9a0;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Libre Franklin', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --mast: 56px;
  --foot: 30px;
  --lw: 392px;
  --rw: 376px;
  --step: 70px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
#app { position: fixed; inset: 0; }
/* the map lives only in the visible stage between the panels (no MapLibre padding: padding + pitch dropped far tiles) */
#map, #labels, #horizon, #mapui { position: absolute; top: var(--mast); left: var(--lw); right: var(--rw); bottom: var(--foot); }
#map { background: var(--paper); }
#labels { pointer-events: none; overflow: hidden; z-index: 2; }
#horizon { bottom: auto; height: 240px; pointer-events: none; z-index: 1; background: linear-gradient(180deg, rgba(244,240,232,1) 0%, rgba(244,240,232,.9) 25%, rgba(244,240,232,.5) 60%, rgba(244,240,232,0) 100%); }

/* ---------- masthead */
#mast { position: absolute; top: 0; left: 0; right: 0; height: var(--mast); display: flex; align-items: center; gap: 20px; padding: 0 18px 0 20px; background: var(--paper); border-bottom: 1px solid var(--ink); z-index: 5; }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; color: var(--ink); flex: none; }
.mark { font-family: var(--serif); font-size: 34px; line-height: 1; letter-spacing: -0.01em; }
.mark i { font-style: normal; color: var(--water); }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); border-left: 1px solid var(--rule); padding-left: 12px; }
#munis { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
#munis::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--rule); background: transparent; border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--ink-2); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip small { font-family: var(--mono); font-size: 10.5px; opacity: .65; margin-left: 4px; }
.ghost { flex: none; background: none; border: 1px solid var(--ink); border-radius: 2px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; }
.ghost:hover { background: var(--ink); color: var(--paper); }
.link { background: none; border: none; padding: 0; font-size: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- side panels */
.panel { position: absolute; top: var(--mast); bottom: var(--foot); background: var(--paper); z-index: 4; overflow: hidden; display: flex; flex-direction: column; }
#left { left: 0; width: var(--lw); border-right: 1px solid var(--rule); }
#right { right: 0; width: var(--rw); border-left: 1px solid var(--rule); }
.intro { padding: 22px 24px 14px; border-bottom: 1px solid var(--rule); flex: none; }
.eyebrow { margin: 0 0 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
h1 { font-family: var(--serif); font-weight: 400; font-size: 41px; line-height: 0.98; letter-spacing: -0.015em; margin: 0 0 12px; }
h1 em { font-style: italic; }
em.w, b.w { color: var(--water); }
em.v, b.v { color: var(--vuln); }
.dek { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.list-head { padding: 14px 24px 10px; flex: none; border-bottom: 1px solid var(--ink); }
h2 { font-family: var(--serif); font-weight: 400; font-size: 25px; margin: 0; line-height: 1.05; }
.sub { margin: 3px 0 7px; font-size: 12px; color: var(--muted); }
.sub #list-count { font-family: var(--mono); color: var(--ink-2); }
.list-legend { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.list-legend .sw { display: inline-block; width: 8px; height: 8px; margin-left: 4px; }
.sw.w { background: var(--water); } .sw.e { background: var(--expo); } .sw.v { background: var(--vuln); }
.list-legend .sw:first-child { margin-left: 0; }

/* ---------- ranking list */
.rank { list-style: none; margin: 0; padding: 0; position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.rank .inner { position: relative; }
.card-r { position: absolute; left: 0; right: 0; height: var(--step); display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 0 10px; padding: 0 16px 0 14px; border-bottom: 1px solid var(--rule); cursor: pointer; background: var(--paper); will-change: transform; }
.card-r:hover { background: var(--paper-2); }
.card-r.sel { background: var(--ink); color: var(--paper); }
.card-r.sel .meta, .card-r.sel .score small { color: #b9b5c9; }
.card-r.pulse { box-shadow: inset 4px 0 0 var(--vuln); background: #fbe9ee; }
.card-r .num { font-family: var(--serif); font-size: 38px; line-height: 1; text-align: right; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.card-r .body { min-width: 0; }
.card-r .name { font-size: 14.5px; font-weight: 650; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-r .name small.ag { font-family: var(--mono); font-size: 10px; font-weight: 400; color: var(--muted); }
.card-r.sel .name small.ag { color: #b9b5c9; }
.card-r .meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-r .meta b { font-weight: 600; color: inherit; }
.card-r .right { display: flex; align-items: center; gap: 10px; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.spark i { display: block; width: 4px; background: currentColor; min-height: 1px; }
.spark i.P { color: var(--water); } .spark i.E { color: var(--expo); } .spark i.V { color: var(--vuln); }
.spark i.M { background: repeating-linear-gradient(135deg, var(--water) 0 2px, transparent 2px 3.4px); }
.spark i.na { background: none; border-bottom: 1px dashed var(--muted); height: 0 !important; }
.spark .gap { width: 4px; }
.card-r.sel .spark i.P { color: #6fc3e6; } .card-r.sel .spark i.V { color: #f07f9b; } .card-r.sel .spark i.E { color: #d9b46c; }
.score { text-align: right; font-family: var(--mono); font-size: 15px; font-weight: 500; line-height: 1; min-width: 36px; }
.score small { display: block; font-size: 9.5px; color: var(--muted); margin-top: 3px; letter-spacing: .04em; }
.delta { font-family: var(--mono); font-size: 10px; font-weight: 500; }
.delta.up { color: #1e8a5a; } .delta.dn { color: var(--vuln); }
.card-r .swatch { width: 10px; height: 10px; display: inline-block; vertical-align: -1px; margin-right: 5px; border: 1px solid rgba(0,0,0,.15); }

/* ---------- tabs */
.tabs { display: flex; border-bottom: 1px solid var(--ink); flex: none; }
.tabs button { flex: 1; background: none; border: none; padding: 15px 8px 12px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabpane { display: none; flex: 1; overflow-y: auto; padding: 18px 22px 24px; scrollbar-width: thin; }
.tabpane.on { display: block; }

/* ---------- why panel */
.why-top { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: end; }
.bigrank { font-family: var(--serif); font-size: 84px; line-height: .78; letter-spacing: -0.03em; }
.bigrank sup { font-size: 30px; vertical-align: top; margin-right: 2px; position: relative; top: 4px; }
.why-top .of { font-size: 11px; color: var(--muted); line-height: 1.35; }
.why-top .of b { font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--ink); display: block; letter-spacing: -0.02em; }
.why-name { font-family: var(--serif); font-size: 31px; line-height: 1; margin: 14px 0 4px; letter-spacing: -0.01em; }
.why-sub { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.why-sub code { font-family: var(--mono); font-size: 11px; }
.lede { font-size: 13.5px; line-height: 1.5; margin: 0 0 14px; color: var(--ink-2); }
.lede b { color: var(--ink); font-weight: 650; }
.lede .tag { margin-right: 4px; }
.formula-mini { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); background: var(--paper-2); padding: 8px 10px; margin: 0 0 16px; border-left: 3px solid var(--ink); line-height: 1.6; }
.formula-mini b { color: var(--ink); font-weight: 500; }
.grp { margin: 0 0 16px; }
.grp-h { display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--ink); padding-top: 6px; margin-bottom: 6px; }
.grp-h h3 { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.grp-h .val { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.grp-h .val b { font-size: 16px; color: var(--ink); font-weight: 500; }
.stack { height: 10px; background: var(--paper-3); display: flex; margin-bottom: 8px; }
.stack i { display: block; height: 100%; border-right: 1px solid var(--paper); }
.frow { display: grid; grid-template-columns: 1fr 92px; gap: 2px 10px; align-items: center; padding: 4px 0; border-bottom: 1px dotted var(--rule); }
.frow .fl { font-size: 12.5px; line-height: 1.2; }
.frow .fl small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.frow .fv { font-family: var(--mono); font-size: 11.5px; text-align: right; color: var(--ink-2); }
.strip { grid-column: 1 / -1; position: relative; height: 12px; }
.strip::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 1px; background: var(--rule); }
.strip .med { position: absolute; top: 2px; width: 1px; height: 9px; background: var(--muted); left: 50%; opacity: .5; }
.strip .dot { position: absolute; top: 2px; width: 9px; height: 9px; border-radius: 50%; margin-left: -4.5px; }
.strip .pct { position: absolute; top: -1px; font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.frow.off { opacity: .45; }
.frow.na .fv { color: var(--muted); }
.tag { display: inline-block; font-size: 8.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 2px 5px 1px; border-radius: 2px; vertical-align: 1px; white-space: nowrap; }
.tag.observado { background: var(--water); color: #fff; }
.tag.modelado { color: var(--both); border: 1px dashed var(--both); background: repeating-linear-gradient(135deg, rgba(33,150,196,.22) 0 3px, transparent 3px 6px); }
.tag.reportado { border: 1px solid var(--water); color: var(--water); }
.tag.censo, .tag.registro, .tag.satélite { background: var(--paper-3); color: var(--ink-2); }
.tag.mapeado { border: 1px solid var(--muted); color: var(--muted); }
.records { margin: 6px 0 16px; padding: 0; list-style: none; }
.records li { font-size: 12px; line-height: 1.4; padding: 6px 0 6px 10px; border-left: 2px solid var(--water); margin-bottom: 6px; background: linear-gradient(90deg, rgba(33,150,196,.07), transparent); }
.records li.model { border-left: 2px dashed var(--both); background: linear-gradient(90deg, rgba(31,42,94,.06), transparent); }
.records code { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.note { font-size: 11px; line-height: 1.45; color: var(--muted); margin: 10px 0 0; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 0 0 14px; }
.kpis div { padding: 8px 6px 7px 0; }
.kpis div + div { border-left: 1px solid var(--rule); padding-left: 10px; }
.kpis b { display: block; font-family: var(--serif); font-size: 27px; font-weight: 400; line-height: 1; letter-spacing: -0.01em; }
.kpis span { font-size: 10.5px; color: var(--muted); line-height: 1.2; display: block; margin-top: 3px; }
h4 { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin: 18px 0 6px; }

/* ---------- weights panel */
.presets { display: flex; gap: 6px; margin: 0 0 10px; flex-wrap: wrap; }
.presets button { border: 1px solid var(--ink); background: none; padding: 6px 10px; font-size: 12px; font-weight: 600; border-radius: 2px; }
.presets button.on { background: var(--ink); color: var(--paper); }
.formula { font-family: var(--mono); font-size: 11.5px; line-height: 1.65; background: var(--ink); color: var(--paper); padding: 10px 12px; margin: 0 0 6px; }
.formula .P { color: #7cc9ea; } .formula .E { color: #e0bd77; } .formula .V { color: #f392ab; }
.formula sup { font-size: 10px; }
.formula-note { font-size: 10.5px; color: var(--muted); line-height: 1.4; margin: 0 0 8px; }
.wgrp { border-top: 1px solid var(--ink); padding: 6px 0 2px; margin-bottom: 6px; }
.wgrp-h { display: grid; grid-template-columns: 1fr 110px 34px; align-items: center; gap: 8px; }
.wgrp-h h3 { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.wgrp-h h3 small { display: block; font-size: 10.5px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); margin-top: 2px; }
.wrow { display: grid; grid-template-columns: 1fr 110px 34px; align-items: center; gap: 8px; padding: 2px 0; }
.wrow .wl { font-size: 12px; line-height: 1.2; min-width: 0; }
.wrow .wl small { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrow .wl .tag { font-size: 7.5px; padding: 1px 4px 0; }
.wrow.na .wl { color: var(--muted); }
.wv { font-family: var(--mono); font-size: 11.5px; text-align: right; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, var(--c, var(--ink)) var(--f, 50%), var(--rule) var(--f, 50%)); }
input[type=range]::-moz-range-track { height: 3px; background: linear-gradient(90deg, var(--c, var(--ink)) var(--f, 50%), var(--rule) var(--f, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--c, var(--ink)); margin-top: -5.5px; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--c, var(--ink)); }
input[type=range]:disabled { opacity: .35; }
.wrow.demo-active, .wgrp-h.demo-active { background: #fff6c9; box-shadow: -8px 0 0 #fff6c9, 8px 0 0 #fff6c9; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 2px 0 8px; }
.toggle input { accent-color: var(--ink); }

/* ---------- map ui */
#mapui { pointer-events: none; z-index: 3; }
#mapui > * { pointer-events: auto; }
.card { background: rgba(244,240,232,.94); border: 1px solid var(--rule); box-shadow: 0 1px 0 rgba(0,0,0,.03); }
#legend { position: absolute; left: 16px; bottom: 16px; padding: 12px 14px 12px; width: 268px; }
#legend h5 { margin: 0 0 8px; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.biv { display: grid; grid-template-columns: 104px 1fr; gap: 10px; align-items: center; }
.biv svg { display: block; overflow: visible; }
.biv .keys { font-size: 11px; line-height: 1.35; color: var(--ink-2); }
.biv .keys p { margin: 0 0 6px; }
.biv .keys i { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; margin-right: 5px; }
.hleg { display: flex; align-items: flex-end; gap: 10px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--rule); font-size: 11px; color: var(--ink-2); line-height: 1.3; }
.hleg .bars { display: flex; align-items: flex-end; gap: 3px; flex: none; }
.hleg .bars i { width: 7px; background: var(--both); display: block; }
#heightmode { position: absolute; top: 14px; left: 16px; display: flex; padding: 3px; gap: 2px; align-items: center; }
#heightmode .lab { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 0 8px 0 6px; color: var(--muted); }
#heightmode button { border: none; background: none; padding: 5px 9px; font-size: 12px; font-weight: 550; border-radius: 1px; color: var(--ink-2); }
#heightmode button.on { background: var(--ink); color: var(--paper); }
#heightmode button.model { font-style: italic; }
#datastatus { position: absolute; top: 14px; right: 14px; padding: 8px 11px; font-size: 11px; line-height: 1.5; max-width: 270px; cursor: pointer; }
#datastatus b { font-size: 9.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; display: block; margin-bottom: 2px; }
#datastatus .row { display: flex; gap: 6px; align-items: baseline; }
#datastatus .ok { color: #1e8a5a; } #datastatus .no { color: var(--vuln); } #datastatus .wait { color: var(--expo); }
#caption { position: absolute; right: 16px; bottom: 16px; width: min(520px, calc(100% - 316px)); background: var(--ink); color: var(--paper); padding: 14px 18px 15px; opacity: 0; transition: none; pointer-events: none; }
#caption .ch { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #a9a4bd; }
#caption .t { font-family: var(--serif); font-size: 27px; line-height: 1.05; margin: 3px 0 4px; }
#caption .t em { color: #f392ab; }
#caption .d { font-size: 13px; line-height: 1.4; color: #dcd8e6; }
#tip { position: absolute; padding: 9px 11px; font-size: 12px; line-height: 1.35; pointer-events: none; max-width: 260px; z-index: 6; }
#tip b { font-weight: 650; }
#tip .r { font-family: var(--serif); font-size: 22px; float: right; margin-left: 10px; line-height: 1; }
#tip .m { color: var(--muted); font-size: 11px; }

/* map labels */
.rl { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; pointer-events: none; will-change: transform; }
.rl .b { font-family: var(--serif); font-size: 17px; line-height: 1; min-width: 24px; height: 24px; padding: 3px 5px 0; text-align: center; background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 12px; font-variant-numeric: tabular-nums; }
.rl .stem { width: 1px; height: 14px; background: var(--ink); }
.rl.top5 .b { background: var(--ink); color: var(--paper); font-size: 19px; height: 27px; min-width: 27px; border-radius: 14px; }
.rl .nm { position: absolute; left: calc(100% + 6px); top: 2px; white-space: nowrap; font-size: 11.5px; font-weight: 650; background: rgba(244,240,232,.92); padding: 2px 6px; border-left: 2px solid var(--ink); }
.rl.sel .b { background: var(--vuln); border-color: var(--vuln); color: #fff; }
.rl.pulse .b { transform: scale(1.35); background: var(--vuln); border-color: var(--vuln); color: #fff; }
.ml { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--ink-2); white-space: nowrap; text-shadow: 0 0 3px var(--paper), 0 0 8px var(--paper), 0 0 14px var(--paper); pointer-events: none; opacity: .85; }
.ml.small { font-size: 16px; }

/* ---------- footer */
#attrib { position: absolute; left: 0; right: 0; bottom: 0; height: var(--foot); background: var(--paper); border-top: 1px solid var(--ink); display: flex; align-items: center; gap: 16px; padding: 0 16px; font-size: 10.5px; color: var(--muted); z-index: 5; white-space: nowrap; overflow: hidden; }
#attrib .honest { color: var(--ink-2); font-weight: 500; }
#attrib .src { overflow: hidden; text-overflow: ellipsis; }
#attrib .src-short { display: none; }

/* ---------- method drawer */
.drawer { position: absolute; inset: 0; background: rgba(23,22,42,.35); z-index: 20; display: flex; justify-content: center; align-items: flex-start; padding: 70px 20px 40px; }
.drawer[hidden] { display: none; }
.drawer-inner { position: relative; background: var(--paper); width: min(860px, 100%); max-height: 100%; overflow-y: auto; padding: 34px 40px 40px; border-top: 6px solid var(--ink); }
.drawer .close { position: absolute; right: 14px; top: 10px; background: none; border: none; font-size: 30px; line-height: 1; }
#method-body h2 { font-size: 40px; margin-bottom: 8px; }
#method-body h3 { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin: 22px 0 8px; border-top: 1px solid var(--ink); padding-top: 8px; }
#method-body p, #method-body li { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
#method-body table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#method-body th { text-align: left; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); padding: 4px 6px; }
#method-body td { border-bottom: 1px solid var(--rule); padding: 6px; vertical-align: top; }
#method-body td.n { font-family: var(--mono); text-align: right; white-space: nowrap; }
#method-body .formula { font-size: 14px; }
#method-body a { color: var(--ink); }

/* ---------- boot */
#boot { position: absolute; inset: 0; background: var(--paper); z-index: 30; display: grid; place-items: center; transition: opacity .5s; }
#boot .mark { font-size: 64px; }
#boot p { font-size: 13px; color: var(--muted); text-align: center; margin: 6px 0 0; }
#app:not(.booting) #boot { opacity: 0; pointer-events: none; }
#sheet-handle, #phonetabs { display: none; }

/* ---------- maplibre */
.maplibregl-ctrl-bottom-left { display: none; }
.maplibregl-ctrl-bottom-right { bottom: 6px; right: 6px; }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib { display: none; }
.maplibregl-ctrl-group { background: var(--paper); border-radius: 2px; box-shadow: none; border: 1px solid var(--rule); }

/* ---------- demo mode */
.demo #tip, .demo .maplibregl-ctrl-bottom-right { display: none !important; }
.demo #caption { transition: none; }
.demo .rank { overflow: hidden; }

/* ---------- phone */
@media (max-width: 760px) {
  :root { --mast: 46px; --foot: 0px; --step: 62px; --sheet: 46vh; }
  .demo { --sheet: 41vh; }
  .demo .intro { display: none; }
  #mast { gap: 10px; padding: 0 10px 0 12px; }
  .mark { font-size: 27px; }
  .kicker { font-size: 9.5px; letter-spacing: .12em; padding-left: 8px; }
  #btn-method { display: none; }
  #munis { position: absolute; top: calc(var(--mast) + 6px); left: 8px; right: 8px; z-index: 5; }
  .chip { background: rgba(244,240,232,.95); font-size: 11.5px; padding: 4px 9px; }
  .panel { top: auto; bottom: 0; left: 0 !important; right: 0 !important; width: auto !important; height: calc(var(--sheet) - 38px); border: none; border-top: 1px solid var(--ink); display: none; }
  .panel.ph-on { display: flex; }
  #phonetabs { display: flex; position: absolute; left: 0; right: 0; bottom: calc(var(--sheet) - 38px); height: 38px; background: var(--paper); border-top: 1px solid var(--ink); z-index: 6; }
  #phonetabs button { flex: 1; border: none; background: none; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 3px solid transparent; }
  #phonetabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
  #right .tabs { display: none; }
  .intro { padding: 10px 14px 8px; }
  .intro .eyebrow, .intro .dek { display: none; }
  h1 { font-size: 25px; margin: 0; }
  .list-head { padding: 8px 14px 7px; }
  h2 { font-size: 19px; }
  .list-legend { display: none; }
  .sub { margin: 2px 0 0; }
  .card-r { grid-template-columns: 40px 1fr auto; padding: 0 12px 0 8px; }
  .card-r .num { font-size: 30px; }
  .card-r .name { font-size: 13.5px; }
  .spark { height: 20px; }
  .spark i { width: 3px; }
  .tabpane { padding: 12px 14px 20px; }
  .bigrank { font-size: 60px; }
  .why-name { font-size: 25px; margin-top: 8px; }
  #map, #labels, #horizon, #mapui { left: 0; right: 0; top: var(--mast); bottom: var(--sheet); }
  #horizon { bottom: auto; height: 130px; }
  #mapui { top: calc(var(--mast) + 40px); }
  .demo #heightmode { display: none; }
  .demo #caption { top: 4px; bottom: auto; }
  #legend { left: 8px; bottom: 8px; width: auto; padding: 7px 9px; }
  #legend h5, #legend .hleg, #legend .keys p { display: none; }
  #legend .keys p:first-child { display: block; margin: 0; }
  .biv { grid-template-columns: 54px 80px; gap: 5px; }
  .biv svg { width: 54px; height: 54px; }
  .biv .keys { font-size: 9.5px; line-height: 1.25; }
  #heightmode { top: 6px; left: 8px; transform-origin: left top; }
  #heightmode .lab { display: none; }
  #heightmode button { font-size: 11px; padding: 4px 7px; }
  #datastatus { display: none; }
  #caption { left: 8px; right: 8px; width: auto; bottom: 8px; padding: 8px 11px 9px; }
  #caption .t { font-size: 19px; }
  #caption .d { font-size: 11px; line-height: 1.35; }
  #caption .ch { font-size: 9.5px; }
  #attrib { display: block; position: absolute; top: auto; bottom: var(--sheet); right: 0; left: auto; height: auto; background: rgba(244,240,232,.88); border: none; padding: 2px 6px; font-size: 8.5px; z-index: 4; color: var(--ink-2); }
  #attrib .honest, #attrib .src { display: none; }
  #attrib .src-short { display: inline; }
  #legend { bottom: 18px; }
  .rl .nm { display: none; }
  .maplibregl-ctrl-bottom-right { display: none; }
  .ml { font-size: 15px; }
  .drawer { padding: 0; }
  .drawer-inner { padding: 24px 18px; }
}
