* { box-sizing: border-box; }
body.buyer-map {
  margin: 0;
  background: var(--bg, #f5f7fb);
  color: var(--text, #1f2937);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: inherit;
}
.buyer-map #map { position: fixed; inset: 0; }
.buyer-map :is(header, footer) {
  position: fixed;
  z-index: 1000;
  left: 12px;
  right: 12px;
  max-width: 540px;
  margin: auto;
  padding: 16px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d8dee8);
  border-radius: 10px;
  box-shadow: 0 5px 24px rgba(15, 31, 60, .08);
}
.buyer-map header { top: max(12px, env(safe-area-inset-top)); }
.buyer-map footer { bottom: max(12px, env(safe-area-inset-bottom)); }
.buyer-map .brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.buyer-map .brand a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  color: var(--accent, #006aff);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.5px;
  text-decoration: none;
}
.buyer-map .brand svg { width: 28px; height: 28px; }
.buyer-map .brand span { font-size: 12px; color: var(--muted, #596579); }
.buyer-map h1 { color: var(--heading, #111827); font-size: 23px; letter-spacing: -.6px; line-height: 1.2; margin: 8px 0 6px; }
.buyer-map p { font-size: 13px; line-height: 1.45; margin: 0 0 12px; color: var(--muted, #596579); }
.buyer-map form {
  display: flex;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 10px;
  background: var(--surface, #fff);
}
.buyer-map :is(input, select, button) {
  font: inherit;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text, #1f2937);
}
.buyer-map input { min-width: 0; flex: 1; padding: 8px; font-size: 16px; }
.buyer-map input::placeholder { color: var(--muted, #596579); opacity: 1; }
.buyer-map select { max-width: 85px; padding: 8px 4px; font-size: 14px; }
.buyer-map button { cursor: pointer; padding: 8px 12px; color: var(--accent, #006aff); font-size: 13px; font-weight: 600; }
.buyer-map button:disabled { opacity: .45; cursor: default; }
.buyer-map :is(a, input, select, button):focus-visible { outline: 3px solid var(--focus, #006aff); outline-offset: 2px; }
.buyer-map #results { max-height: 160px; overflow: auto; }
.buyer-map #results button { display: block; width: 100%; text-align: left; border-bottom: 1px solid var(--border, #d8dee8); border-radius: 0; }
.buyer-map #results button:hover { background: var(--surface2, #f0f5ff); }
.buyer-map .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.buyer-map .meta strong { font-size: 14px; color: var(--heading, #111827); }
.buyer-map .meta span { font-size: 11px; color: var(--muted, #596579); }
.buyer-map #status { margin: 8px 0; min-height: 19px; }
.buyer-map .tools { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.buyer-map .tools button { background: var(--surface2, #f0f5ff); border-radius: 10px; flex: 1; padding: 8px 5px; }
.buyer-map #save {
  width: 100%;
  background: var(--accent-fill, #006aff);
  color: #fff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 650;
  min-height: 48px;
}
.buyer-map #save:hover:enabled { background: var(--accent-hover, #0052c7); }
.buyer-map .leaflet-control-zoom { display: none; }
.buyer-map .leaflet-control-attribution { font-size: 10px !important; }
.buyer-map .leaflet-bottom { bottom: 220px; }
@media (min-width: 700px) {
  .buyer-map header { right: auto; width: 350px; margin: 0; }
  .buyer-map footer { left: auto; width: 350px; margin: 0; }
}
@media (max-width: 360px) {
  .buyer-map :is(header, footer) { left: 8px; right: 8px; padding: 12px; }
  .buyer-map .meta span { font-size: 10px; }
}

/* Public /map: the map/list split and its height observer remain unchanged. */
body.hatuli-site .filterbar {
  background: var(--surface);
  padding-block: 12px;
  box-shadow: 0 2px 6px rgba(15, 31, 60, .04);
}
body.hatuli-site :is(.hatuli-catalog-nav, .filterbar-inner) {
  max-width: 1450px;
  margin-inline: auto;
  gap: 8px;
}
body.hatuli-site .hatuli-catalog-nav { margin-bottom: 10px; }
body.hatuli-site .hatuli-catalog-nav a {
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
body.hatuli-site .filterbar :is(select, input[type="number"], .rooms-dd-btn, .more-filters-btn, #f-newbuild-btn) {
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 8px !important;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}
body.hatuli-site .filterbar :is(select, .rooms-dd-btn, .more-filters-btn):hover {
  border-color: var(--accent);
  background: var(--surface2);
}
body.hatuli-site .filterbar #f-newbuild-btn[data-active="true"],
body.hatuli-site .filterbar .year-chip.active {
  background: var(--accent-fill, #006aff) !important;
  border-color: var(--accent-fill, #006aff) !important;
  color: #fff !important;
}
body.hatuli-site .filterbar .heat-dd-btn-tint { background: var(--surface2); }
body.hatuli-site .rooms-dd-panel {
  max-width: calc(100vw - 32px);
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(15, 31, 60, .16);
}
body.hatuli-site .rooms-dd-panel label { min-height: 40px; }
body.hatuli-site #side-panel {
  width: 420px;
  min-width: 0;
  background: var(--bg);
  box-shadow: -2px 0 8px rgba(15, 31, 60, .04);
}
body.hatuli-site #side-panel-head {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--heading);
}
body.hatuli-site #side-panel-count { font-size: 18px !important; letter-spacing: -.35px; }
body.hatuli-site #side-panel-body {
  min-width: 0;
  padding: 14px 14px 28px;
  gap: 14px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
body.hatuli-site #side-panel-body .side-card {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(15, 31, 60, .09);
  transition: box-shadow .16s, border-color .16s;
}
body.hatuli-site #side-panel-body .side-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 4px 14px rgba(15, 31, 60, .13);
}
body.hatuli-site #side-panel-body .side-card-selected {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
body.hatuli-site #side-panel-body .hatuli-card-media {
  aspect-ratio: 16 / 10;
  margin: 0;
  border-radius: 9px 9px 0 0;
  background: var(--surface2);
}
/* Contain preserves the complete source photograph, including portrait shots. */
body.hatuli-site #side-panel-body .hatuli-card-media > img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
body.hatuli-site #side-panel-body .hatuli-card-media > button {
  width: 32px !important;
  height: 32px !important;
  font-size: 22px !important;
  background: rgba(17, 24, 39, .62) !important;
}
body.hatuli-site #side-panel-body .hatuli-side-body { padding: 14px !important; }
body.hatuli-site #side-panel-body .hatuli-side-facts { gap: 8px !important; }
body.hatuli-site #side-panel-body .hatuli-side-price {
  flex-basis: calc(100% - 36px);
  min-width: 0;
  color: var(--heading);
  font-size: 24px !important;
  line-height: 1.2 !important;
  letter-spacing: -.65px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}
body.hatuli-site #side-panel-body .hatuli-side-fact {
  padding: 2px 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--text) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}
body.hatuli-site #side-panel-body .hatuli-side-location {
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere;
  text-overflow: clip !important;
  font-size: 13px !important;
  line-height: 1.55;
  margin-top: 10px !important;
}
body.hatuli-site #side-panel-body .hatuli-side-location a { text-decoration: none; }
body.hatuli-site #side-panel-body .hatuli-side-location a:hover { text-decoration: underline; }
body.hatuli-site #mobile-view-toggle {
  background: var(--accent-fill, #006aff) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 16px rgba(15, 31, 60, .25) !important;
}
body.hatuli-site #detail-modal-box { color: var(--text); }
body.hatuli-site #detail-modal-content { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 1400px) {
  body.hatuli-site #side-panel { width: min(52vw, 740px); }
  body.hatuli-site #side-panel-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) and (max-width: 1000px) {
  body.hatuli-site #side-panel { width: 350px; }
}
@media (max-width: 767px) {
  body.hatuli-site .filterbar { padding-inline: 16px; padding-block: 9px; }
  body.hatuli-site .filterbar-inner { gap: 7px; flex-wrap: wrap; }
  body.hatuli-site .filterbar .rooms-dd { position: static; }
  body.hatuli-site .filterbar .rooms-dd-panel {
    top: calc(100% + 1px);
    left: 12px !important;
    right: 12px !important;
    min-width: 0;
    width: auto;
    max-width: none;
    max-height: 55vh;
    overflow: auto;
  }
  body.hatuli-site .filterbar .heat-btn-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none !important;
    grid-auto-flow: row !important;
    width: 100% !important;
  }
  body.hatuli-site .filterbar .heat-btn { white-space: normal !important; }
  body.hatuli-site #side-panel { width: 100%; }
  body.hatuli-site #side-panel-body { padding: 12px 14px 82px; }
  body.hatuli-site #side-panel-head { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  body.hatuli-site #side-panel-body .side-card { transition: none; }
}
