:root {
  font-family: Inter, "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: #242927;
  background: #f8f7f3;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  font-weight: 400;
  --ink: #242927;
  --muted: #737873;
  --line: #e9e9e3;
  --paper: #fffefa;
  --canvas: #f8f7f3;
  --accent: #e46e58;
  --accent-dark: #c95543;
  --green: #567d60;
  --shadow: 0 12px 32px rgb(34 40 36 / 12%);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.site-header {
  position: relative;
  z-index: 4;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid #eeede7;
  background: var(--paper);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-family: Manrope, sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -1px;
  text-decoration: none;
}

.brand-neighbour {
  color: var(--accent);
}

.brand-domain {
  color: #777e78;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

.header-context {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #565c57;
  font-size: 13px;
  font-weight: 600;
}

.context-dot,
.caption-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.demo-label {
  padding: 4px 7px;
  border: 1px solid #ebd9b7;
  border-radius: 5px;
  background: #fff7e7;
  color: #8d6a26;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.about-link {
  color: var(--muted);
  font-size: 12px;
  text-decoration-color: #c4c6bf;
  text-underline-offset: 3px;
}

.about-link:hover {
  color: var(--ink);
}

.workspace {
  position: relative;
  height: calc(100dvh - 105px);
  min-height: 420px;
  overflow: hidden;
  background: #e9ebe5;
}

.map {
  position: absolute;
  inset: 0;
  background: #e9ebe5;
}

.map-loading,
.map-error {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 17px;
  transform: translate(-50%, -50%);
  border: 1px solid rgb(36 41 39 / 7%);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 13px;
}

.map-error {
  flex-direction: column;
  align-items: flex-start;
  color: var(--ink);
}

.map-error span {
  color: var(--muted);
}

.loading-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid #e8c5ba;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.explore-panel {
  position: absolute;
  z-index: 2;
  top: 22px;
  bottom: 22px;
  left: 22px;
  display: flex;
  width: min(365px, calc(100vw - 44px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgb(36 41 39 / 7%);
  border-radius: 17px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.search-panel {
  flex: 0 0 auto;
  padding: 22px 22px 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 17px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

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

h1,
h2 {
  font-family: Inter, "Avenir Next", Avenir, "Segoe UI", sans-serif;
  letter-spacing: -0.5px;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  font-weight: 700;
}

.heading-sparkle,
.result-decoration {
  color: var(--accent);
}

.heading-sparkle {
  padding-top: 5px;
  font-size: 21px;
}

.search-field {
  display: flex;
  height: 47px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid #dfe1da;
  border-radius: 10px;
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.search-field:focus-within {
  border-color: #dd9e8d;
  box-shadow: 0 0 0 3px rgb(228 110 88 / 12%);
}

.search-field svg {
  width: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: #777e78;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.search-field input::placeholder {
  color: #939891;
}

.search-help {
  margin: 7px 0 17px;
  color: #858a84;
  font-size: 10px;
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 11px;
  font-weight: 700;
}

.filter-hint {
  color: #8a8e88;
  font-size: 10px;
  font-weight: 500;
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid #e4e5df;
  border-radius: 999px;
  background: white;
  color: #626862;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.filter-chip:hover {
  border-color: #d7a396;
}

.filter-chip.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.results-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.results-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px 12px;
}

.results-heading h2 {
  margin-bottom: 3px;
  font-size: 15px;
  font-weight: 700;
}

.results-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 10px;
}

.result-decoration {
  padding-right: 1px;
  font-size: 16px;
}

.results-list {
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 12px 12px;
}

.property-row {
  display: flex;
  width: 100%;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid #f0f0eb;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 130ms ease, border-radius 130ms ease;
}

.property-row:hover,
.property-row:focus-visible {
  border-radius: 10px;
  background: #f8f7f3;
}

.property-thumb {
  display: grid;
  width: 54px;
  height: 50px;
  flex: 0 0 54px;
  place-items: center;
  border-radius: 9px;
  background: #f4e7dc;
  color: #986f58;
}

.property-thumb svg {
  width: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.property-thumb.tone-1 {
  background: #e9eee2;
  color: #698166;
}

.property-thumb.tone-2 {
  background: #e5ebed;
  color: #6a7c84;
}

.property-row-copy {
  min-width: 0;
  flex: 1;
}

.property-row-title {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-row-meta {
  display: block;
  color: #7d827c;
  font-size: 10px;
}

.property-row-price {
  align-self: flex-start;
  padding-top: 5px;
  color: var(--accent-dark);
  font-family: Inter, "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sample-note {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--line);
  color: #777c76;
  font-size: 9px;
  line-height: 1.5;
}

.sample-note span {
  color: #a17b3a;
  font-size: 11px;
}

.empty-state {
  margin: 10px 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.property-detail {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 0 22px 20px;
}

.back-button {
  margin: 0 0 18px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #656b65;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.back-button:hover {
  color: var(--accent-dark);
}

.detail-kicker {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.detail-title {
  margin: 0 0 5px;
  font-family: Inter, "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 20px;
  letter-spacing: -0.6px;
}

.detail-location {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.detail-price-label {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10px;
}

.detail-price {
  margin: 0 0 19px;
  color: var(--accent-dark);
  font-family: Inter, "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1.2px;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.detail-fact {
  padding: 11px 12px;
  border-radius: 9px;
  background: #f5f4ef;
}

.detail-fact dt {
  margin-bottom: 4px;
  color: #7d827c;
  font-size: 9px;
}

.detail-fact dd {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.detail-source {
  margin: 0;
  color: #777c76;
  font-size: 10px;
  line-height: 1.5;
}

.sale-marker {
  min-height: 34px;
  padding: 0 10px;
  border: 2px solid white;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 9px rgb(33 39 35 / 21%);
  color: #383d39;
  cursor: pointer;
  font-family: Inter, "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  transition: background 130ms ease, color 130ms ease, transform 130ms ease;
}

.sale-marker:hover,
.sale-marker:focus-visible,
.sale-marker.is-selected {
  z-index: 2;
  transform: scale(1.07);
  border-color: white;
  background: var(--accent);
  color: white;
}

.map-caption {
  position: absolute;
  right: 18px;
  bottom: 28px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgb(255 254 250 / 94%);
  box-shadow: 0 2px 8px rgb(35 42 37 / 12%);
  color: #555b56;
  font-size: 10px;
  font-weight: 600;
  pointer-events: none;
}

.caption-dot {
  width: 7px;
  height: 7px;
}

.site-footer {
  display: flex;
  height: 33px;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--paper);
  color: #888d87;
  font-size: 9px;
}

.maplibregl-ctrl-bottom-right {
  right: 12px;
  bottom: 27px;
}

.maplibregl-ctrl-attrib {
  font-size: 9px !important;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgb(228 110 88 / 55%);
  outline-offset: 2px;
}

@media (min-width: 1100px) {
  .explore-panel {
    width: 370px;
  }
}

@media (max-width: 700px) {
  body {
    overflow: hidden;
  }

  .site-header {
    height: calc(62px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(17px, env(safe-area-inset-right)) 0
      max(17px, env(safe-area-inset-left));
  }

  .brand {
    gap: 7px;
    font-size: 17px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .header-context {
    gap: 6px;
    font-size: 11px;
  }

  .demo-label {
    padding: 3px 5px;
    font-size: 8px;
  }

  .about-link {
    display: none;
  }

  .workspace {
    height: calc(100dvh - 62px - env(safe-area-inset-top));
    min-height: 380px;
  }

  .explore-panel {
    display: contents;
  }

  .search-panel {
    position: absolute;
    z-index: 2;
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    left: max(10px, env(safe-area-inset-left));
    padding: 14px;
    border: 1px solid rgb(36 41 39 / 7%);
    border-radius: 14px;
    background: var(--paper);
    box-shadow: 0 5px 18px rgb(34 40 36 / 12%);
  }

  .panel-heading {
    align-items: center;
    margin-bottom: 10px;
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 8px;
  }

  h1 {
    font-size: 18px;
  }

  .heading-sparkle {
    padding: 0 4px 0 0;
    font-size: 17px;
  }

  .search-field {
    height: 42px;
  }

  .search-help {
    margin: 5px 0 11px;
    font-size: 9px;
  }

  .filter-heading {
    margin-bottom: 7px;
    font-size: 10px;
  }

  .filter-chip {
    min-height: 33px;
    padding: 0 9px;
    font-size: 9px;
  }

  .results-panel {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(34dvh, 300px);
    border: 1px solid rgb(36 41 39 / 7%);
    border-bottom: 0;
    border-radius: 17px 17px 0 0;
    background: var(--paper);
    box-shadow: 0 -7px 24px rgb(34 40 36 / 12%);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .results-heading {
    padding: 12px 18px 9px;
  }

  .results-heading h2 {
    font-size: 14px;
  }

  .results-heading p {
    font-size: 9px;
  }

  .results-list {
    padding: 0 10px 6px;
  }

  .property-row {
    min-height: 67px;
    gap: 10px;
    padding: 8px;
  }

  .property-thumb {
    width: 45px;
    height: 43px;
    flex-basis: 45px;
  }

  .property-row-title {
    font-size: 11px;
  }

  .property-row-meta,
  .property-row-price {
    font-size: 9px;
  }

  .sample-note {
    padding: 8px 14px 9px;
    font-size: 8px;
  }

  .property-detail {
    padding: 0 18px 14px;
  }

  .back-button {
    margin-bottom: 11px;
    font-size: 10px;
  }

  .detail-title {
    font-size: 18px;
  }

  .detail-location {
    margin-bottom: 12px;
    font-size: 11px;
  }

  .detail-price {
    margin-bottom: 12px;
    font-size: 25px;
  }

  .detail-facts {
    gap: 6px;
    margin-bottom: 10px;
  }

  .detail-fact {
    padding: 8px 10px;
  }

  .detail-fact dt {
    margin-bottom: 2px;
    font-size: 8px;
  }

  .detail-fact dd {
    font-size: 10px;
  }

  .detail-source {
    font-size: 9px;
  }

  .map-caption {
    right: 10px;
    bottom: calc(min(34dvh, 300px) + 10px);
    padding: 6px 8px;
    font-size: 9px;
  }

  .maplibregl-ctrl-top-right {
    top: 215px;
    right: 10px;
  }

  .maplibregl-ctrl-bottom-right {
    right: 7px;
    bottom: calc(min(34dvh, 300px) + 6px);
  }

  .maplibregl-ctrl-group button {
    width: 34px;
    height: 34px;
  }

  .site-footer {
    display: none;
  }
}

@media (max-width: 370px) {
  .search-panel {
    padding: 11px;
  }

  .filter-list {
    gap: 4px;
  }

  .filter-chip {
    padding: 0 7px;
    font-size: 8px;
  }

  .maplibregl-ctrl-top-right {
    top: 205px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
