:root {
  --ink: #181612;
  --muted: #6f675d;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --line: #ddd8cf;
  --field: #f3f0e8;
  --coral: #d94f35;
  --coral-dark: #9f301f;
  --green: #047a65;
  --blue: #2d589f;
  --gold: #d9a21f;
  --shadow: 0 18px 48px rgba(42, 35, 26, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(217, 79, 53, 0.09) 1px, transparent 1px),
    linear-gradient(180deg, rgba(4, 122, 101, 0.08) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  padding: 42px clamp(18px, 4vw, 56px) 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.88);
  backdrop-filter: blur(16px);
}

.header-copy {
  max-width: 760px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--coral-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-family: Charter, Georgia, serif;
  font-size: clamp(2.35rem, 6vw, 5.8rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0;
}

.brief {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.5;
}

.header-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  gap: 1px;
  overflow: hidden;
  min-width: min(610px, 100%);
  border: 1px solid var(--ink);
  background: var(--ink);
  box-shadow: var(--shadow);
}

.header-stats div {
  min-height: 104px;
  padding: 18px;
  background: var(--panel);
}

.header-stats strong {
  display: block;
  font-family: Charter, Georgia, serif;
  font-size: 2.1rem;
  line-height: 1;
}

.header-stats span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
}

main {
  padding: 22px clamp(18px, 4vw, 56px) 48px;
}

.controls-band {
  display: grid;
  grid-template-columns: minmax(390px, 1.4fr) minmax(140px, 0.45fr) minmax(170px, 0.7fr) minmax(190px, 0.8fr) minmax(140px, 0.5fr);
  gap: 14px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.control-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.control-group.compact {
  min-width: 172px;
}

.label,
.signal {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  border: 1px solid var(--ink);
  background: var(--ink);
  gap: 1px;
}

.segmented.wide {
  grid-template-columns: 0.5fr 0.62fr 0.98fr 1.22fr 0.8fr;
}

.segmented button {
  min-height: 44px;
  border: 0;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.segmented button.active {
  background: var(--ink);
  color: var(--panel);
}

input[type="search"],
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--field);
  color: var(--ink);
  padding: 0 12px;
  outline-color: var(--green);
}

.rent-control {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 12px;
}

.rent-control .label {
  grid-column: 1 / -1;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--coral);
}

output {
  min-width: 52px;
  color: var(--coral-dark);
  font-weight: 900;
  text-align: right;
}

.preference-control {
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.85fr);
  grid-column: span 2;
  align-items: end;
  align-self: stretch;
}

.preference-control .label {
  align-self: center;
}

.check-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--field);
  padding: 0 10px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.check-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 18px 0 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.insight-strip div {
  min-width: 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.insight-strip strong {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  font-size: 1.02rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-section {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.map-copy {
  display: grid;
  align-content: space-between;
  gap: 18px;
  min-height: 430px;
  padding: 20px;
  background: var(--ink);
  color: var(--panel);
}

.map-copy h2 {
  margin: 0;
  font-family: Charter, Georgia, serif;
  font-size: 2.2rem;
  letter-spacing: 0;
}

.map-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.45;
}

.map-shell {
  position: relative;
  min-height: 430px;
  background: #f8f2e6;
}

.fallback-map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(24, 22, 18, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(24, 22, 18, 0.07) 1px, transparent 1px),
    radial-gradient(circle at 42% 56%, rgba(45, 88, 159, 0.12), transparent 34%),
    #f8f2e6;
  background-size: 34px 34px, 34px 34px, auto, auto;
}

.maplibre-ready .fallback-map {
  display: none;
}

.fallback-marker {
  position: absolute;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--ink);
  color: var(--panel);
  box-shadow: 0 7px 18px rgba(24, 22, 18, 0.22);
  font-size: 0.74rem;
  font-weight: 900;
  text-decoration: none;
  transform: translate(-50%, -50%);
}

.marker-aecs-brookefield {
  background: var(--green);
}

.marker-marathahalli {
  background: var(--coral);
}

