:root {
  --upm-navy: #062B5B;
  --upm-rent: #0BA360;
  --upm-rent-hover: #088a4f;
  --upm-sale: #062B5B;
  --upm-sale-soft: #e8eef8;
  --upm-muted: #5b6470;
  --upm-border: #e3e8f1;
  --upm-border-strong: #d2d9e6;
  --upm-bg: #eef1f8;
  --upm-font: "Trebuchet MS", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --upm-sidebar: 380px;
}
.upm-live,
.upm-live * { box-sizing: border-box; }
/* Critical: constrain map page height so Leaflet does not inherit a multi-thousand-px
   list-driven shell (that stretched zoom-11 bounds into Tamil Nadu). */
body.upm-map-body {
  overflow: hidden;
}
.upm-live {
  /* Stacking context below PropGlen header flyouts (header z-index 1000 on map).
     Keeps Leaflet .leaflet-top (~1000) from painting over nav dropdowns.
     Does not move zoom controls; only lowers the map layer as a whole. */
  position: relative;
  z-index: 0;
  height: calc(100vh - var(--pg-header-h, 72px));
  max-height: calc(100vh - var(--pg-header-h, 72px));
  min-height: 0;
  overflow: hidden;
}
.upm-live .upm-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  max-height: 100%;
}
.upm-rail {
  background: var(--upm-navy);
  color: #f3f6ff;
  padding: 16px 12px 20px;
  overflow: auto;
}
.upm-rail__eyebrow {
  margin: 0 0 4px;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}
