:root {
  --bg: #1a261f;
  /* Darker, richer green */
  --panel: rgba(22, 28, 36, 0.85);
  /* Glassmorphism base */
  --text: #e9eef5;
  --muted: #94a3b8;
  --primary: #4ade80;
  /* Brighter, more modern green for accents */
  --primary-dark: #22c55e;

  --surface: rgba(30, 41, 59, 0.7);
  --border: rgba(255, 255, 255, 0.1);
  --blur: blur(12px);

  /* Performance: Disable blur on mobile/low-power */
  @media (max-width: 768px) {
    --blur: none;
    --surface: #1e293b;
    --panel: #161c24;
  }

  /* STATUS COLORS – "Botanical Brass" palette */
  --available: #8FBF8B;    /* Fern */
  --sold: #CB8A7A;         /* Clay */
  --negotiation: #C9A099;  /* Guava — inspired by the pool deck terracotta */
  --reserved: #C9A099;     /* Guava */
  --phase3: #94B1C0;       /* Driftwood Blue */

  --unknown: #64748b;
  --outline: rgba(255, 255, 255, 0.9);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius: 16px;
}

/* Webfont for SVG labels (ensure the font is shipped, not OS-dependent) */
@font-face {
  font-family: 'Quning';
  src: url('Quning.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}


* {
  box-sizing: border-box;
}

html,
body {
  /* Use dvh (dynamic viewport height) for mobile - accounts for browser chrome */
  height: 100dvh;
  /* Fallback for older browsers */
  height: 100vh;
  height: 100dvh;
  /* Override after fallback */
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
  overflow: hidden;
  /* Prevent scrolling */
  width: 100%;
  position: fixed;
  /* Lock to viewport on mobile */
  inset: 0;
}

/* UI Layer */
.ui-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Let clicks pass through to map */
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ui-layer>* {
  pointer-events: auto;
  /* Re-enable clicks on UI elements */
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
  border: none;
}

/* Desktop: Solid header bar */
@media (min-width: 769px) {
  .app-header {
    background: rgba(22, 28, 36, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px;
    position: relative;
    z-index: 100;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.app-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@media (min-width: 769px) {
  .app-header h1 {
    text-shadow: none;
  }
}

/* Desktop Controls */
.desktop-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Header Buttons */
.header-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.header-btn-primary {
  background: var(--primary);
  color: #0f172a;
  border-color: transparent;
}

.header-btn-primary:hover {
  background: var(--primary-dark);
}

.header-btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
}

.header-btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

.header-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
}

/* Dropdowns */
.dropdown {
  position: relative;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.15);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: rgba(30, 41, 59, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 200;
  overflow: hidden;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.dropdown-item.active {
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .desktop-controls {
    display: none;
  }

  .mobile-only {
    display: flex;
  }
}

@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

/* Toggle Groups (Glassmorphism) */
.toggle-group {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  /* Fallback if blur var is used directly */
  backdrop-filter: var(--blur);
}

@media (max-width: 768px) {
  .toggle-group {
    background: #1e293b;
    /* Solid fallback */
    backdrop-filter: none;
  }
}

.toggle-group button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Currency toggle has 5 buttons – use tighter padding so it fits */
#mobile-currency.toggle-group button {
  padding: 6px 8px;
  font-size: 0.8rem;
}

.toggle-group button:hover {
  color: var(--text);
}

.toggle-group button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* FAB */
.fab-btn {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background: var(--primary);
  color: #0f172a;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(74, 222, 128, 0.4);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 20;
}

.fab-btn:hover {
  transform: scale(1.05);
}

.fab-btn:active {
  transform: scale(0.95);
}

/* Meeting FAB - positioned mid-page vertically on left (desktop) */
.meeting-fab {
  right: auto;
  left: 24px;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  color: #2D4230;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.meeting-fab:hover {
  transform: translateY(-50%) scale(1.05);
  background: #f0f0f0;
}

.meeting-fab:active {
  transform: translateY(-50%) scale(0.95);
}

/* Mobile: Meeting FAB at bottom left, same size as filter button */
@media (max-width: 768px) {
  .meeting-fab {
    top: auto;
    bottom: 24px;
    left: 24px;
    transform: none;
    padding: 12px 20px;
    font-size: inherit;
  }
  
  .meeting-fab:hover,
  .meeting-fab:active {
    transform: scale(1.05);
  }
  
  .meeting-fab:active {
    transform: scale(0.95);
  }
}

/* Drawers (Bottom Sheet / Side Menu) */
.drawer {
  position: fixed;
  z-index: 50;
  background: rgba(22, 28, 36, 0.95);
  backdrop-filter: var(--blur);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer[hidden] {
  display: block;
  /* Override default hidden to animate */
  transform: translate3d(100%, 0, 0);
  /* Slide out right by default */
  pointer-events: none;
  opacity: 0;
}

/* Mobile Menu - Right Slide */
#mobile-menu {
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  max-width: 80vw;
  border-left: 1px solid var(--border);
}

/* Filter Drawer - Bottom Sheet on Mobile */
#filter-drawer {
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--border);
  transform: translate3d(0, 0, 0);
}

#filter-drawer[hidden] {
  transform: translate3d(0, 100%, 0);
  opacity: 1;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.drawer-content {
  padding: 20px;
  overflow-y: auto;
  max-height: 70vh;
}

.drawer-section {
  margin-bottom: 24px;
}

.drawer-section h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 12px;
}