.marker-kadubeesanahalli {
  background: var(--blue);
}

.marker-bellandur {
  background: var(--gold);
}

.maplibregl-popup-content {
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(24, 22, 18, 0.26);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.maplibregl-popup-content strong,
.maplibregl-popup-content span,
.maplibregl-popup-content a {
  display: block;
}

.maplibregl-popup-content strong {
  max-width: 240px;
  margin-bottom: 6px;
  font-family: Charter, Georgia, serif;
  line-height: 1.08;
}

.maplibregl-popup-content span {
  margin-bottom: 10px;
  color: var(--muted);
}

.maplibregl-popup-content a {
  color: var(--coral-dark);
  font-weight: 900;
}

.results-head {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.results-head h2 {
  margin: 0;
  font-family: Charter, Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: 0;
}

.results-head p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  text-align: right;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(328px, 1fr));
  gap: 18px;
}

.listing-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(42, 35, 26, 0.08);
}

.media-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(135deg, rgba(4, 122, 101, 0.22), rgba(217, 79, 53, 0.18)),
    var(--field);
}

.media-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}

.media-link:hover img {
  transform: scale(1.035);
}

.bhk-pill,
.rank {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.bhk-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--ink);
  color: var(--panel);
}

.card-body {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.title-row h3 {
  margin: 0;
  font-family: Charter, Georgia, serif;
  font-size: 1.28rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.rank {
  background: rgba(4, 122, 101, 0.12);
  color: var(--green);
}

.address {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.facts div {
  min-width: 0;
  padding: 10px;
  background: var(--paper);
}

.facts dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.facts dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 900;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 30px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--field);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.pet-note {
  min-height: 38px;
  margin: 0;
  border-left: 3px solid var(--gold);
  padding-left: 10px;
  color: var(--muted);
  line-height: 1.35;
}

.env-note {
  min-height: 38px;
  margin: 0;
  border-left: 3px solid var(--green);
  padding-left: 10px;
  color: var(--muted);
  line-height: 1.35;
}

.card-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--ink);
  padding: 0 13px;
  background: var(--ink);
  color: var(--panel);
  font-weight: 900;
  text-decoration: none;
}

.primary-link:hover {
  background: var(--coral-dark);
  border-color: var(--coral-dark);
}

.available {
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: right;
}

.empty-state {
  border: 1px solid var(--line);
  padding: 32px;
  background: var(--panel);
  text-align: center;
}

footer {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 56px) 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

footer a {
  color: var(--coral-dark);
  font-weight: 900;
}

.detail-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  padding: 28px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.92);
}

.detail-header h1 {
  max-width: 920px;
  margin-bottom: 10px;
  font-size: clamp(2rem, 4.5vw, 4.7rem);
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--ink);
  padding: 0 12px;
  background: var(--panel);
  font-weight: 900;
  text-decoration: none;
}

.detail-actions {
  display: flex;
  align-items: start;
}

.detail-main {
  padding-top: 26px;
}

.detail-gallery {
  margin-bottom: 28px;
}

.photo-rail {
  display: grid;
  grid-template-columns: minmax(320px, 1.4fr) repeat(2, minmax(180px, 0.8fr));
  grid-auto-rows: minmax(180px, 28vw);
  gap: 12px;
}

.photo-rail figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--field);
}

.photo-rail figure:first-child {
  grid-row: span 2;
}

.photo-rail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-empty {
  border: 1px solid var(--line);
  padding: 28px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
}

.detail-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  padding: 18px;
}

.detail-panel-wide {
  grid-column: 1 / -1;
}

.detail-panel h2 {
  margin: 0 0 14px;
  font-family: Charter, Georgia, serif;
  font-size: 1.65rem;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.detail-facts div {
  min-width: 0;
  padding: 11px;
  background: var(--paper);
}

.detail-facts dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-facts dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-weight: 850;
  line-height: 1.35;
}

details {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 12px;
}

summary {
  cursor: pointer;
  font-weight: 900;
}

pre {
  overflow: auto;
  max-height: 520px;
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 0.78rem;
  white-space: pre-wrap;
}