.upm-rail h1 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  line-height: 1.25;
}
.upm-rail__note {
  margin: 0 0 10px;
  font-size: 0.76rem;
  line-height: 1.4;
  opacity: 0.86;
}
.upm-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.upm-rail details {
  margin: 0 0 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
}
.upm-rail summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}
.upm-rail ul {
  margin: 6px 0 0;
  padding-left: 1.1rem;
  font-size: 0.72rem;
  line-height: 1.4;
  opacity: 0.9;
}
/* Entry context is URL-driven from Discovery / nav — do not show a third faint control row. */
.upm-live .upm-entry { display: none !important; }
.upm-rail__links {
  margin-top: 10px;
  font-size: 0.72rem;
  line-height: 1.55;
}
.upm-rail__links a { color: #b7f0d4; }

.upm-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 12px;
  gap: 8px;
}
.upm-stage__label {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: #344054;
}
.upm-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--upm-sidebar) minmax(0, 1fr);
  border: 1px solid var(--upm-border-strong);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 32px rgba(10,16,32,0.08);
}
.upm-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--upm-border);
  background: #f8fafc;
}
.upm-sidebar__head {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--upm-border);
  background: #fff;
}
.upm-sidebar__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.upm-sidebar__nav a {
  font-size: 0.76rem;
  color: var(--upm-rent);
  font-weight: 650;
  text-decoration: none;
}
.upm-sidebar__title {
  margin: 0 0 2px;
  font-size: 1.05rem;
}
.upm-sidebar__summary {
  margin: 0;
  font-size: 0.78rem;
  color: var(--upm-muted);
  line-height: 1.35;
}
.upm-filters {
  padding: 10px 12px;
  border-bottom: 1px solid var(--upm-border);
  background: #fff;
  display: grid;
  gap: 8px;
}
.upm-seg {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%;
  padding: 3px;
  border: 1px solid var(--upm-border-strong);
  border-radius: 12px;
  background: #f3f6fb;
}
.upm-seg button {
  flex: 1 1 0;
  border: 0;
  background: transparent;
  border-radius: 9px;
  min-height: 36px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  color: #475467;
  cursor: pointer;
}
.upm-seg button:focus-visible {
  outline: 2px solid var(--upm-navy);
  outline-offset: 1px;
}
.upm-seg button.is-active[data-tx="rent"],
.upm-seg button.is-active[data-use="residential"] {
  background: #0ba360;
  color: #fff;
  box-shadow: 0 4px 10px rgba(11, 163, 96, 0.22);
}
.upm-seg button.is-active[data-tx="sale"] {
  background: var(--upm-sale);
  color: #fff;
  box-shadow: 0 4px 10px rgba(29, 79, 145, 0.22);
}
.upm-seg button.is-active[data-tx="all"],
.upm-seg button.is-active[data-use="all"],
.upm-seg button.is-active[data-use="commercial"] {
  background: var(--upm-navy);
  color: #fff;
  box-shadow: 0 4px 10px rgba(6, 43, 91, 0.18);
}
.upm-field {
  display: grid;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #344054;
}
.upm-field select:not([data-pg-premium-select="1"]) {
  min-height: 42px;
  border: 1px solid var(--upm-border-strong);
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 550;
  color: #222;
  background: #fff;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23475467' d='M1.1 1.2 6 6.1l4.9-4.9 1.1 1.1L6 8.2.0 2.3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.upm-field select:not([data-pg-premium-select="1"]):focus {
  outline: none;
  border-color: rgba(6, 43, 91, 0.45);
  box-shadow: 0 0 0 3px rgba(6, 43, 91, 0.12);
}
/* Premium Area control: allow open menu to escape filter rail; fixed coords via JS. */
.upm-filters {
  overflow: visible;
}
.upm-field .listing-custom-select.is-open {
  z-index: 80;
}
.upm-rail-preview {
  margin: 0 0 10px;
}
.upm-rail-preview__copy {
  margin: 6px 0 8px;
  font-size: 0.7rem;
  line-height: 1.4;
  opacity: 0.88;
}
.upm-rail-preview__check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.74rem;
  color: #ffe6b0;
  line-height: 1.35;
}
.upm-gate-note {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--upm-muted);
  line-height: 1.4;
}
.upm-filters .upm-gate-note { margin: 0; }
.upm-location {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  overflow: visible;
}
.upm-location.is-active {
  /* Mode chrome only — picker stays in the filter rail. */
}
.upm-location .upm-field {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--upm-navy);
  position: relative;
  overflow: visible;
}
.upm-location .upm-field select:not([data-pg-premium-select="1"]) {
  width: 100%;
  min-height: 40px;
  margin: 0;
  border: 1px solid var(--upm-border-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--upm-ink, #101828);
  font: inherit;
}
/* Compact premium Location picker (reuses Near picker visual contract) */
.upm-location .upm-location-picker,
.upm-location .listing-custom-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.upm-location .listing-custom-select.is-open {
  z-index: 90;
}
/* Beat .upm-filters .listing-custom-select padding-inline (13px) from pg-premium-select.css
   so the absolute pin (left 12 / 14px wide) never overlaps locality text. */
.upm-filters .upm-location .listing-custom-select .custom-select-trigger,
.upm-location .listing-custom-select.upm-location-picker .custom-select-trigger,
.upm-location .listing-custom-select .custom-select-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  /* pin column ≈ 12 + 14 + 10 gap; keep 34px for chevron */
  padding: 0 34px 0 38px;
  padding-inline: 38px 34px;
  box-sizing: border-box;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--heading, #101828);
  background: #fff;
  border: 1px solid var(--border, #d0d5dd);
  border-radius: 10px;
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(16, 24, 40, 0.05));
  position: relative;
}
.upm-filters .upm-location .listing-custom-select .custom-select-trigger::before,
.upm-location .listing-custom-select.upm-location-picker .custom-select-trigger::before,
.upm-location .listing-custom-select .custom-select-trigger::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background-color: #0ba360;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6a2.5 2.5 0 0 1 0 5.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6a2.5 2.5 0 0 1 0 5.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}
.upm-filters .upm-location .listing-custom-select .custom-select-trigger span,
.upm-location .listing-custom-select.upm-location-picker .custom-select-trigger span,
.upm-location .listing-custom-select .custom-select-trigger span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.upm-location .listing-custom-select .custom-select-trigger span::before {
  display: none;
}
.upm-location .listing-custom-select .custom-select-menu {
  max-height: 240px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border, #d0d5dd);
  background: #fff;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.14);
  z-index: 90;
}
.upm-location .listing-custom-select .pg-premium-select__options {
  max-height: 176px;
  overflow: auto;
  overscroll-behavior: contain;
}
.upm-location .listing-custom-select .custom-select-menu button[role="option"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  text-align: left;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--heading, #101828);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}
.upm-location .listing-custom-select .custom-select-menu button[role="option"]:hover,
.upm-location .listing-custom-select .custom-select-menu button[role="option"].is-keyboard-focus,
.upm-location .listing-custom-select .custom-select-menu button[role="option"]:focus-visible {
  outline: none;
  background: rgba(11, 163, 96, 0.1);
}
.upm-location .listing-custom-select .custom-select-menu button[role="option"].is-selected {
  background: rgba(11, 163, 96, 0.14);
  color: #067647;
  padding-right: 28px;
}
.upm-location .listing-custom-select .custom-select-menu button[role="option"].is-selected::after {
  content: "";
  position: absolute;
  right: 10px;
  width: 12px;
  height: 12px;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m5 12 4 4 10-10'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m5 12 4 4 10-10'/%3E%3C/svg%3E") center / contain no-repeat;
}
.upm-location__modes,
.upm-location__radios {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--upm-ink, #101828);
}
.upm-location__legend {
  width: 100%;
  margin: 0 0 2px;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--upm-navy);
}
.upm-location__mode,
.upm-location__radio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid var(--upm-border);
  border-radius: 999px;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.upm-location__mode:has(input:checked),