.drawer-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.full-width {
  width: 100%;
  justify-content: space-between;
}

.full-width button {
  flex: 1;
}

/* Filter UI Components */
.filter-group {
  margin-bottom: 24px;
}

.filter-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  font-size: 0.95rem;
}

.chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.chip.active {
  background: var(--primary);
  color: #0f172a;
  border-color: var(--primary);
  font-weight: 600;
}

.range-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  /* Fix lint */
  background: transparent;
  margin: 10px 0;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  margin-top: -8px;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.range-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
  border-radius: 50%;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Desktop adjustments for Filter Drawer */
@media (min-width: 769px) {
  #filter-drawer {
    top: 80px;
    right: 24px;
    bottom: auto;
    left: auto;
    width: 360px;
    border-radius: 16px;
    transform: translate3d(0, 0, 0);
  }

  #filter-drawer[hidden] {
    transform: translate3d(20px, 0, 0);
    opacity: 0;
    pointer-events: none;
  }
}

/* Rotate overlay for portrait mobile */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, .7);
  z-index: 40;
}

.zoom-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, .35);
  z-index: 35;
  pointer-events: none;
}

.iconContainer {
  width: 200px;
  height: 200px;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -100px;
  margin-top: -100px;
}

.iconContainer p {
  display: inline-block;
  width: 100%;
  text-align: center;
  margin: 0;
  font-size: 18px;
  opacity: 0;
  color: #fff;
}

.phone {
  position: relative;
  left: 50%;
  margin-left: -50px;
  width: 0;
  height: 0;
  border: 0 solid #000;
  background: #a9a9a9;
  border-radius: 10px;
  box-sizing: border-box;
}

.phone i {
  text-align: center;
  width: 100%;
  line-height: 120px;
  font-size: 50px;
  color: #454545;
  opacity: 0;
  display: inline-block;
}

/* Removed rotation overlay styles */

@media only screen and (max-width: 1200px) and (orientation: landscape) {
  body.app-ready .zoom-overlay.show {
    display: block;
  }

  body.app-ready .zoom-overlay .iconContainer {
    left: 50%;
    top: 50%;
    margin-left: -100px;
    margin-top: -100px;
  }

  body.app-ready .zoom-overlay .iconContainer p {
    animation: fadeIn .4s .2s forwards ease;
    color: #fff;
    opacity: 1;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: .4px;
    text-align: center;
  }
}

/* Pinch animation: two dots move apart and fade */
.pinch {
  position: relative;
  width: 200px;
  height: 80px;
  margin: 0 auto 8px;
}

.pinch .dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  background: #fff;
  border-radius: 50%;
  opacity: .9;
}

.pinch .left {
  left: 50%;
  animation: pinchLeft 1.8s ease-in-out infinite;
}

.pinch .right {
  left: 50%;
  animation: pinchRight 1.8s ease-in-out infinite;
}

