/* /propiedades: the inventory and the map (plan § 5, § 6; mockup v4.8 @INV, ported).
   Without JavaScript the kit's finder and cards (#inv-nojs) are the list. inventario.js adds .js-inv to
   #terrenos once its data is in: the kit list hides and the #ix shell (served hidden) shows. */

/* ---------- the section and the kit list (the no-JS and SEO list) ---------- */
#terrenos {
  --g2-ls-accent: var(--sign);
  --g2-ls-accent-ink: var(--sign-ink);
  --g2-ls-text: var(--paper);
  --g2-ls-muted: var(--muted);
  --g2-ls-border: rgba(255, 255, 255, .14);
  --g2-ls-surface: var(--ink-2);
  --g2-ls-radius: 10px;
  --g2-ls-gap: 14px;
  --g2-ls-wa: #1f3a29;
  padding: clamp(18px, 2.6vw, 30px) 0 clamp(40px, 6vw, 72px);
}
.inv-nojs { margin-top: 8px; }
.inv-nojs .listing-finder { margin-bottom: 18px; }
.inv-nojs .listing-card { background: var(--ink-2); }
.inv-nojs .listing-card__title { font: 800 17px/1.25 var(--body); }
.inv-nojs .listing-empty { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--ink-2); font-weight: 700; }
.js-inv .inv-nojs { display: none; }

.num { font-variant-numeric: tabular-nums; }