.upm-location__radio:has(input:checked) {
  border-color: #0ba360;
  background: rgba(11, 163, 96, 0.1);
  color: #067647;
}
.upm-location__mode input,
.upm-location__radio input {
  margin: 0;
}
.upm-location__disclaimer {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--upm-muted);
}
.upm-location__clear {
  width: 100%;
}
.upm-filters .upm-gate-note {
  margin-top: 2px;
}
.upm-results {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.upm-results__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--upm-border);
  background: #fff;
}
.upm-results__count {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 650;
}
.upm-results__meta {
  margin: 0;
  font-size: 0.7rem;
  color: var(--upm-muted);
}
.upm-list {
  flex: 1;
  overflow: auto;
  padding: 8px 10px 12px;
  /* Flex column (not grid): button/card intrinsic height collapsed to 2px under grid rows. */
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-content: start;
  /* Reserve card-plane height before JS replaces the SSR shell. */
  min-height: 280px;
}
.upm-list[aria-busy="true"] {
  min-height: 320px;
}
.upm-list-shell {
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  min-height: 240px;
  margin: 0;
  padding: 16px 12px;
  border: 1px dashed var(--upm-border-strong);
  border-radius: 12px;
  background: #f8fafc;
}
.upm-list-shell__copy {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--upm-muted);
  text-align: center;
}
/* Map plane: reserved fill colour already; keep absolute host from collapsing. */
.upm-live .upm-map-wrap {
  background: #dfe7f3;
}
.upm-live #upm-map {
  min-height: 100%;
}
.upm-filter-empty {
  padding: 14px 12px;
  border: 1px dashed var(--upm-border, #d7dee8);
  border-radius: 12px;
  background: #f8fafc;
}
.upm-filter-empty__copy {
  margin: 0 0 10px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--upm-muted, #5b6470);
}
.upm-filter-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.upm-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 1px solid var(--upm-border);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
  /* overflow:hidden collapses grid-item intrinsic height to borders-only in this shell */
  overflow: visible;
  height: auto;
  min-height: max-content;
  align-self: start;
  box-shadow: 0 1px 2px rgba(6, 43, 91, 0.04);
}
.upm-card:hover { border-color: rgba(11, 163, 96, 0.4); }
.upm-card.is-selected {
  border-color: var(--upm-rent);
  box-shadow: 0 0 0 2px rgba(11, 163, 96, 0.18);
}
.upm-card.is-sale:hover { border-color: rgba(6, 43, 91, 0.35); }
.upm-card.is-sale.is-selected {
  border-color: var(--upm-navy);
  box-shadow: 0 0 0 2px rgba(6, 43, 91, 0.16);
}
.upm-card.is-unmapped { border-style: dashed; }
.upm-card__focus {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 10px 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
  flex: 0 0 auto;
  min-height: 98px;
  box-sizing: border-box;
}
.upm-card__focus:focus-visible {
  outline: 2px solid var(--upm-navy);
  outline-offset: -2px;
}
.upm-card__media {
  width: 96px;
  height: 78px;
  border-radius: 10px;
  object-fit: cover;
  background: #e8edf5;
  display: block;
}
.upm-card__media--fallback {
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 650;
  color: #98a2b3;
  text-transform: uppercase;
}
.upm-card__body { min-width: 0; }
.upm-card__price {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--upm-rent);
  letter-spacing: -0.01em;
}
.upm-card.is-sale .upm-card__price { color: var(--upm-navy); }
.upm-card__price span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--upm-muted);
}
.upm-card__title {
  margin: 3px 0 4px;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.3;
  color: #152033;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.upm-card__meta {
  margin: 0;
  font-size: 0.7rem;
  color: var(--upm-muted);
  line-height: 1.35;
}
.upm-card__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.upm-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 10px 10px;
}
.upm-card__actions .bayut-card__fav {
  position: static;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: #fff;
  color: #667085;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}
.upm-card__actions .bayut-card__fav:hover {
  color: #0BA360;
  border-color: rgba(11, 163, 96, 0.35);
}
.upm-card__actions .bayut-card__fav.is-saved {
  color: #0BA360;
  border-color: rgba(11, 163, 96, 0.45);
  background: #edf9f3;
}
.upm-card.is-sale .upm-card__actions .bayut-card__fav:hover,
.upm-card.is-sale .upm-card__actions .bayut-card__fav.is-saved {
  color: #062B5B;
  border-color: rgba(6, 43, 91, 0.35);
  background: #EAF3FA;
}
.upm-card__actions .bayut-card__fav .icon,
.upm-card__actions .bayut-card__fav .rv-save-heart {
  width: 16px;
  height: 16px;
}
.upm-card__details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(11, 163, 96, 0.35);
  background: #edf9f3;
  color: #0a6b42;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.upm-card__details:hover { background: #dff3ea; color: #065c38; }
.upm-card__details:focus-visible {
  outline: 2px solid var(--upm-rent);
  outline-offset: 2px;
}
.upm-card__details--sale {
  border-color: rgba(6, 43, 91, 0.28);
  background: var(--upm-sale-soft);
  color: var(--upm-navy);
}
.upm-card__details--sale:hover { background: #dce6f4; }
.upm-card__details.is-disabled {
  border-color: var(--upm-border);
  background: #f5f7fb;
  color: #98a2b3;
  cursor: not-allowed;
}
.upm-list-more {
  display: grid;
  gap: 8px;
  padding: 4px 2px 8px;
  justify-items: stretch;
}
.upm-list-more__meta {
  margin: 0;
  font-size: 0.7rem;
  color: var(--upm-muted);
  text-align: center;
}
.upm-list-more__btn {
  width: 100%;
  justify-content: center;
}
.upm-tag {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e2f6ee;
  color: #0f5132;
}
.upm-tag--sale { background: var(--upm-sale-soft); color: var(--upm-navy); }
.upm-tag--muted { background: #f2f4f7; color: #475467; }
.upm-tag--warn { background: #fff7e8; color: #7a4d00; }
.upm-sidebar__foot {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--upm-border);
  background: #fff;
}
.upm-sidebar__foot p {
  margin: 0 0 6px;
  font-size: 0.72rem;
  color: var(--upm-muted);
}
.upm-sidebar__foot a {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--upm-navy);
}

.upm-map-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #dfe7f3;
}
#upm-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.leaflet-container { width: 100%; height: 100%; font: inherit; }
.upm-map-tools {
  position: absolute;
  top: 12px;
  left: 52px;
  z-index: 650;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.upm-map-tools > * { pointer-events: auto; }
.upm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.35rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--upm-border-strong);
  background: rgba(255,255,255,0.96);
  color: #344054;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}
.upm-btn--ghost:hover { border-color: rgba(6,43,91,0.35); }
.upm-legend {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 650;
  display: grid;
  grid-template-columns: auto auto;
  gap: 6px 12px;
  max-width: min(240px, calc(100% - 72px));
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--upm-border-strong);
  box-shadow: 0 8px 18px rgba(10,16,32,0.08);
  font-size: 0.72rem;
  font-weight: 650;
  color: #344054;
  pointer-events: none;
}
.upm-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.upm-legend__item--approx {
  display: none; /* single approx note lives under the map */
}
.upm-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.upm-swatch--rent { background: var(--upm-rent); }
.upm-swatch--sale { background: var(--upm-sale); }
.upm-glyph {
  width: 14px;
  text-align: center;
  color: var(--upm-navy);
}
.upm-selection {
  position: absolute;
  left: 12px;
  top: 84px;
  z-index: 640;
  width: min(300px, calc(100% - 96px));
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.97);
  border: 1px solid var(--upm-border-strong);
  box-shadow: 0 10px 22px rgba(10,16,32,0.1);
}
.upm-selection[hidden] { display: none !important; }
.upm-selection__title {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--upm-navy);
}
.upm-selection__copy {
  margin: 0;
  font-size: 0.72rem;
  color: var(--upm-muted);
  line-height: 1.4;
}
.upm-map-disclaimer {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 500;
  margin: 0;
  max-width: min(420px, calc(100% - 24px));
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--upm-border);
  font-size: 0.7rem;
  color: var(--upm-muted);
  line-height: 1.35;
  pointer-events: none;
}