@keyframes pinchLeft {
  0% {
    transform: translateX(-12px);
    opacity: .2;
  }

  30% {
    opacity: .9;
  }

  100% {
    transform: translateX(-80px);
    opacity: .1;
  }
}

@keyframes pinchRight {
  0% {
    transform: translateX(12px);
    opacity: .2;
  }

  30% {
    opacity: .9;
  }

  100% {
    transform: translateX(80px);
    opacity: .1;
  }
}

@keyframes sizeIncrease {
  0% {
    width: 0;
    height: 10px;
  }

  50% {
    width: 100px;
    height: 10px;
  }

  100% {
    width: 100px;
    height: 160px;
  }
}

@keyframes borderIncrease {
  100% {
    border-width: 20px 10px;
  }
}

@keyframes fadeIn {
  100% {
    color: #fff;
    opacity: 1;
  }
}

@keyframes rotateRight {
  100% {
    transform: rotate(90deg);
  }
}

/* Loader overlay - Simple spinner */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: grid;
  place-items: center;
  z-index: 50;
}

.loader-overlay[hidden] {
  display: none;
}

.loader-card {
  text-align: center;
}

.loader-logo {
  display: block;
  width: 280px;
  max-width: 80vw;
  margin: 0 auto;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.4));
  animation: pulse 2s ease-in-out infinite;
}

/* Simple pulse animation */
@keyframes pulse {

  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

/* Spinner ring below logo */
.loader-spinner {
  width: 50px;
  height: 50px;
  margin: 24px auto 0;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* DESKTOP ONLY: Green border bar at top – masks letterbox on wide monitors.
   min-height prevents it from firing on short/landscape viewports (e.g. screen
   share, resized browser, tablets) where the formula would produce a huge bar. */
@media only screen and (min-width: 1201px) and (min-height: 700px) {
  #svg-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* Height = width of letterbox. Map is 16:9 (3840/2160) */
    /* letterbox width = (100vw - (100vh * 16/9)) / 2 */
    height: calc(max(0px, (100vw - (100vh * 16 / 9)) / 2));
    background: var(--bg);
    z-index: 40;
    pointer-events: none;
  }
}



#svg-container {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  /* Dynamic viewport height for mobile */
  background: var(--bg);
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  contain: layout style paint;
  /* Enable pinch-to-zoom on mobile */
  touch-action: pan-x pan-y pinch-zoom;
  /* Hardware acceleration */
  will-change: transform;
}

/* Desktop: Map starts below header bar */
@media (min-width: 769px) {
  #svg-container {
    top: 56px;
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
  }
}

/* Mobile landscape: Compact header – catches ALL phones & small tablets in landscape */
@media (max-width: 1200px) and (orientation: landscape) {
  :root {
    --mobile-landscape-header: calc(40px + env(safe-area-inset-top, 0px));
  }

  .app-header {
    background: rgba(22, 28, 36, 0.98);
    padding: 4px 12px;
    gap: 6px;
    max-height: var(--mobile-landscape-header);
    overflow: hidden;
  }

  .app-header h1 {
    font-size: 0.9rem;
    text-shadow: none;
  }

  .brand {
    gap: 6px;
  }

  .brand-icon {
    width: 22px;
    height: 22px;
  }

  /* Hide mobile menu button in landscape – use portrait only */
  .mobile-only {
    display: none !important;
  }

  #svg-container {
    top: var(--mobile-landscape-header);
    height: calc(100vh - var(--mobile-landscape-header));
    height: calc(100dvh - var(--mobile-landscape-header));
  }

  /* Show compact desktop controls in landscape */
  .desktop-controls {
    display: flex !important;
    gap: 4px;
    flex-wrap: nowrap;
  }

  /* Hide less‑critical items so header stays single‑line */
  #ready-homes-link {
    display: none;
  }

  .header-divider {
    display: none;
  }

  .header-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
    gap: 3px;
    border-radius: 5px;
  }

  .header-btn svg {
    width: 13px;
    height: 13px;
  }

  .dropdown-trigger {
    padding: 4px 7px;
    font-size: 0.7rem;
    gap: 3px;
    border-radius: 5px;
  }

  .dropdown-trigger svg {
    width: 9px;
    height: 9px;
  }

  .dropdown-menu {
    min-width: 110px;
  }

  .dropdown-item {
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  /* FABs in landscape – smaller and repositioned */
  .fab-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    bottom: 8px;
  }

  .fab-btn svg {
    width: 14px;
    height: 14px;
  }

  #filter-fab {
    right: 10px;
  }

  .meeting-fab {
    left: 10px;
  }
}

