:root {
  --blue: #0061E3;
  --blue-hover: #004EBB;
  --blue-soft: #E8F1FD;
  --ink: #2A2A2A;
  --muted: #6A6A6A;
  --line: #E2E2E2;
  --bg: #fff;
  --chip: #F4F4F4;
  --pin: #A1142A;
  --pin-hot: #7C0E20;
  --pin-text: #fff;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.14);
  --sans: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --rail: 56px;
  --bar: 26px;
  --nav: 64px;
  --tools: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
button, input, select { font-family: inherit; }
button, a, input, select { touch-action: manipulation; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .price-pin.is-hot,
  .price-pin.is-on { transform: translate(-50%, -100%); }
  .price-pin.is-dot.is-hot,
  .price-pin.is-dot.is-on { transform: translate(-50%, -50%); }
}
.skip {
  position: absolute;
  left: max(12px, env(safe-area-inset-left));
  top: -48px;
  z-index: 40;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.skip:focus-visible { top: max(8px, env(safe-area-inset-top)); }

.example-bar {
  height: var(--bar);
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

/* Top nav — logo centered */
.top {
  height: var(--nav);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: relative;
  z-index: 20;
}
.top nav { display: flex; gap: 20px; align-items: center; }
.top nav a {
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  padding: 6px 0;
}
.top nav a:hover { color: var(--blue); }
.top nav a.is-on { color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }
.top .left { justify-self: start; }
.top .right { justify-self: end; }
.brand {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.04em;
}
.brand .mark {
  width: 22px;
  height: 28px;
  flex: none;
  display: block;
}
.btn-text { color: var(--ink); font-weight: 600; }

.workspace {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  height: calc(100vh - var(--bar) - var(--nav));
}
.rail {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 4px;
  background: #fff;
}
.rail a {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.rail a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail a:hover { background: var(--chip); }
.rail a.is-on { color: var(--blue); background: var(--blue-soft); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.toolbar {
  height: var(--tools);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}
.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  height: 40px;
  min-width: 280px;
  flex: 0 1 360px;
}
.searchbox svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.searchbox:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 97, 227, 0.25);
}
.searchbox input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 16px;
  color: var(--ink);
}
.pill {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #cfcfcf;
  background: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.pill:hover { border-color: #111; }
.pill svg { width: 12px; height: 12px; }
.btn-save {
  height: 36px;
  padding: 0 16px;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-left: auto;
  white-space: nowrap;
}
.btn-save:hover { background: var(--blue-hover); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
}
.map-pane { position: relative; min-width: 0; background: #e8eef2; overflow: hidden; }
#map, .map-canvas { position: absolute; inset: 0; }
#map iframe, .mini-map iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

.price-pin {
  position: absolute;
  display: inline-block;
  background: var(--pin);
  color: var(--pin-text) !important;
  font-weight: 700;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1;
  padding: 4px 6px 5px;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.28);
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  transform: translate(-50%, -100%);
  margin-top: -5px;
}
.price-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  margin-left: -4px;
  border: 4px solid transparent;
  border-top-color: var(--pin);
  border-bottom-width: 0;
}
.price-pin[hidden] { display: none !important; }
.price-pin.is-dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
  line-height: 0;
  margin-top: 0;
  box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0,0,0,.35);
  transform: translate(-50%, -50%);
}
.price-pin.is-dot::after { display: none; }
.price-pin.is-hot,
.price-pin.is-on {
  background: var(--pin-hot);
  z-index: 5;
  transform: translate(-50%, -100%) scale(1.08);
}
.price-pin.is-hot::after,
.price-pin.is-on::after { border-top-color: var(--pin-hot); }
.price-pin.is-dot.is-hot,
.price-pin.is-dot.is-on {
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%) scale(1.05);
}