/* Compact locality markers — readable at default Colombo overview. */
.upm-cluster-icon { background: transparent; border: 0; }
.upm-cluster {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--upm-navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 750;
  border: 2px solid #fff;
  box-shadow: 0 6px 14px rgba(6,43,91,0.26);
  position: relative;
}
.upm-cluster--rent { background: var(--upm-rent); }
.upm-cluster--sale { background: var(--upm-sale); }
.upm-cluster--mixed {
  background: linear-gradient(135deg, var(--upm-rent) 50%, var(--upm-sale) 50%);
}
.upm-cluster.is-selected {
  transform: scale(1.14);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.95), 0 0 0 6px rgba(6,43,91,0.35), 0 10px 18px rgba(6,43,91,0.28);
  z-index: 2;
}
.upm-cluster.is-aggregate {
  box-shadow: 0 6px 14px rgba(6,43,91,0.3), inset 0 0 0 2px rgba(255,255,255,0.35);
}
.upm-cluster__glyph {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  color: var(--upm-navy);
  font-size: 0.62rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--upm-border-strong);
  box-shadow: 0 2px 6px rgba(10,16,32,0.12);
}
.upm-cluster-tooltip {
  font-family: var(--upm-font);
  font-size: 0.72rem;
  font-weight: 650;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--upm-border-strong);
  box-shadow: 0 6px 14px rgba(10,16,32,0.12);
  max-width: 220px;
  white-space: pre-line;
  line-height: 1.35;
  pointer-events: none;
}
/* Never keep locality captions as permanent map chrome. */
.leaflet-tooltip.upm-cluster-tooltip.leaflet-tooltip-permanent {
  display: none !important;
}

