:root {
  --surface: rgba(255, 250, 243, 0.88);
  --ink: #1c1512;
  --muted: #5b4f49;
  --line: rgba(64, 38, 26, 0.14);
  --accent: #8a4b3a;
  --accent-dark: #5d2d25;
  --shadow: 0 24px 70px rgba(71, 42, 27, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(248, 242, 234, 0.9), rgba(241, 233, 223, 0.9)),
    linear-gradient(135deg, rgba(255, 252, 247, 0.58), rgba(223, 204, 185, 0.42)),
    radial-gradient(circle at top right, rgba(181, 138, 82, 0.18), transparent 28%),
    radial-gradient(circle at bottom left, rgba(138, 75, 58, 0.16), transparent 24%),
    url("living-room-background.png") center center / cover fixed no-repeat;
}

.map-page-shell {
  width: min(1720px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.map-topbar, .map-hero, .map-workspace { display: grid; gap: 20px; }
.map-topbar { grid-template-columns: 1fr auto; align-items: center; margin-bottom: 28px; }
.map-topbar-actions { display: flex; align-items: center; gap: 14px; }

.map-brand-block, .map-card, .map-summary-card, .map-hero-copy {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-brand-block, .map-card, .map-hero-copy { padding: 26px; }

.map-eyebrow, .map-kicker, .map-summary-card span, .map-chip, .map-form label span, .map-status-pill {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 800;
  color: #665852;
}

.map-brand-lockup { display: flex; align-items: center; gap: 16px; }
.map-brand-logo { width: 128px; height: auto; display: block; }
.map-brand-text, .map-hero-copy h1, .map-card-heading h2, .map-summary-card strong, .map-property-title, .map-detail-card h3 {
  font-family: "Cormorant Garamond", serif;
}
.map-brand-text { font-size: 2.2rem; font-weight: 700; }

.map-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.map-button-primary { background: var(--accent); color: #fffaf7; }
.map-button-primary:hover { background: var(--accent-dark); }
.map-button-secondary { background: rgba(255, 250, 242, 0.75); color: var(--ink); border-color: var(--line); }

.map-hero { grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr); align-items: stretch; }
.map-hero-copy h1 { margin: 0 0 12px; font-size: clamp(2.2rem, 4vw, 3.6rem); line-height: 1.06; max-width: 18ch; }
.map-hero-copy p, .map-inline-note, .map-empty-state, .map-property-subtitle { color: var(--muted); line-height: 1.6; }
.map-suggestions[hidden] { display: none; }
.map-suggestions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.map-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 24;
  margin-top: 0;
  padding: 10px;
  border: 1px solid rgba(64, 38, 26, 0.12);
  border-radius: 22px;
  background: rgba(255, 250, 244, 0.98);
  box-shadow: 0 18px 36px rgba(71, 42, 27, 0.16);
  backdrop-filter: blur(14px);
}
.map-suggestion-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}
.map-suggestion-button {
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border-radius: 18px;
  border: 1px solid rgba(64, 38, 26, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.map-suggestion-button:hover {
  border-color: rgba(138, 75, 58, 0.34);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(93, 45, 37, 0.07);
}

.map-hero-summary { display: grid; gap: 14px; }
.map-summary-card { padding: 20px 22px; }
.map-summary-card strong { display: block; margin-top: 8px; font-size: 2rem; }

.map-workspace { grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); align-items: start; }
.map-sidebar, .map-main { display: grid; gap: 20px; }
.map-card-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 18px; }
.map-card-heading h2 { margin: 0; font-size: 2rem; line-height: 1.08; }
.map-hover-readout {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.map-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.map-form label { display: grid; gap: 8px; }
.map-address-field {
  position: relative;
  z-index: 10;
}
.map-form input, .map-form select, .map-form textarea {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(64, 38, 26, 0.12);
  background: rgba(255, 255, 255, 0.8);
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
}
.map-form textarea { min-height: 120px; resize: vertical; }
.map-full { grid-column: 1 / -1; }
.map-address-actions { display: flex; align-items: end; }
.map-form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-start; }

.map-filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.map-chip { border: 1px solid var(--line); background: rgba(255, 252, 247, 0.86); border-radius: 999px; padding: 9px 14px; cursor: pointer; }
.map-chip.is-active { background: rgba(138, 75, 58, 0.12); color: #7a4335; }

.map-property-list { display: grid; gap: 12px; max-height: 560px; overflow-y: auto; }
.map-property-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(64, 38, 26, 0.12);
  background: rgba(255, 255, 255, 0.76);
  border-radius: 22px;
  padding: 16px 18px;
  cursor: pointer;
}
.map-property-item.is-selected { border-color: rgba(138, 75, 58, 0.34); box-shadow: 0 12px 24px rgba(93, 45, 37, 0.08); }
.map-property-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.map-property-title { margin: 0 0 6px; font-size: 1.45rem; }
.map-property-subtitle { margin: 0 0 12px; font-size: 0.95rem; }
.map-property-meta, .map-detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.map-property-remove {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 1px solid rgba(190, 86, 86, 0.22);
  border-radius: 999px;
  background: rgba(190, 86, 86, 0.12);
  color: #9e3636;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.map-property-remove:hover {
  background: rgba(190, 86, 86, 0.2);
  border-color: rgba(190, 86, 86, 0.34);
}

.map-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
}