/* ---------- head and the group toggle ---------- */
.inv-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: end; margin-bottom: 18px; }
.inv-head .kicker { margin-bottom: 6px; }
.inv-head .sec-lede { margin: 0; }
.inv-h1 { margin: 0; font: 400 clamp(30px, 3.4vw, 46px)/1.04 var(--display); text-transform: uppercase; text-shadow: none; text-wrap: balance; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 6px; border-radius: 14px; background: var(--well); border: 1px solid var(--line); min-width: min(100%, 560px); }
.seg-b { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 76px; padding: 6px 14px 6px 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); text-decoration: none; cursor: pointer; transition: background .25s ease, color .25s ease, border-color .25s ease; }
.seg-i { width: 48px; height: 48px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.seg b { display: block; font: 400 clamp(21px, 1.9vw, 26px)/1 var(--display); text-transform: uppercase; color: var(--paper); }
.seg small { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; line-height: 1.25; }
.seg .ct { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 999px; background: var(--ink-3); color: var(--paper); font: 400 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.seg .ct:empty { display: none; }
.seg-b:hover { color: var(--paper); border-color: var(--line); }
.seg-b[aria-pressed="true"] { background: var(--ink-3); border-color: rgba(255, 198, 41, .55); color: #efe8dc; }
.seg-b[aria-pressed="true"] .seg-i { color: var(--sign); }
.seg-b[aria-pressed="true"] .ct { background: var(--sign); color: var(--sign-ink); }
.seg-b:focus-visible { outline: 3px solid var(--sign); outline-offset: 2px; }

/* ---------- shared bits ---------- */
.ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--field); background: transparent; color: var(--paper); font: 700 14px var(--body); cursor: pointer; text-decoration: none; white-space: nowrap; }
.ghost:hover { border-color: var(--sign); color: var(--sign); }
.ghost:focus-visible, .pc button:focus-visible, .pc a:focus-visible, .mctl button:focus-visible, .mp-x:focus-visible { outline: 2px solid var(--sign); outline-offset: 2px; }

/* ---------- the split view: edge-to-edge map + the rail ---------- */
.ix { position: relative; height: clamp(620px, 86svh, 980px); overflow: hidden; background: #141815; border-block: 1px solid var(--line); scroll-margin-top: calc(var(--top-h) + var(--safe-t)); }
.ix-bar { display: none; }
.mapv { position: absolute; inset: 0; overflow: hidden; background: #16181b; }
.mapv .map { position: absolute; inset: 0; } /* beats .maplibregl-map { position: relative }, loaded later */
.map .maplibregl-canvas:focus-visible { outline: 3px solid var(--sign); outline-offset: -3px; }
.map .maplibregl-ctrl-attrib { background: rgba(14, 16, 15, .78); color: var(--muted); font: 600 11px var(--body); }
.map .maplibregl-ctrl-attrib a { color: var(--muted); }
.map .maplibregl-ctrl-scale { border-color: #d9d2c4; background: rgba(14, 16, 15, .78); color: var(--muted); font: 700 11px var(--body); }
.map .maplibregl-ctrl-bottom-right { right: 16px; bottom: 16px; }
.map .maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 6px 0 0 6px; }
.mpins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mload { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; background: #141815; color: var(--muted); font-weight: 700; text-align: center; }
.skip-map { position: absolute; z-index: 6; left: 16px; top: 16px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--sign); color: var(--sign-ink); font: 800 14px var(--body); text-decoration: none; }
.skip-map:not(:focus) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* map controls */
.mctl { position: absolute; z-index: 2; left: 448px; bottom: 16px; display: flex; align-items: center; gap: 8px; }
.mctl .grp { display: flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: rgba(14, 16, 15, .84); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.mctl button { min-width: 44px; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: #fff; font: 800 17px/1 var(--body); cursor: pointer; }
.mctl .grp button + button { border-left: 1px solid var(--line); }
.mctl button:hover { color: var(--sign); background: rgba(255, 255, 255, .05); }
.mctl .wide { border-radius: 10px; border: 1px solid var(--line); background: rgba(14, 16, 15, .84); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: 13px; }

/* map chips: town chips (below zoom 9), clusters, subdivision chips, the selected lot label */
.tc, .tcl { position: absolute; left: 0; top: 0; visibility: hidden; display: flex; align-items: flex-start; justify-content: center; min-width: 44px; height: 48px; margin: 0; padding: 0; border: 0; background: none; color: #fff; font: inherit; cursor: pointer; pointer-events: auto; will-change: transform; }
.tc.on, .tcl.on { visibility: visible; }
.tc-p { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 5px 0 12px; border-radius: 999px; background: #131514; border: 2px solid rgba(255, 198, 41, .9); font: 800 13px/1 var(--body); white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .55); transform-origin: 50% 100%; transition: background .2s ease, transform .2s ease, box-shadow .2s ease; }
.tc-p::after { content: ""; position: absolute; left: 50%; bottom: -10px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top: 8px solid rgba(255, 198, 41, .9); }
.tc-p i { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--sign); color: var(--sign-ink); font: 400 15px/1 var(--display); font-style: normal; font-variant-numeric: tabular-nums; }
.tcl .tc-p { border-radius: 10px; border-width: 2px 2px 2px 6px; }
.tc.zero .tc-p { border-color: #6d6a63; }
.tc.zero .tc-p::after { border-top-color: #6d6a63; }
.tc.zero .tc-p i { background: var(--ink-3); color: var(--paper); }
.tc.sub .tc-p { border-style: solid; border-left-width: 6px; background: #221f14; }
.tc.lbl .tc-p::after { display: none; }
.tc:hover .tc-p, .tc.hot .tc-p, .tcl:hover .tc-p, .tcl.hot .tc-p { background: #2b2717; border-color: #ffe08a; transform: scale(1.08); box-shadow: 0 0 0 4px rgba(255, 198, 41, .25), 0 8px 18px rgba(0, 0, 0, .55); }
.tc:focus-visible, .tcl:focus-visible { outline: none; }
.tc:focus-visible .tc-p, .tcl:focus-visible .tc-p { outline: 2px solid var(--sign); outline-offset: 3px; }
.ml { position: absolute; left: 0; top: 0; visibility: hidden; white-space: nowrap; pointer-events: none; will-change: transform; }
.ml.on { visibility: visible; }
.ml.sel { z-index: 1; display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: var(--sign); color: var(--sign-ink); font: 800 13px/1 var(--body); box-shadow: 0 6px 22px rgba(0, 0, 0, .55); }
.ml.sel::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top: 7px solid var(--sign); }
.ml.zone { padding: 4px 9px; border-radius: 999px; background: rgba(19, 21, 20, .92); color: var(--sign); font: 800 11px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; }

/* ---------- the rail ---------- */
.irail { position: absolute; z-index: 2; left: 16px; top: 16px; bottom: 16px; width: 400px; display: flex; flex-direction: column; border-radius: 14px; background: rgba(17, 19, 18, .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); overflow: hidden; }
.irail:focus { outline: none; }
.lv { display: grid; gap: 4px; padding: 10px 16px 12px; border-bottom: 1px solid var(--line); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; font-size: 13px; font-weight: 800; }
.crumbs li { display: flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "›"; margin: 0 9px; color: var(--dim); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--sign); text-underline-offset: 3px; }
.crumbs a:hover { color: var(--sign-hover); }
.crumbs a:focus-visible { outline: 2px solid var(--sign); outline-offset: 2px; border-radius: 4px; }
.crumbs [aria-current] { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-h { margin: 0; font: 400 30px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.lv-h:focus, .lvs-h:focus { outline: none; }
.lv-h:focus-visible, .lvs-h:focus-visible { outline: 2px solid var(--sign); outline-offset: 3px; }
.lv-m { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.lv-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 8px 8px 12px; border-radius: 10px; background: var(--ink-3); }
.lv-ask p { flex: 1 1 140px; margin: 0; font-size: 13.5px; font-weight: 800; color: var(--muted); }
.lv-ask b { color: var(--paper); }
.lv-mi { min-height: 44px; padding: 0 16px; font-size: 14px; }
.lvs { display: none; }

/* the acres filter (§ 5.7) */
.af { display: grid; gap: 8px; padding: 10px 16px 12px; border-bottom: 1px solid var(--line); }
.af-top { display: flex; align-items: center; gap: 10px; }
.af-l { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.af-n { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--sign); white-space: nowrap; }
.af-x, .af-see { display: none; }
.af-q { display: flex; flex-wrap: wrap; gap: 6px; scrollbar-width: none; padding: 2px; margin: -2px; }
.af-q::-webkit-scrollbar { display: none; }
.af-q button { flex: none; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--field); background: transparent; color: var(--muted); font: 800 13.5px var(--body); cursor: pointer; }
.af-q button:hover { color: var(--paper); border-color: rgba(255, 198, 41, .6); }
.af-q button[aria-pressed="true"] { background: var(--sign); border-color: var(--sign); color: var(--sign-ink); }
.af-q button:focus-visible { outline: 2px solid var(--sign); outline-offset: 2px; }
.af-r { display: flex; align-items: center; gap: 8px; }
.af-f input { width: 84px; min-height: 44px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--field); background: var(--well); color: var(--paper); font: 700 15px var(--body); font-variant-numeric: tabular-nums; }
.af-f input::placeholder { color: var(--dim); }
.af-f input:focus { outline: none; border-color: var(--sign); box-shadow: 0 0 0 3px rgba(255, 198, 41, .25); }
.af-f input[aria-invalid="true"] { border-color: var(--err); }
.af-a { color: var(--dim); font-weight: 700; }
.af-clr { margin-left: auto; }
.af-e { margin: 0; font-size: 13px; font-weight: 700; color: var(--err); }

/* the list */
.cards { position: relative; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: #3a3d42 transparent; }
.cards:focus-visible { outline: 2px solid var(--sign); outline-offset: -2px; }
.rowc { display: none; }
.cards ul { list-style: none; margin: 0; padding: 0; }
.pc { position: relative; flex: none; display: grid; grid-template-columns: 132px minmax(0, 1fr); border-radius: 11px; overflow: hidden; background: var(--ink-2); border: 1px solid var(--line); cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease, opacity .5s ease; content-visibility: auto; contain-intrinsic-size: auto 150px; }
.pc:hover, .pc.hot { border-color: rgba(255, 198, 41, .5); }
.pc.sel { border-color: var(--sign); box-shadow: 0 0 0 1px var(--sign), 0 10px 30px rgba(0, 0, 0, .4); }
.pc.nuevo { animation: pcNew 2.4s ease-out 2; }
@keyframes pcNew { 0% { box-shadow: 0 0 0 0 rgba(255, 198, 41, .8); } 60% { box-shadow: 0 0 0 10px rgba(255, 198, 41, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 198, 41, 0); } }
.pc.gone { opacity: 0; }
.pc-ph { position: relative; margin: 0; min-height: 100%; background: #1a1c1f; overflow: hidden; }
.pc-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pc-ph.none { background: radial-gradient(circle at 70% 20%, rgba(255, 198, 41, .16), transparent 55%), repeating-linear-gradient(160deg, #1d2023 0 10px, #191b1e 10px 20px); }
.pc-ph.none::after { content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 22px; margin: -11px 0 0 -17px; border: 2px solid rgba(255, 198, 41, .55); border-top: 0; border-radius: 0 0 50% 50% / 0 0 40% 40%; }
.pc-new { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 4px; background: var(--sign); color: var(--sign-ink); font: 800 11px/1.3 var(--body); letter-spacing: .08em; text-transform: uppercase; }
.pc-b { display: grid; gap: 5px; align-content: start; padding: 10px 12px 12px; min-width: 0; }
.pc-k { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--sign); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-h { margin: 0; font: 400 25px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.pc-r { margin: 0; font-size: 13px; font-weight: 700; line-height: 1.3; color: #e6e0d4; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.pc-tags span { padding: 1px 7px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 11px; font-weight: 800; color: var(--muted); }
.pc-tags .st { border-color: var(--sign); color: var(--sign); }
.pc-a { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.pc-a button { min-height: 36px; padding: 0 11px; border-radius: 999px; font: 800 12.5px var(--body); cursor: pointer; }
.pc-go { border: 0; background: var(--sign); color: var(--sign-ink); }
.pc-go:hover { background: var(--sign-hover); }
.pc-sh { border: 1px solid var(--field); background: transparent; color: var(--paper); }
.pc-sh:hover, .pc-sh[aria-expanded="true"] { border-color: var(--sign); color: var(--sign); }
.pc-f { display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; font-size: 12.5px; font-weight: 800; color: var(--muted); text-underline-offset: 3px; }
.pc-f:hover { color: var(--sign); }

/* level 0: one group per town */
.tg { display: flex; flex-direction: column; gap: 10px; }
.tg-l { display: flex; flex-direction: column; gap: 12px; }
.tg-h { position: sticky; top: -12px; z-index: 2; margin: -12px -12px 0; padding: 12px 12px 4px; background: #131514; font: inherit; }
.tg + .tg .tg-h { margin-top: 0; padding-top: 6px; }
.tg-b { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 2px 10px; width: 100%; min-height: 56px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid var(--sign); background: var(--ink-3); color: var(--paper); text-decoration: none; text-align: left; cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.tg-n { grid-row: 1 / 3; min-width: 0; }
.tg-n b { display: block; font: 400 23px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-n small { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.tg-c { justify-self: end; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 9px; border-radius: 999px; background: var(--sign); color: var(--sign-ink); font: 400 17px/1 var(--display); font-variant-numeric: tabular-nums; }
.tg-go { justify-self: end; font-size: 12px; font-weight: 800; color: var(--sign); white-space: nowrap; }
.tg-b:hover, .tg-b.hot { border-color: rgba(255, 198, 41, .7); border-left-color: var(--sign); background: #34312a; }
.tg-b:focus-visible { outline: 2px solid var(--sign); outline-offset: 2px; }
/* a place with 0 lots of this size: full-contrast text, muted outline, never dimmed */
.tg-b.zero, .sd-b.zero { border-color: #55534e; border-left-color: #6d6a63; background: var(--ink-2); }
.tg-b.zero .tg-c { min-width: 0; height: auto; padding: 4px 9px; background: transparent; border: 1px solid #6d6a63; color: var(--paper); font: 800 12px/1.1 var(--body); }

.lv-sub { margin: 2px 0 0; font: 800 12px/1.3 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.lv-note { flex: none; margin: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255, 198, 41, .45); background: #221f14; font-size: 13.5px; font-weight: 700; line-height: 1.4; }
.lv-empty { flex: none; display: grid; gap: 10px; padding: 14px; border-radius: 11px; background: var(--ink-2); border: 1px solid var(--line); }
.lv-empty p { margin: 0; font-weight: 700; line-height: 1.4; }
.lv-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-near { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.lv-near a { color: var(--sign); font-weight: 800; text-underline-offset: 3px; }
.lv-empty .cbtns { gap: 6px; }
.lv-empty .cb { flex: 1; min-width: 0; padding: 0 8px; font-size: 14px; white-space: nowrap; }
.lv-empty .cb .num, .ask-c .cb .num { display: none; } /* the number is in the bar above; three buttons fit the rail */
.lv-empty .mi-open { justify-self: start; min-height: 44px; padding: 0 16px; font-size: 14px; }
.ask-c { display: none; }

/* level 1: subdivision cards (a real name the owner switched on; solid edge, never a demo label) */
.sd { flex: none; }
.sd-b { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; width: 100%; min-height: 104px; padding: 8px; border-radius: 11px; border: 2px solid rgba(255, 198, 41, .8); background: #221f14; color: var(--paper); text-decoration: none; text-align: left; cursor: pointer; }
.sd-ph { position: relative; width: 96px; min-height: 86px; border-radius: 7px; overflow: hidden; background: #1a1c1f; }
.sd-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sd-ph.none { background: radial-gradient(circle at 50% 50%, rgba(255, 198, 41, .22), transparent 60%), #1d2023; }
.sd-t { display: grid; align-content: center; gap: 5px; min-width: 0; }
.sd-t b { font: 400 22px/1 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.sd-t small { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.sd-go { font-size: 12.5px; font-weight: 800; color: var(--sign); }
.sd-b:hover { background: #2b2717; }
.sd-b:focus-visible { outline: 2px solid var(--sign); outline-offset: 2px; }

/* ---------- the lot panel (desktop) / sheet (phone) ---------- */
.mpanel { position: absolute; z-index: 3; top: 16px; right: 16px; bottom: 16px; width: 384px; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: rgba(18, 20, 19, .95); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .5); animation: mpIn .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes mpIn { from { opacity: 0; transform: translateX(24px); } }
.mp-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3a3d42 transparent; }
.mp-x { position: absolute; z-index: 2; top: 8px; right: 8px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: rgba(14, 16, 15, .78); color: #fff; font: 700 22px/1 var(--body); cursor: pointer; }
.mp-x:hover { border-color: var(--sign); color: var(--sign); }
.mp-grab { display: none; }
.mp-photo { position: relative; margin: 0; aspect-ratio: 16 / 10; background: #1a1c1f; overflow: hidden; }
.mp-photo img { width: 100%; height: 100%; object-fit: cover; }
.mp-photo.none { background: radial-gradient(circle at 70% 30%, rgba(255, 198, 41, .18), transparent 55%), repeating-linear-gradient(160deg, #1d2023 0 14px, #191b1e 14px 28px); }
.mp-thumbs { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; }
.mp-thumbs:empty { display: none; }
.mp-thumbs button { width: 44px; height: 44px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #000; cursor: pointer; }
.mp-thumbs button[aria-pressed="true"] { border-color: var(--sign); }
.mp-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-body { display: grid; gap: 10px; padding: 14px 16px 16px; }
.mp-body .kicker, .mp-body .feat { margin: 0; }
.mp-h { margin: 0; font: 400 clamp(26px, 2.3vw, 34px)/1.02 var(--display); text-transform: uppercase; }
.mp-h:focus { outline: none; }
.mp-h:focus-visible { outline: 2px solid var(--sign); outline-offset: 3px; }
.mp-gone { margin: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--err); background: #2a1716; font-weight: 800; }
.mp-rule { margin: 0; border-left: 3px solid var(--sign); padding-left: 10px; font-weight: 700; font-size: 15px; line-height: 1.4; }
.mp-restr { justify-self: start; margin: 0; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--sign); color: var(--sign); font-size: 13px; font-weight: 800; }
.mp-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.mp-facts div { padding: 8px 10px; background: var(--ink-2); min-width: 0; }
.mp-facts dt { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.mp-facts dd { margin: 2px 0 0; font-weight: 700; font-size: 14px; }
.mp-sub { margin: 4px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.near-l { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.near-l li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 12px; font-size: 14px; background: var(--ink-2); }
.near-l li + li { border-top: 1px solid var(--line); }
.near-l span { min-width: 0; color: var(--muted); }
.near-l b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mp-zone { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--ink-2); font-weight: 700; font-size: 14px; color: var(--muted); }
.mp-fine { margin: 0; font-size: 12px; color: var(--dim); }
.mp-cta { display: grid; gap: 8px; }
.mp-cta .btn { min-height: 46px; padding: 0 10px; font-size: 15px; cursor: pointer; font-family: inherit; }
.mp-lead { width: 100%; }
.mp-cta2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mp-cta2 .btn { min-height: 44px; font-size: 14px; }
.mp-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.mp-nav .ghost { padding: 0 10px; }
.mp-nav span { font-weight: 800; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- notes, share popover ---------- */
.inv-notes { display: grid; gap: 4px; margin-top: 14px; }
.inv-notes .note { margin: 0; }
.share { position: fixed; z-index: 60; left: 12px; top: 12px; width: min(330px, calc(100vw - 24px)); display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: #1b1e1d; border: 1px solid rgba(255, 255, 255, .2); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.sh-t { margin: 0 0 2px; font-size: 13px; font-weight: 800; color: var(--muted); }
.sh-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sh-row button, .sh-row a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 10px; border-radius: 8px; font: 800 14px var(--body); text-decoration: none; cursor: pointer; }
#sh-copy { border: 0; background: var(--sign); color: var(--sign-ink); }
#sh-wa { border: 1px solid #3dbb6a; background: #1f3a29; color: #e6ffe9; }
.sh-l { width: 100%; min-height: 44px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--field); background: var(--well); color: var(--paper); font: 600 13px var(--body); }
.sh-ok { margin: 0; min-height: 1.2em; font-size: 13px; font-weight: 700; color: var(--ok); }

@media (max-width: 1000px) {
  .inv-head { grid-template-columns: minmax(0, 1fr); }
  .seg { min-width: 0; }
  .irail { width: 340px; }
  .pc { grid-template-columns: 112px minmax(0, 1fr); }
  .mctl { left: 372px; }
  .mpanel { width: 340px; }
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .af-q { flex-wrap: nowrap; overflow-x: auto; } /* the phone surface keeps one scrolling row (mockup) */
  #terrenos { padding-top: 12px; }
  .inv-head { gap: 10px; margin-bottom: 12px; }
  .inv-head .kicker, .inv-lede { display: none; }
  .inv-h1 { font-size: 25px; }
  .seg-b { grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto; gap: 4px 10px; min-height: 64px; padding: 6px 8px; }
  .seg-i { width: 36px; height: 36px; grid-row: 1 / 3; }
  .seg b { font-size: 18px; }
  .seg small { display: none; }
  .seg .ct { justify-self: start; min-width: 0; height: auto; padding: 2px 8px; font-size: 14px; }

  .ix { height: auto; overflow: visible; border: 0; background: none; }
  .ix-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 54px; box-sizing: border-box; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
  .ix-bar p { margin: 0; font-weight: 700; color: var(--muted); font-size: 14px; }
  .ix-bar b { font: 400 22px/1 var(--display); color: var(--paper); margin-right: 5px; }
  .mapv { position: relative; inset: auto; height: calc(100svh - var(--top-h) - var(--safe-t) - 54px); /* the bar above + the map fill the screen under the nav */ min-height: 420px; border-block: 1px solid var(--line); }
  .mctl { left: auto; right: 10px; top: 10px; bottom: auto; flex-direction: column; align-items: flex-end; }
  .mctl .grp { flex-direction: column; }
  .mctl .grp button + button { border-left: 0; border-top: 1px solid var(--line); }
  .mctl .wide { order: -1; }
  .map .maplibregl-ctrl-bottom-right { right: auto; bottom: auto; top: 10px; left: 10px; display: flex; flex-direction: row-reverse; align-items: center; gap: 6px; } /* top left: clear of the chips row and the controls */

  .irail { left: 0; right: 0; top: auto; bottom: 10px; width: auto; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; overflow: visible; }
  .lv { display: none; }
  .lvs { display: flex; align-items: center; gap: 2px; width: max-content; max-width: calc(100% - 32px); min-height: 44px; margin: 0 16px 8px; padding: 0 4px 0 0; border-radius: 999px; background: rgba(17, 19, 18, .95); border: 1px solid rgba(255, 198, 41, .55); box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
  .lvs-b { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0 0 3px; border: 0; border-radius: 50%; background: transparent; color: var(--sign); font: 800 28px/1 var(--body); cursor: pointer; }
  .lvs-b:focus-visible { outline: 2px solid var(--sign); outline-offset: -2px; }
  .lvs-h { margin: 0 8px 0 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 14.5px/1.2 var(--body); color: var(--paper); }
  .lvs-b:not([hidden]) + .lvs-h { margin-left: 0; }
  .lvs-af { flex: none; min-height: 36px; margin: 4px 0; padding: 0 12px; border-radius: 999px; border: 1px solid var(--field); background: var(--ink-3); color: var(--paper); font: 800 13px var(--body); cursor: pointer; }
  .lvs-af.on { border-color: var(--sign); background: var(--sign); color: var(--sign-ink); }
  .lvs-af:focus-visible { outline: 2px solid var(--sign); outline-offset: 2px; }

  /* the acres filter is THE bottom surface when open; it replaces the swipe row */
  .af { display: none; position: fixed; z-index: 44; left: 0; right: 0; bottom: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border: 1px solid rgba(255, 198, 41, .45); border-bottom: 0; border-radius: 16px 16px 0 0; background: #171a19; box-shadow: 0 -14px 50px rgba(0, 0, 0, .6); }
  .ix.afo .af { display: grid; }
  .ix.afo .cards, .ix.afo .rowc { visibility: hidden; }
  .af-x { display: grid; place-items: center; width: 44px; height: 44px; margin: -8px -8px -8px 0; border: 0; border-radius: 50%; background: transparent; color: var(--paper); font: 400 28px/1 var(--body); cursor: pointer; }
  .af-n { margin-left: auto; }
  .af-see { display: flex; width: 100%; min-height: 48px; }
  .af-f input { width: 100px; font-size: 16px; }

  .tg, .tg-l, .cards ul { display: contents; }
  .tg-h { position: static; display: flex; flex: none; margin: 0; padding: 0; background: none; scroll-snap-align: start; }
  .tg + .tg .tg-h { padding: 0; }
  .tg-b { width: 148px; height: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; align-content: start; gap: 8px; padding: 10px 12px; background: rgba(24, 26, 25, .96); border-color: rgba(255, 198, 41, .45); box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
  .tg-n { grid-row: auto; }
  .tg-n b { white-space: normal; font-size: 21px; }
  .tg-c { justify-self: start; }
  .tg-go { justify-self: start; align-self: end; }
  .lv-sub { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lv-note, .lv-empty { width: min(300px, 82vw); scroll-snap-align: start; background: rgba(24, 26, 25, .97); }
  .lv-empty { max-height: 60svh; overflow: auto; }
  .ask-c { display: grid; align-content: center; gap: 10px; flex: none; width: min(300px, 82vw); padding: 12px 14px; border-radius: 11px; border: 1px solid rgba(255, 198, 41, .45); background: rgba(24, 26, 25, .97); box-shadow: 0 10px 28px rgba(0, 0, 0, .5); scroll-snap-align: start; }
  .ask-c p { margin: 0; font-size: 13px; font-weight: 800; color: var(--muted); }
  .ask-c p b { display: block; margin-top: 2px; font: 400 22px/1.05 var(--display); text-transform: uppercase; color: var(--paper); }
  .ask-c .btn { min-height: 44px; font-size: 14px; }
  .sd { width: min(300px, 82vw); scroll-snap-align: start; }
  .sd-b { height: 100%; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }

  .cards { flex-direction: row; gap: 10px; overflow-x: auto; overflow-y: hidden; padding: 0 16px 4px; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; scrollbar-width: none; }
  .cards::-webkit-scrollbar { display: none; }
  .pc { width: min(300px, 82vw); grid-template-columns: 96px minmax(0, 1fr); scroll-snap-align: start; background: rgba(24, 26, 25, .96); box-shadow: 0 10px 28px rgba(0, 0, 0, .5); content-visibility: visible; }
  .pc-b { gap: 4px; padding: 8px 10px 10px; }
  .pc-h { font-size: 21px; }
  .pc-r { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .pc-a { margin-top: 2px; gap: 4px; }
  .pc-a button { min-height: 36px; padding: 0 9px; font-size: 12px; }
  .pc-f { display: none; }
  .rowc { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 16px 0; }
  .rowc .ghost { width: 44px; padding: 0; background: rgba(17, 19, 18, .92); font-size: 20px; }
  .rowc .num { min-width: 64px; padding: 4px 10px; border-radius: 999px; background: rgba(17, 19, 18, .92); text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); }

  /* "Ver lista": the whole level in the page flow */
  .ix.list .irail { position: static; margin-top: 12px; }
  .ix.list .lvs { margin-top: 0; }
  .ix.list .cards { display: grid; overflow: visible; padding: 0 16px; scroll-snap-type: none; }
  .ix.list .tg, .ix.list .tg-l, .ix.list .cards ul { display: grid; gap: 10px; }
  .ix.list .tg-h { position: sticky; top: calc(var(--top-h) + var(--safe-t)); z-index: 2; padding: 6px 0; background: var(--ink); }
  .ix.list .tg-b { width: 100%; height: auto; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 10px; }
  .ix.list .tg-n { grid-row: 1 / 3; }
  .ix.list .tg-c, .ix.list .tg-go { justify-self: end; }
  .ix.list .lv-sub { position: static; width: auto; height: auto; margin: 4px 0 0; overflow: visible; clip: auto; }
  .ix.list .ask-c, .ix.list .lv-note, .ix.list .lv-empty, .ix.list .sd { width: auto; }
  .ix.list .lv-empty { max-height: none; }
  .ix.list .pc { width: auto; grid-template-columns: 120px minmax(0, 1fr); }
  .ix.list .pc-f { display: inline-flex; }
  .ix.list .rowc { display: none; }

  /* the lot sheet: one bottom surface, under the 96px top, never over it */
  .mpanel { position: fixed; z-index: 45; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: min(84svh, calc(100svh - var(--top-h) - var(--safe-t) - 8px)); border-radius: 18px 18px 0 0; border-bottom: 0; background: #171a19; animation: mpUp .4s cubic-bezier(.2, .7, .2, 1) both; box-shadow: 0 -14px 50px rgba(0, 0, 0, .6); }
  @keyframes mpUp { from { transform: translateY(40%); opacity: 0; } }
  .mp-grab { display: block; position: absolute; z-index: 2; top: 7px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: rgba(255, 255, 255, .55); }
  .mp-photo { aspect-ratio: 16 / 9; }
  .mp-scroll { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .ix.pnl:not(.list) .irail { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .mpanel { animation: none; }
  .pc, .seg-b, .tg-b, .tc-p { transition: none; }
  .pc.nuevo { animation: none; }
  .pc.gone { opacity: 1; }
}