/* The inlined SVG scales to fit, maintaining aspect ratio */
#svg-container svg {
  width: 100%;
  height: 100%;
  display: block;
  /* preserveAspectRatio set dynamically in JavaScript based on screen size */
  /* smooth edges */
  shape-rendering: geometricPrecision;
  text-rendering: optimizeLegibility;
  /* Ensure proper sizing on mobile */
  max-width: 100%;
  max-height: 100%;
}

.plot {
  cursor: pointer;
  transition: transform .08s ease-out, filter .08s ease-out, stroke .08s ease-out, stroke-width .08s ease-out;
  /* keep clicks on path interior only */
  pointer-events: painted;
  /* Allow pinch-to-zoom while still enabling tap */
  touch-action: manipulation;
}

/* Hover “pop” and crisper edge */
.plot:hover {
  filter: drop-shadow(0 0 0.5px var(--outline));
  stroke: #ffffff;
  stroke-width: 1.5;
}

/* Tooltip */
.tooltip {
  position: fixed;
  background: rgba(22, 26, 31, 0.95);
  color: var(--text);
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: .9rem;
  pointer-events: none;
  z-index: 20;
  box-shadow: var(--shadow);
  max-width: 360px;
  text-align: center;
  overflow: hidden;
}

/* Tooltip price table styling */
.tooltip .price-table {
  border: 1px solid #ffffff;
  table-layout: fixed;
  width: 100%;
}

.tooltip .price-table th,
.tooltip .price-table td {
  border: 1px solid #ffffff;
  text-align: center;
  padding: 2px 4px;
}

.tooltip .price-table th {
  border: 1px solid #ffffff;
  text-align: center;
  padding: 2px 4px;
}

/* Price table subtext */
.tooltip .price-table .sub {
  display: block;
  font-size: .55em;
  color: #ffffff;
  font-weight: 400;
  white-space: nowrap;
}

/* Style strike-through clarity */
.tooltip s {
  opacity: .8;
}

/* Ensure only status and prices are bold by default */
.tooltip th {
  font-weight: 400;
}

.tooltip td {
  font-weight: 400;
}

/* Price blur - hide monetary values until unlocked */
.price-blur {
  filter: blur(6px);
  -webkit-filter: blur(6px);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  display: inline-block;
}