.is-upcoming,
.map-status-pill.upcoming { background: #eee6da; color: #5f544b; }
.is-visited,
.map-status-pill.visited { background: #d9ead3; color: #355a33; }
.is-under-contract,
.map-status-pill.under-contract { background: #fff2cc; color: #6b5a1f; }
.is-do-not-go,
.map-status-pill.do-not-go { background: #f4cccc; color: #7a2d2d; }

.property-map {
  width: 100%;
  min-height: 760px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(64, 38, 26, 0.12);
}

.map-detail-card { min-height: 220px; }
.map-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.map-detail-field {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(64, 38, 26, 0.1);
  background: rgba(255, 255, 255, 0.66);
}
.map-detail-field span { display: block; margin-bottom: 6px; }
.map-detail-status-field {
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.9), rgba(238, 230, 218, 0.72));
  border-color: rgba(138, 75, 58, 0.16);
}
.map-detail-notes {
  margin: 18px 0;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(64, 38, 26, 0.1);
  background: rgba(255, 255, 255, 0.66);
  white-space: pre-wrap;
}
.map-detail-note-composer {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}
.map-detail-note-composer span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.map-detail-note-composer textarea {
  width: 100%;
  min-height: 104px;
  padding: 14px 16px;
  border: 1px solid rgba(64, 38, 26, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}
.map-detail-note-composer textarea:focus {
  outline: 2px solid rgba(205, 168, 83, 0.34);
  border-color: rgba(205, 168, 83, 0.46);
}
.map-saved-status-controls {
  margin: 0 0 18px;
}
.map-saved-status-controls > span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.map-preview-popup .map-saved-status-controls {
  margin: 12px 0 0;
}
.map-preview-popup .map-saved-status-controls .map-preview-actions {
  margin-bottom: 0;
}
.map-detail-copy {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}
.map-preview-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.map-preview-notes {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}
.map-preview-notes span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.map-preview-notes textarea {
  width: 100%;
  min-height: 118px;
  padding: 14px 16px;
  border: 1px solid rgba(64, 38, 26, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}
.map-preview-notes textarea:focus {
  outline: 2px solid rgba(205, 168, 83, 0.34);
  border-color: rgba(205, 168, 83, 0.46);
}
.map-status-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(64, 38, 26, 0.12);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.map-status-button.is-active {
  border-color: rgba(138, 75, 58, 0.34);
  background: rgba(138, 75, 58, 0.14);
  color: var(--accent-dark);
}
.map-preview-popup {
  min-width: 220px;
}
.map-preview-popup strong {
  display: block;
  margin-bottom: 10px;
  line-height: 1.35;
}
.map-saved-popup-status {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(138, 75, 58, 0.12);
  color: var(--accent-dark);
  font-weight: 800;
}
.map-saved-popup-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-wrap;
}
.map-preview-popup .map-preview-actions {
  margin-bottom: 12px;
}
.map-popup-save {
  width: 100%;
  min-height: 40px;
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: rgba(255, 250, 243, 0.96); }
.property-marker-house {
  position: relative;
  width: 34px;
  height: 40px;
  transform-origin: center bottom;
  filter: drop-shadow(0 10px 16px rgba(31, 22, 18, 0.2));
  transition: transform 160ms ease, filter 160ms ease;
}

.property-marker-house:hover,
.property-marker-house.is-selected {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 14px 20px rgba(31, 22, 18, 0.24));
}

.property-marker-roof,
.property-marker-body,
.property-marker-door,
.property-marker-chimney {
  position: absolute;
  display: block;
}

.property-marker-roof {
  left: 4px;
  top: 1px;
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-bottom: 15px solid #cda853;
}

.property-marker-body {
  left: 7px;
  top: 14px;
  width: 20px;
  height: 18px;
  border-radius: 4px;
  background: #cda853;
  border: 2px solid rgba(255, 255, 255, 0.94);
}

.property-marker-door {
  left: 14px;
  top: 21px;
  width: 6px;
  height: 11px;
  border-radius: 3px 3px 2px 2px;
  background: rgba(255, 255, 255, 0.92);
}

.property-marker-chimney {
  right: 7px;
  top: 6px;
  width: 5px;
  height: 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.94);
}

.property-marker-house.is-upcoming .property-marker-roof,
.property-marker-house.is-upcoming .property-marker-body,
.property-marker-house.upcoming .property-marker-roof,
.property-marker-house.upcoming .property-marker-body {
  background: #998372;
  border-bottom-color: #998372;
}

.property-marker-house.is-visited .property-marker-roof,
.property-marker-house.is-visited .property-marker-body,
.property-marker-house.visited .property-marker-roof,
.property-marker-house.visited .property-marker-body {
  background: #66935f;
  border-bottom-color: #66935f;
}

.property-marker-house.is-under-contract .property-marker-roof,
.property-marker-house.is-under-contract .property-marker-body,
.property-marker-house.under-contract .property-marker-roof,
.property-marker-house.under-contract .property-marker-body {
  background: #cda853;
  border-bottom-color: #cda853;
}

.property-marker-house.is-do-not-go .property-marker-roof,
.property-marker-house.is-do-not-go .property-marker-body,
.property-marker-house.do-not-go .property-marker-roof,
.property-marker-house.do-not-go .property-marker-body {
  background: #be5656;
  border-bottom-color: #be5656;
}

.property-marker-house.is-preview .property-marker-roof,
.property-marker-house.is-preview .property-marker-body {
  background: #7d8fd6;
  border-bottom-color: #7d8fd6;
}

@media (max-width: 1100px) {
  .map-workspace, .map-hero { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .map-page-shell { width: min(100% - 24px, 1660px); padding-top: 18px; }
  .map-topbar { grid-template-columns: 1fr; }
  .map-form, .map-detail-grid { grid-template-columns: 1fr; }
  .property-map { min-height: 460px; }
}
.board-map {
  position: relative;
  background: linear-gradient(180deg, rgba(246, 240, 231, 0.9), rgba(240, 232, 222, 0.9));
}
.board-surface {
  position: relative;
  min-height: 680px;
  width: 100%;
  background:
    radial-gradient(circle at 10% 20%, rgba(159, 191, 141, 0.28), transparent 18%),
    radial-gradient(circle at 88% 76%, rgba(159, 191, 141, 0.24), transparent 18%),
    linear-gradient(180deg, rgba(255,255,255,0.36), rgba(255,255,255,0));
}
.board-road {
  position: absolute;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(86, 66, 55, 0.1);
  border-radius: 999px;
}
.board-road-horizontal { left: 4%; width: 92%; height: 6%; }
.road-top { top: 12%; }
.road-mid { top: 42%; }
.road-bottom { top: 72%; }
.board-road-vertical { top: 7%; width: 6%; height: 84%; }
.road-left { left: 24%; }
.road-right { right: 24%; }
.board-road-label {
  position: absolute;
  font-size: 0.9rem;
  color: rgba(79, 65, 58, 0.86);
  background: rgba(255, 250, 243, 0.84);
  padding: 2px 8px;
  border-radius: 999px;
}
.label-top { top: 18%; left: 34%; }
.label-mid { top: 48%; left: 38%; }
.label-bottom { top: 78%; left: 40%; }
.board-house {
  position: absolute;
  width: 8.6%;
  height: 9.4%;
  border-radius: 12px;
  border: 1px solid rgba(115, 94, 82, 0.2);
  background: rgba(220, 211, 202, 0.95);
  color: rgba(91, 79, 73, 0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.44);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.board-house:hover,
.board-house.is-selected {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(71, 42, 27, 0.12);
}
.board-house.is-upcoming { background: rgba(153, 131, 114, 0.58); color: #4f4138; }
.board-house.is-visited { background: rgba(102, 147, 95, 0.78); color: #244123; }
.board-house.is-under-contract { background: rgba(205, 168, 83, 0.78); color: #5f4e1f; }
.board-house.is-do-not-go { background: rgba(190, 86, 86, 0.82); color: #5d1f1f; }
.board-house.is-preview { outline: 2px dashed rgba(138, 75, 58, 0.48); outline-offset: 2px; }
.board-house-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 4px;
  font-size: 0.92rem;
}
.board-popup {
  position: absolute;
  z-index: 4;
  width: min(340px, 44vw);
  padding: 16px 18px 18px;
  border: 1px solid rgba(64, 38, 26, 0.14);
  border-radius: 24px;
  background: rgba(255, 250, 243, 0.96);
  box-shadow: 0 18px 42px rgba(71, 42, 27, 0.16);
}
.board-popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: rgba(91, 79, 73, 0.9);
  font-size: 1.4rem;
  cursor: pointer;
}