.map-chrome { position: absolute; z-index: 3; }
.map-chrome.top-left { top: 12px; left: 12px; }
.map-chrome.top-right { top: 12px; right: 12px; }
.map-chrome.bottom-left { left: 12px; bottom: 40px; }
.map-type {
  display: flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.map-type button {
  height: 32px;
  padding: 0 12px;
  border: 0;
  background: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
}
.map-type button + button { border-left: 1px solid var(--line); }
.map-type button.is-on { background: var(--blue); color: #fff; }
.map-type button:hover:not(.is-on) { background: #f5f5f5; }
.map-pop {
  position: absolute;
  z-index: 4;
  width: 228px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 16px rgba(0,0,0,.22);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transform: translate(-50%, -100%);
  margin-top: -8px;
}
.map-pop.is-below {
  transform: translate(-50%, 0);
  margin-top: 8px;
}
.map-pop img { width: 100%; height: 128px; object-fit: cover; display: block; }
.map-pop .body { padding: 10px 12px 12px; }
.map-pop .price { font-weight: 700; font-size: 18px; margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.map-pop .facts { margin: 2px 0 0; font-size: 13px; color: var(--ink); }
.map-pop .addr { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.map-pop .illust { position: absolute; top: 8px; left: 8px; }
.card.is-hot,
.card.is-on { box-shadow: var(--shadow-hover); }

.btn-outline {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 36px;
  padding: 0 12px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow);
  cursor: pointer;
  color: var(--ink);
}
.btn-outline:hover { background: #fafafa; }
.zoom {
  position: absolute;
  right: 12px;
  bottom: 40px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.zoom button {
  width: 36px;
  height: 36px;
  border: 0;
  background: #fff;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink);
}
.zoom button + button { border-top: 1px solid var(--line); }
.zoom button:hover { background: #f5f5f5; }

.list-pane {
  overflow: auto;
  background: #fff;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.list-head {
  padding: 12px 16px 4px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.list-head h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 2px;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}
.list-head .sub { color: var(--muted); font-size: 13px; }
.list-head .ex { font-size: 11px; color: #9aa; font-weight: 500; margin-left: 6px; }
.sort { font-size: 13px; color: var(--ink); }
.sort select {
  border: 0;
  font-weight: 600;
  background: transparent;
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 8px 16px 16px;
}
.source-credit {
  font-size: 11px;
  line-height: 1.45;
  color: #6b6b6b;
  padding: 0 16px 16px;
}
.source-credit a { color: #6b6b6b; text-decoration: underline; }
.card {
  display: block;
  color: inherit;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
  border: 1px solid #eee;
  transition: box-shadow .15s ease;
}
.card:hover { box-shadow: var(--shadow-hover); }
.photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #ddd;
  overflow: hidden;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.badge.cut { background: #111; color: #fff; }
.heart {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.heart svg { width: 18px; height: 18px; }
.illust {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: 3px 6px;
  border-radius: 3px;
}
.card .body { padding: 10px 12px 12px; }
.card .price { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; margin: 0; font-variant-numeric: tabular-nums; }
.card .facts { margin: 2px 0 2px; font-size: 13px; color: var(--ink); }
.card .addr { margin: 0; font-size: 13px; color: var(--muted); }
.card .sources { margin: 6px 0 0; font-size: 11px; color: #8a8a8a; }

/* Property page */
.page-wrap { background: #fff; }
.gallery {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  height: 420px;
  padding: 8px 8px 0;
  background: #fff;
}
.gallery .hero {
  grid-row: 1 / span 2;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #ddd;
}
.gallery .hero img, .gallery .tile img, .gallery .hero .fill, [data-gallery-main] img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.gallery .tile {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #d0d6dc;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}
.gallery .tile.is-on { outline: 3px solid var(--blue); outline-offset: -3px; }
.gallery-tabs {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  gap: 6px;
}
.gallery-tabs button {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.gallery-tabs button.is-on { background: var(--blue); color: #fff; }
.gallery .tile .cap {
  position: absolute;
  left: 10px;
  top: 10px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
}
.sv-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  top: auto;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
}
.gallery-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.icon-btn {
  height: 36px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.detail {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}
.kicker { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.kicker .ex { font-size: 11px; color: #9aa; }
.detail h1 { font-size: 28px; letter-spacing: -0.03em; margin: 0 0 8px; font-weight: 800; text-wrap: pretty; }
.hero-price { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; margin: 0; font-variant-numeric: tabular-nums; }
.hero-facts { font-size: 16px; margin: 4px 0 0; }
.hero-facts b { font-weight: 800; }
.section { margin: 32px 0; }
.section h2 { font-size: 22px; margin: 0 0 12px; font-weight: 700; letter-spacing: -0.02em; }
.section p { color: var(--ink); margin: 0 0 8px; }
.note { color: var(--muted); font-size: 13px; }
.facts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  margin: 0;
}
.facts-grid div { border-bottom: 1px solid var(--line); padding: 8px 0; display: flex; justify-content: space-between; }
.facts-grid dt { color: var(--muted); }
.facts-grid dd { margin: 0; font-weight: 600; }

.side {
  position: sticky;
  top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
  background: #fff;
}
.side h2 { font-size: 18px; margin: 0 0 12px; }
.source-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.source-row:last-of-type { border-bottom: 0; }
.source-row .who { font-weight: 700; }
.source-row .amt { font-size: 13px; color: var(--muted); }
.btn-portal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-column: 1 / -1;
  height: 36px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
}
.btn-portal:hover { background: var(--blue-hover); }
.side .min { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

table.plain { width: 100%; border-collapse: collapse; }
table.plain th, table.plain td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.plain th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }

.bars { display: grid; gap: 12px; }
.bars .row { display: grid; grid-template-columns: 160px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; }
.bars .track { height: 8px; background: #eee; border-radius: 99px; overflow: hidden; }
.bars .track > i { display: block; height: 100%; background: var(--blue); }
.bars .track > i.gold { background: #b45309; }

.site-foot {
  border-top: 1px solid var(--line);
  padding: 20px 24px 32px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.mini-map, .mini-map.fill { width: 100%; height: 100%; background: #dbe4ea; position: relative; }
.mini-map.fill { position: absolute; inset: 0; }

@media (max-width: 960px) {
  .workspace { grid-template-columns: 1fr; }
  .rail { display: none; }
  .split, .detail, .gallery, .grid { grid-template-columns: 1fr; }
  .gallery { height: auto; grid-template-rows: 240px 120px; }
  .gallery .hero { grid-row: auto; height: 240px; }
  .detail { grid-template-columns: 1fr; }
  .side { position: static; }
  .toolbar { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .searchbox { min-width: 0; flex: 1 1 100%; }
}

/* --- dados reais (v3) --- */
.map-chrome.bottom-left { display: flex; gap: 8px; align-items: center; }
.price-pin.is-approx:not(.is-dot) { box-shadow: 0 0 0 1px rgba(255,255,255,.9), 0 1px 3px rgba(0,0,0,.28); }
.price-pin.is-dot.is-approx { opacity: .85; }
.price-pin.is-cluster {
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; margin-top: 0; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(161,20,42,.25), 0 1px 4px rgba(0,0,0,.3);
}
.price-pin.is-cluster::after { display: none; }
.price-pin.is-cluster:hover { background: var(--pin-hot); }
.map-pop { color: var(--ink); }
.map-pop .pop-link { display: block; color: inherit; position: relative; }
.map-pop .prec { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.map-pop .stack-title { margin: 0; font-weight: 700; font-size: 14px; }
.map-pop .stack { list-style: none; margin: 6px 0 0; padding: 0; max-height: 220px; overflow: auto; }
.map-pop .stack li + li { border-top: 1px solid var(--line); }
.map-pop .stack a { display: block; padding: 6px 0; color: inherit; }
.map-pop .stack a:hover .price { color: var(--blue); }
.map-pop .stack .price { font-size: 15px; }
.card { display: flex; flex-direction: column; }
.card-link { display: block; color: inherit; }
.card-link:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.card .sources { margin: 0; padding: 0 12px 12px; }
.card .sources a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.card .sources a:hover { color: var(--blue); }
.no-photo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.empty { padding: 48px 0; color: var(--muted); }
.card { content-visibility: auto; contain-intrinsic-size: auto 340px; }
.card .addr, .source-row .amt, .map-pop .addr { overflow-wrap: anywhere; }
.source-row > div { min-width: 0; }
.sort select { color: var(--ink); background-color: #fff; }
@media (max-width: 960px) { .searchbox input, .sort select { font-size: 16px; } }
@media (max-width: 640px) { .top .left a:not(.is-on) { display: none; } }