/* Price protection overlay */
.prices-blurred .pay-card { pointer-events: none; }
.price-protection-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(22, 26, 31, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 12px;
}
.price-protection-content {
  text-align: center;
  padding: 24px;
  max-width: 320px;
}
.price-protection-content h3 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 8px;
}
.price-protection-content p {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  margin-bottom: 16px;
}
.price-protection-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.price-protection-form input {
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}
.price-protection-form input::placeholder { color: rgba(255,255,255,0.5); }
.price-protection-form input:focus { outline: none; border-color: var(--available, #8fcbad); }
.price-protection-form button {
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--available, #8fcbad);
  color: #000;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}
.price-protection-form button:hover { opacity: 0.9; }

/* Modal */
.modal {
  border: none;
  padding: 0;
  width: min(720px, 96vw);
  background: transparent;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-card {
  background: #2a3844;
  color: #f2f6fb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.btn-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-body {
  padding: 14px;
  color: var(--muted);
  line-height: 1.4;
  position: relative;
  text-align: center;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* On mobile, stack modal footer buttons vertically */
@media (max-width: 480px) {
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-footer .btn {
    width: 100%;
    text-align: center;
  }
}

.btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(4px);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: #0f172a;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(74, 222, 128, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Payment options in modal */
/* Payment options in modal */
.pay-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
  align-items: stretch;
}

@media (min-width: 768px) {
  .pay-grid.three-col {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pay-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.2s ease;
}

.pay-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.pay-card .title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--text);
}

.pay-card .sub {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  opacity: 0.9;
  margin-bottom: 8px;
}

.pay-card .chip-label {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pay-price {
  margin-top: auto;
}

.pay-price div {
  margin: 2px 0;
}

.pay-price strong {
  font-size: 1.1rem;
  color: var(--text);
}

.pay-price .sm {
  font-size: 0.8rem;
  color: var(--muted);
}

.pay-price .plus {
  margin: 4px 0;
  color: var(--primary);
  font-weight: bold;
}

.pay-total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  opacity: 0.9;
}

/* Center title and price vertically for simpler cards (like Avista) */
.pay-card[data-pay="avista"] .pay-price {
  margin-top: 0;
}

.pay-card.selected {
  background: rgba(74, 222, 128, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.pay-prompt {
  color: var(--text);
  margin: 0 0 16px;
  text-align: center;
  font-weight: 500;
}

/* Shake Animation (Validation) */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

.shake {
  animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #ef4444;
  /* Red warning */
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Embedded slideshow in SVG */
.svg-slideshow-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out;
}

/* Slideshow container - simple passthrough layer */
#slideshow-container {
  pointer-events: none;
}

/* Custom Legend Overlay – positioned by JS to cover bottom 175 native‑px of the WebP */
#legend-overlay {
  position: absolute;
  /* top / left / width / height set dynamically by positionLegend() */
  background: #3D6447;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
  box-sizing: border-box;
  /* Start invisible until JS has positioned it to prevent flash at top-left */
  visibility: hidden;
}

/* Reveal once JS has computed the correct position */
#legend-overlay.positioned {
  visibility: visible;
}

.legend-content {
  display: flex;
  gap: clamp(12px, 3vw, 48px);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 16px;
  width: 100%;
  height: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: clamp(4px, 0.5vw, 8px);
  font-size: clamp(0.55rem, 1.1vw, 1.05rem);
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}

.legend-color-box {
  width: clamp(10px, 1.6vw, 28px);
  height: clamp(10px, 1.6vw, 28px);
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

/* ── Mobile portrait: move legend items below the image ── */
@media (max-width: 768px) and (orientation: portrait) {
  /* Hide the text items inside the green bar – bar itself stays */
  #legend-overlay .legend-content {
    display: none;
  }
}

/* Mobile Legend – positioned below the map image by JS */
#mobile-legend {
  display: none; /* hidden on desktop + landscape */
  z-index: 5;
  pointer-events: none;
  box-sizing: border-box;
}

@media (max-width: 768px) and (orientation: portrait) {
  #mobile-legend {
    display: flex;
    justify-content: center;
    padding: 14px 16px 0;
  }
}

.mobile-legend-content {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.mobile-legend-content .legend-item {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.mobile-legend-content .legend-color-box {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Very narrow screens – 2×2 grid */
@media (max-width: 360px) and (orientation: portrait) {
  .mobile-legend-content {
    gap: 10px 18px;
  }
  .mobile-legend-content .legend-item {
    font-size: 0.78rem;
  }
}

/* FAQ modal basics */
.faq-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  margin: 8px 0;
  overflow: hidden;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  background: #324353;
  color: #f2f6fb;
}

.faq-answer {
  display: none;
  padding: 10px 12px;
  background: #2b3946;
  color: #d7e2ee;
}

.faq-item.open .faq-question {
  background: #2b3641;
}

.faq-item .highlight {
  color: var(--text);
  font-weight: 600;
}

/* Sales Features Styles */

/* Ticker */
.ticker-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 40;
  pointer-events: none;
}

.ticker-content {
  background: rgba(22, 28, 36, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 0.9rem;
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.ticker-icon {
  font-size: 1.2rem;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Input Fields */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.input-field {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

/* Mobile Ticker Adjustment */
@media (max-width: 768px) {
  .ticker-container {
    left: 50%;
    transform: translateX(-50%);
    bottom: 80px;
    /* Above bottom sheet/fab */
    width: 90%;
    display: flex;
    justify-content: center;
  }

  .ticker-content {
    width: 100%;
    justify-content: center;
  }
}

.timeline,
.example {
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 10px;
  border-radius: 8px;
  margin-top: 6px;
}

/* ============================================
   HOUSES MODAL - Full Screen Experience
   ============================================ */

.houses-modal {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: none;
  background: var(--bg);
  z-index: 500;
}

.houses-modal::backdrop {
  background: rgba(0, 0, 0, 0.9);
}

/* Ensure Calendly popup appears above houses modal */
.calendly-overlay {
  z-index: 10000 !important;
}

.calendly-popup {
  z-index: 10001 !important;
}

.calendly-popup-close {
  z-index: 10002 !important;
}

.houses-modal-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

.houses-modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.houses-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

/* Step Navigation */
.houses-step {
  max-width: 1200px;
  margin: 0 auto;
}

.houses-step[hidden] {
  display: none;
}

.houses-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 16px;
  transition: color 0.2s;
}

.houses-back-btn:hover {
  color: var(--text);
}

/* Step 1: Model Selection */
.houses-header {
  text-align: center;
  margin-bottom: 40px;
  padding-top: 20px;
}

.houses-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.houses-header p {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0;
}

.houses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  padding-bottom: 40px;
}

/* House Cards */
.house-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.house-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.house-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.house-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.house-card:hover .house-card-image img {
  transform: scale(1.05);
}

.house-card-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: var(--primary);
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
}

.house-card-content {
  padding: 20px;
}

.house-card-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}

.house-card-material {
  font-size: 0.9rem;
  color: var(--primary);
  margin: 0 0 8px;
  font-weight: 500;
}

.house-card-specs {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
}

/* Step 2: House Detail */
.houses-detail-header {
  margin-bottom: 24px;
}

.houses-detail-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}