@media (max-width: 940px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .header-stats {
    min-width: 0;
  }

  .controls-band {
    grid-template-columns: 1fr 1fr;
  }

  .area-control {
    grid-column: 1 / -1;
  }

  .map-section {
    grid-template-columns: 1fr;
  }

  .map-copy {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  body {
    background-size: 32px 32px;
  }

  .site-header {
    gap: 18px;
    padding: 24px 14px 18px;
  }

  h1 {
    font-size: clamp(2.15rem, 14vw, 3.45rem);
    line-height: 0.98;
  }

  .brief {
    font-size: 0.98rem;
  }

  .header-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-stats div {
    min-height: 78px;
    padding: 12px;
  }

  .header-stats strong {
    font-size: 1.55rem;
  }

  .header-stats span {
    margin-top: 7px;
    font-size: 0.7rem;
  }

  main {
    padding: 14px 14px 36px;
  }

  .controls-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
  }

  .area-control,
  .rent-control,
  .search-control,
  .preference-control {
    grid-column: 1 / -1;
  }

  .control-group.compact {
    min-width: 0;
  }

  .segmented {
    grid-template-columns: repeat(3, 1fr);
  }

  .segmented.wide {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .segmented.wide button {
    flex: 0 0 auto;
    min-width: 78px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .segmented.wide button[data-area="kadubeesanahalli"] {
    min-width: 146px;
  }

  .segmented button,
  input[type="search"],
  select {
    min-height: 40px;
  }

  .rent-control {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .preference-control {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .preference-control .label {
    grid-column: 1 / -1;
  }

  .check-control {
    min-height: 38px;
    padding: 0 8px;
    font-size: 0.75rem;
  }

  .insight-strip {
    display: flex;
    overflow-x: auto;
    margin: 14px 0 18px;
    -webkit-overflow-scrolling: touch;
  }

  .insight-strip div {
    flex: 0 0 220px;
    padding: 13px;
  }

  .map-shell {
    min-height: min(68vh, 380px);
  }

  .map-copy {
    padding: 14px;
  }

  .map-copy h2 {
    font-size: 1.65rem;
  }

  .results-head {
    display: block;
    margin-bottom: 12px;
  }

  .results-head p {
    margin-top: 8px;
    text-align: left;
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .listing-card {
    border-radius: 7px;
  }

  .media-link {
    aspect-ratio: 16 / 9;
  }

  .card-body {
    gap: 10px;
    padding: 12px;
  }

  .title-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .title-row h3 {
    font-size: 1.1rem;
  }

  .rank {
    justify-self: start;
  }

  .address,
  .pet-note,
  .env-note {
    min-height: 0;
  }

  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .facts div {
    padding: 8px;
  }

  .chips {
    overflow: hidden;
    max-height: 62px;
  }

  .pet-note {
    display: none;
  }

  .env-note {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .card-actions {
    display: grid;
    gap: 8px;
  }

  .primary-link {
    width: 100%;
  }

  .available {
    text-align: left;
  }

  footer {
    display: grid;
    padding: 16px 14px 28px;
  }

  .detail-header,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-header {
    gap: 14px;
    padding: 18px 14px;
  }

  .detail-header h1 {
    font-size: clamp(1.8rem, 10vw, 3rem);
  }

  .detail-actions {
    width: 100%;
  }

  .detail-main {
    padding: 14px 14px 36px;
  }

  .detail-gallery {
    margin: 0 -14px 18px 0;
  }

  .photo-rail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-right: 14px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .photo-rail figure {
    flex: 0 0 min(82vw, 330px);
    height: 220px;
    scroll-snap-align: start;
  }

  .photo-rail figure:first-child {
    grid-row: auto;
  }

  .detail-panel {
    padding: 14px;
  }

  .detail-panel h2 {
    font-size: 1.35rem;
  }

  .detail-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-panel:nth-child(3) .detail-facts,
  .detail-panel:nth-child(4) .detail-facts {
    grid-template-columns: 1fr;
  }
}