@media (max-width: 1180px) {
  .upm-app { grid-template-columns: 220px minmax(0, 1fr); }
  :root { --upm-sidebar: 340px; }
}
@media (max-width: 1024px) {
  .upm-app { grid-template-columns: 1fr; height: 100vh; }
  .upm-rail { max-height: 140px; }
  .upm-shell { grid-template-columns: 300px minmax(0, 1fr); }
}

/* Live integration: no prototype rail; shell fills page under PropGlen header */
.upm-live .upm-rail { display: none !important; }
.upm-live .upm-app { grid-template-columns: minmax(0, 1fr); }
.upm-live .upm-stage {
  padding: 4px 10px 10px;
  height: 100%;
  min-height: 0;
  gap: 4px;
}
.upm-live .upm-stage__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  min-height: 32px;
  flex: 0 0 auto;
}
.upm-live .upm-shell {
  /* Must fill stage flex area — never grow with the listing list
     (that stretched Leaflet and painted Tamil Nadu at zoom 11). */
  flex: 1 1 auto;
  min-height: 0;
  height: 0; /* flex child fill trick with min-height:0 */
}
.upm-live .upm-map-wrap {
  min-height: 0;
  height: 100%;
  min-width: 0;
}
.upm-live .upm-map-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.upm-live .upm-btn--primary {
  background: var(--upm-navy);
  color: #fff;
  border: 1px solid var(--upm-navy);
}
.upm-live .upm-btn--primary[hidden],
.upm-live .upm-btn--ghost[hidden] { display: none !important; }
.upm-live .upm-map-disclaimer {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 620;
  margin: 0;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--upm-border);
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--upm-muted);
  pointer-events: none;
}
@media (max-width: 900px) {
  body.upm-map-body { overflow: auto; }
  .upm-live {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .upm-live .upm-app {
    height: auto;
    max-height: none;
  }
  .upm-live .upm-stage {
    height: auto;
    overflow: visible;
  }
  .upm-live .upm-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(52vh, 58vh) minmax(280px, auto);
    height: auto;
  }
  .upm-live .upm-map-wrap {
    order: -1;
    min-height: 52vh;
    height: 52vh;
  }
  .upm-live .upm-sidebar {
    max-height: none;
    min-height: 0;
    overflow: auto;
  }
  .upm-live .upm-results {
    flex: 1 1 auto;
    min-height: 180px;
  }
  .upm-live .upm-list {
    flex: 1 1 auto;
    min-height: 160px;
    max-height: 42vh;
  }
  .upm-live .upm-filters { padding-bottom: 6px; }
  .upm-seg { flex-wrap: wrap; }
}