.houses-detail-header p {
  font-size: 1rem;
  color: var(--primary);
  margin: 0;
  font-weight: 500;
}

/* Gallery */
.house-gallery {
  margin-bottom: 32px;
}

.gallery-main {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  margin-bottom: 12px;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.8;
}

.gallery-nav:hover {
  background: rgba(0, 0, 0, 0.8);
  opacity: 1;
}

.gallery-prev {
  left: 16px;
}

.gallery-next {
  right: 16px;
}

.gallery-counter {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 20px;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.gallery-thumbs::-webkit-scrollbar {
  height: 6px;
}

.gallery-thumbs::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

.gallery-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s;
}

.gallery-thumb:hover {
  opacity: 0.9;
}

.gallery-thumb.active {
  border-color: var(--primary);
  opacity: 1;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Floorplan Section */
.floorplan-section {
  margin-bottom: 24px;
}

.floorplan-section h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text);
}

.floorplan-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.floorplan-option {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.floorplan-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.floorplan-option.active {
  border-color: var(--primary);
  background: rgba(74, 222, 128, 0.1);
}

.floorplan-option-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}

.floorplan-option-area {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.floorplan-option-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

/* Floorplan Detail */
.floorplan-detail {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  margin-top: 24px;
}

.floorplan-image-container {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floorplan-image-container img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}

/* Two-floor floorplan display */
.floorplan-floors {
  display: flex;
  gap: 16px;
  width: 100%;
}

.floorplan-floor {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.floorplan-floor img {
  max-width: 100%;
  max-height: 350px;
  object-fit: contain;
}

.floor-label {
  background: var(--primary);
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

@media (max-width: 600px) {
  .floorplan-floors {
    flex-direction: column;
  }
  
  .floorplan-floor img {
    max-height: 250px;
  }
}

.floorplan-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.floorplan-info h4 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}

.floorplan-specs {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.floorplan-specs span {
  font-size: 1.1rem;
  color: var(--muted);
}

.floorplan-specs #floorplan-price {
  color: var(--primary);
  font-weight: 700;
}

.floorplan-divider {
  color: rgba(255, 255, 255, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .houses-modal-content {
    padding: 16px;
    padding-top: 60px;
  }

  .houses-modal-close {
    top: 12px;
    right: 12px;
  }

  .houses-header {
    margin-bottom: 24px;
    padding-top: 0;
  }

  .houses-header h2 {
    font-size: 1.5rem;
  }

  .houses-grid {
    grid-template-columns: 1fr;
  }

  .gallery-thumb {
    width: 60px;
    height: 45px;
  }

  .floorplan-detail {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .floorplan-info {
    text-align: center;
  }

  .floorplan-specs {
    justify-content: center;
  }
}