/* Mapa de precios por zona (copia pública del mapa de IMPERA en Claude). */
/* Lo oculto se oculta siempre, aunque su clase le dé display (la ficha .pop, sugerencias, avisos). */
[hidden] { display: none !important; }
/* Layout: full-height map app; map fills the left, a zone card rides on the right (bottom sheet on phones). Single IMPERA navy look. */
:root {
  --navy: #1F2231;
  --navy-2: #272B3D;
  --navy-3: #32374D;
  --line: #41475F;
  --copper: #EEA481;
  --ivory: #F4F3F1;
  --muted: #A9ACB8;
  --empty: #2A2E41;
  --ok: #8FC9A3;
  --bad: #E98A7C;
  --serif: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
html, body { height: 100%; }
body { background: var(--navy); color: var(--ivory); font-family: var(--sans); font-size: 14px; margin: 0; overflow: hidden; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--navy); }
.app { height: 100%; display: grid; grid-template-rows: auto 1fr; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-block: 14px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-bottom: 1px solid var(--line); }
.brand { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.brand small { font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--copper); font-weight: 600; }
.brand h1 { font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.05; margin: 0; text-wrap: balance; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--navy-2); }
.seg button { font: 500 13px var(--sans); color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 7px 16px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--copper); color: var(--navy); }
.seg.off { opacity: .4; }
.seg.off button[aria-pressed="true"] { background: none; color: var(--muted); }
.search { position: relative; }
.search input { font: 400 13px var(--sans); color: var(--ivory); background: var(--navy-2); border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; width: 230px; max-width: 60vw; }
.search input::placeholder { color: var(--muted); }
.btn { font: 500 13px var(--sans); color: var(--ivory); background: var(--navy-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.btn:hover { border-color: var(--copper); }
.btn.primary { background: var(--copper); border-color: var(--copper); color: var(--navy); }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.sug { overscroll-behavior: contain; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; background: var(--navy-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-height: 300px; overflow-y: auto; min-width: 260px; }
.sug button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; font: 400 13px var(--sans); color: var(--ivory); background: none; border: 0; padding: 9px 14px; cursor: pointer; }
.sug button:hover, .sug button.on { background: var(--navy-3); }
.sug span { color: var(--muted); font-size: 12px; }

.main { position: relative; min-height: 0; display: grid; grid-template-columns: 1fr 360px; }
.mapwrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#map { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#map:active { cursor: grabbing; }
.zone { stroke: var(--navy); stroke-width: .7; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .4s ease; }
.zone:hover { stroke: var(--ivory); stroke-width: 1.4; }
.zone.sel { stroke: var(--ivory); stroke-width: 2.4; }
.zone.dim { opacity: .45; }
.lbl { pointer-events: none; text-anchor: middle; font-family: var(--sans); paint-order: stroke; stroke: var(--navy); stroke-linejoin: round; }
.lbl .p { font-weight: 600; fill: var(--ivory); }
.lbl .n { font-weight: 500; fill: var(--muted); }
.legend { position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); bottom: 16px; background: color-mix(in srgb, var(--navy) 88%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--muted); }
.legend b { color: var(--ivory); font-weight: 600; font-size: 12px; }
.ramp { width: 200px; height: 8px; border-radius: 4px; }
.ramp-l { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.zoomc { position: absolute; right: 16px; top: 16px; display: flex; flex-direction: column; gap: 6px; }
.zoomc .btn { width: 36px; height: 36px; padding: 0; font-size: 18px; line-height: 1; }
.zoomc .btn.poi-add { font-size: 13px; width: auto; padding: 0 12px; }
.zoomc .btn[aria-pressed="true"] { background: var(--copper); color: var(--navy); border-color: var(--copper); }
.poi { cursor: pointer; }
.poi circle { stroke: var(--navy); }
.poi text.g { fill: var(--navy); font: 700 9px var(--sans); text-anchor: middle; pointer-events: none; }
.poi text.n { fill: var(--ivory); font: 600 10px var(--sans); paint-order: stroke; stroke: var(--navy); stroke-linejoin: round; pointer-events: none; }
.mapwrap.picking #map { cursor: crosshair; }
.pop { position: absolute; z-index: 15; width: 260px; max-width: calc(100% - 32px); background: var(--navy-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.35); display: grid; gap: 8px; font-size: 13px; }
.pop h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 0; line-height: 1.1; }
.pop .meta { color: var(--muted); font-size: 12px; }
.pop label { display: grid; gap: 4px; font-size: 11px; color: var(--muted); }
.pop input, .pop select { font: 400 14px var(--sans); color: var(--ivory); background: var(--navy); border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; }
.pop .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pop .acts .btn { padding: 6px 12px; font-size: 12px; }
.pop .x { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; }
.pickhint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--copper); color: var(--navy); font-weight: 600; font-size: 12px; border-radius: 999px; padding: 8px 14px; z-index: 14; }
.poi-leg { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.poi-leg span { display: inline-flex; align-items: center; gap: 4px; }
.poi-leg i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.show .zoomc .poi-add { display: none; }

.panel { overscroll-behavior: contain; border-left: 1px solid var(--line); background: var(--navy-2); overflow-y: auto; padding: 22px 22px 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.eyebrow { font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--copper); font-weight: 600; }
.zname { font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.05; margin: 4px 0 0; text-wrap: balance; }
.zmeta { color: var(--muted); font-size: 12px; margin-top: 6px; }
.price { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; border-top: 1px solid var(--line); }
.price .l { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.price .v { font-family: var(--serif); font-size: 44px; font-weight: 600; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.price .v small { font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.price .v.none { color: var(--muted); font-size: 28px; }
.price .s { font-size: 12px; color: var(--muted); }
.price .s b { color: var(--ok); font-weight: 600; }
.price.alt .v { font-size: 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; color: var(--ivory); }
.chips .more { color: var(--muted); border-style: dashed; cursor: pointer; background: none; font: inherit; font-size: 11px; border-radius: 999px; padding: 4px 9px; }
form.edit { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }
form.edit label { display: grid; gap: 4px; font-size: 11px; color: var(--muted); letter-spacing: .04em; }
form.edit input, form.edit textarea { font: 400 14px var(--sans); color: var(--ivory); background: var(--navy); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; box-sizing: border-box; font-variant-numeric: tabular-nums; }
form.edit textarea { resize: vertical; min-height: 52px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.formfoot { display: flex; align-items: center; gap: 10px; }
.status { font-size: 12px; color: var(--muted); }
.status.err { color: var(--bad); }
.rank { display: flex; flex-direction: column; }
.rank button { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: baseline; text-align: left; font: 400 13px var(--sans); color: var(--ivory); background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 2px; cursor: pointer; }
.rank button:hover { color: var(--copper); }
.rank i { font-style: normal; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.rank b { font-weight: 600; font-variant-numeric: tabular-nums; }
.intro p { color: var(--muted); line-height: 1.55; margin: 8px 0 0; font-size: 13px; }
.note { font-size: 11px; color: var(--muted); line-height: 1.5; }
.back { align-self: flex-start; }

/* Presentation mode: chrome recedes, the zone card floats over the map */
.show .bar .tools-edit { display: none; }
.show .main { grid-template-columns: 1fr; }
.show .panel { position: absolute; right: max(24px, env(safe-area-inset-right, 0px)); bottom: 24px; width: 380px; max-height: calc(100% - 48px); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.show .panel.idle { display: none; }
.show .panel form.edit, .show .panel .chips, .show .panel .back, .show .panel .note { display: none; }
.show .zname { font-size: 44px; }
.show .price .v { font-size: 58px; }
.show .price.alt .v { font-size: 30px; }
.show .price.alt.nodata { display: none; }
.hint { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); background: color-mix(in srgb, var(--navy) 88%, transparent); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; white-space: nowrap; }
.empty-state { position: absolute; top: 16px; left: max(16px, env(safe-area-inset-left, 0px)); max-width: 320px; font-size: 12px; color: var(--muted); background: var(--navy-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }

@media (max-width: 820px) {
  .main { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .panel { border-left: 0; border-top: 1px solid var(--line); max-height: 46vh; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .show .panel { left: 12px; right: 12px; width: auto; bottom: 12px; }
  .brand h1 { font-size: 22px; }
  .legend { bottom: 10px; }
  .ramp { width: 150px; }
  .hint { display: none; }
  .search input { width: 180px; }
}
@media (prefers-reduced-motion: reduce) { .zone { transition: none; } }
/* Ficha de venta: valor estimado por tipo de vivienda. */
.bd { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; }
.bd .bd-h { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.bd > div:not(.bd-h) { display: flex; justify-content: space-between; gap: 12px; border-top: 1px dashed var(--line); padding-top: 6px; }
.bd b { font-weight: 600; font-variant-numeric: tabular-nums; }
/* Puntos de interés cercanos a la zona. */
.near { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.near .l { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.near > div:not(.l) { display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; align-items: baseline; font-size: 13px; }
.near i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.near small { grid-column: 2; color: var(--muted); font-size: 11px; }
