/* ===== Design Tokens ===== */
:root {
  --color-primary: #1a3a4a;
  --color-primary-light: #24506a;
  --color-accent: #0d8a6a;
  --color-accent-hover: #0a7058;
  --color-success: #22c55e;
  --color-bg: #f8fafb;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --max-width: 1200px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }
html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ===== Layout ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-primary);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
/* Scroll bar — mobile-only compact header that replaces nav on scroll */
.scroll-bar {
  display: none;
  align-items: center;
  padding: 0 1rem;
  height: 48px;
  background: var(--color-primary);
  color: white;
  font-size: 0.85rem;
  gap: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
}
.scroll-bar.active { display: flex; }
.site-header.scrolled .header-inner { display: none; }
.site-header.scrolled .main-nav.open { top: 48px; }
/* Page search bar — mobile only, sticky at top */
.page-search-bar {
  display: none;
}
@media (max-width: 768px) {
  .page-search-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 101;
    background: var(--color-primary);
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }
  .page-search-bar.visible { display: block; }
  .page-search-bar .search-box {
    max-width: 100%;
  }
  .page-search-bar .search-box-input {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.25);
    font-size: 14px;
    height: 40px;
  }
  .page-search-bar .search-box-input::placeholder { color: rgba(255,255,255,0.6); }
  .page-search-bar .search-box-input:focus {
    background: white;
    color: var(--color-text);
    border-color: var(--color-accent);
  }
  .page-search-bar .search-box-input:focus::placeholder { color: var(--color-text-muted); }
  .page-search-bar .search-box-icon { color: rgba(255,255,255,0.6); }
  .page-search-bar .search-box-input:focus ~ .search-box-icon { color: var(--color-text-muted); }
  .page-search-bar .search-box-btn { color: rgba(255,255,255,0.7); }
  .page-search-bar .search-box-btn:hover { color: white; }
}
/* Scroll bar search */
.scroll-bar-search {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 0.35rem 0.65rem;
  gap: 0.4rem;
}
.scroll-bar-search input {
  flex: 1;
  background: none;
  border: none;
  color: white;
  font-size: 0.85rem;
  outline: none;
}
.scroll-bar-search input::placeholder { color: rgba(255,255,255,0.6); }
.scroll-bar-search svg { opacity: 0.6; flex-shrink: 0; }
/* Scroll bar listing/building info */
.scroll-bar-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
  min-width: 0;
}
.scroll-bar-price {
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.scroll-bar-meta {
  color: rgba(255,255,255,0.75);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scroll-bar-link {
  color: rgba(255,255,255,0.9);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius);
}
.scroll-bar .heart-btn {
  position: static;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
}
.scroll-bar .heart-btn.saved { color: #ef4444; }
@media (min-width: 769px) {
  .scroll-bar { display: none !important; }
  .site-header.scrolled .header-inner { display: flex; }
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.logo-sub { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.2em; color: rgba(255,255,255,0.7); }
.logo-img { height: 44px; width: auto; display: block; }
.main-nav { display: flex; gap: 1.5rem; align-items: center; }
.mobile-menu-extras { display: none; }
.main-nav > a, .nav-dropdown > a { color: rgba(255,255,255,0.85); font-weight: 500; font-size: 0.9rem; transition: color 0.2s; }
.main-nav > a:hover, .nav-dropdown > a:hover { color: white; }
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 0.5rem 0;
  z-index: 200;
  padding-top: 0.9rem;
}
.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -0.5rem;
  left: 0;
  right: 0;
  height: 1rem;
}
@media (min-width: 769px) {
  .nav-dropdown:hover .nav-dropdown-menu { display: block; }
}
.nav-dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--color-text) !important;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s;
}
.nav-dropdown-menu a:hover { background: var(--color-bg); }
.header-right { display: flex; align-items: center; gap: 1rem; }
.header-phone {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--color-accent); color: white;
  padding: 0.45rem 1rem; border-radius: var(--radius);
  font-weight: 600; font-size: 0.9rem; white-space: nowrap;
  transition: background 0.2s;
}
.header-phone:hover { background: var(--color-accent-hover); }
.header-phone svg { flex-shrink: 0; }
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.mobile-menu-btn span {
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: 0.2s;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--color-accent); color: white; }
.btn-primary:hover { background: var(--color-accent-hover); }
.btn-outline { background: transparent; border: 2px solid var(--color-accent); color: var(--color-accent); }
.btn-outline:hover { background: var(--color-accent); color: white; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-full { width: 100%; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  padding: 5rem 0 4rem;
  text-align: center;
}
.hero h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.03em; }
.hero-sub { font-size: 1.15rem; color: rgba(255,255,255,0.8); margin-top: 0.75rem; }
.hero-search { margin-top: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--color-text);
  outline: none;
}
.search-input::placeholder { color: var(--color-text-muted); }

/* ===== Contact Section ===== */
.contact-section {
  padding: 3.5rem 0;
}
.contact-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ===== Page Header ===== */
.page-header {
  background: var(--color-primary);
  color: white;
  padding: 2.5rem 0 2rem;
}
.page-header h1 { font-size: 2rem; }
.page-header p { color: rgba(255,255,255,0.75); margin-top: 0.25rem; }

/* ===== Filter Bar ===== */
.filter-section {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  position: sticky;
  top: 64px;
  z-index: 50;
}
.filter-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.filter-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 150px;
}
.filter-search { flex: 1; min-width: 200px; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.5rem 0.75rem; }
.filter-clear { font-size: 0.85rem; color: var(--color-accent); font-weight: 500; }

/* ===== Buildings Grid ===== */
.buildings-grid-section { padding: 2rem 0 3rem; }
.buildings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.building-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s;
  display: block;
}
.building-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--color-accent);
}
.card-image {
  position: relative;
  height: 200px;
  background: linear-gradient(135deg, #2a4a5a 0%, #1a3a4a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.building-card:hover .card-image img { transform: scale(1.05); }
.card-image-placeholder {
  width: 48px;
  height: 48px;
  color: rgba(255,255,255,0.3);
}
.card-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  gap: 0.35rem;
  z-index: 2;
}
.badge {
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-primary);
  color: white;
}
.badge-type { background: rgba(26,58,74,0.85); }
.badge-active { background: var(--color-success); color: white; }
.badge-completed { background: var(--color-success); color: white; }
.badge-link { text-decoration: none; color: inherit; cursor: pointer; transition: opacity 0.2s; }
.badge-link:hover { opacity: 0.85; }
.badge-link .badge { display: inline-block; }
.card-body { padding: 1rem 1.25rem 1.25rem; }
.card-title { font-size: 1.05rem; font-weight: 700; font-style: italic; margin-bottom: 0.35rem; }
.card-address {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  line-height: 1.4;
}
.card-address svg { flex-shrink: 0; margin-top: 2px; opacity: 0.5; }
.card-price-body {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 0.4rem;
}
.card-meta {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.card-meta-item svg { opacity: 0.5; flex-shrink: 0; }
.active-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  flex-shrink: 0;
}
.sold-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text-muted);
}
.empty-state p { margin-bottom: 1rem; }

/* ===== Building Detail ===== */

.breadcrumb {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 1rem;
}
.breadcrumb a { color: rgba(255,255,255,0.75); }
.breadcrumb a:hover { color: white; }

/* School catchment grid */
.school-catchment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.school-catchment-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface, #f8f9fa);
  border-radius: 8px;
  border: 1px solid var(--color-border, #e0e0e0);
}
.school-level {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.school-name {
  font-size: 1rem;
  font-weight: 600;
}

/* Amenities grid - 3 columns with green dots */
.amenities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.amenity-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  padding: 0.4rem 0;
}
.amenity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* Listing tabs */
.listing-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.5rem;
}
.tab-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tab-btn:hover { color: var(--color-text); }
.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.listings-count { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 1rem; }

/* Sold listings gate */
.sold-listings-wrap {
  position: relative;
}
.sold-listings-wrap.locked .sold-listings-grid {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}
.sold-gate-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
}
.sold-gate-box {
  position: relative;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.sold-gate-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.25rem;
}
.sold-gate-close:hover { color: var(--color-text); }
.sold-gate-box svg { color: var(--color-primary); margin-bottom: 0.75rem; }
.sold-gate-box h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.sold-gate-box p { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 1rem; }
.sold-unlock-form { display: flex; flex-direction: column; gap: 0.75rem; }
.sold-gate-disclaimer { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 0.5rem; }
.badge-sold { background: var(--color-text-muted); color: #fff; }
.sold-card { opacity: 0.9; }

/* Listing grid cards */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.listing-grid-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s;
  display: block;
}
.listing-grid-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--color-accent);
}
.lgc-photo {
  position: relative;
  height: 200px;
  background: linear-gradient(135deg, #2a4a5a 0%, #1a3a4a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lgc-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.listing-grid-card:hover .lgc-photo img { transform: scale(1.05); }
.lgc-photo-placeholder { width: 40px; height: 40px; color: rgba(255,255,255,0.3); }
.lgc-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  gap: 0.35rem;
}
.lgc-price {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.lgc-body { padding: 1rem; }
.lgc-address {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.lgc-address svg { opacity: 0.5; flex-shrink: 0; }
.lgc-city { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.15rem; }
.lgc-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.lgc-stats span { display: flex; align-items: center; gap: 0.25rem; }
.lgc-stats svg { opacity: 0.6; }
.lgc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Sidebar contact */
.sidebar-contact .btn { gap: 0.4rem; margin-bottom: 0.5rem; }
.sidebar-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.building-content { padding: 2rem 0 3rem; }
.building-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}
.building-section { margin-bottom: 2.5rem; }
.building-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.building-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-heading);
  margin: 1.25rem 0 0.5rem;
}
.building-section h3:first-of-type {
  margin-top: 0;
}
.count-badge {
  background: var(--color-accent);
  color: white;
  font-size: 0.8rem;
  padding: 0.15rem 0.6rem;
  border-radius: 2rem;
}
.building-description, .building-amenities {
  line-height: 1.7;
  color: var(--color-text);
}
.building-description p, .building-amenities p { margin-bottom: 0.75rem; }

/* ===== Listings ===== */
.listing-card {
  display: flex;
  gap: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: all 0.2s;
  cursor: pointer;
}
.listing-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}
.listing-photo {
  width: 120px;
  height: 90px;
  flex-shrink: 0;
  background: var(--color-border-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.listing-photo img { width: 100%; height: 100%; object-fit: cover; }
.listing-photo-placeholder { width: 32px; height: 32px; color: var(--color-text-muted); opacity: 0.3; }
.listing-photo-placeholder.large { width: 100%; height: 300px; display: flex; align-items: center; justify-content: center; background: var(--color-border-light); border-radius: var(--radius); }
.listing-photo-placeholder.large svg { width: 64px; height: 64px; }
.listing-info { flex: 1; min-width: 0; }
.listing-price { font-size: 1.15rem; font-weight: 700; color: var(--color-primary); }
.listing-unit { font-size: 0.85rem; color: var(--color-text-muted); }
.listing-meta { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.15rem; }
.listing-ppsf { font-size: 0.8rem; color: var(--color-accent); font-weight: 500; }
.listing-id { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 0.25rem; }
.no-listings { color: var(--color-text-muted); font-style: italic; padding: 1rem 0; }

/* ===== Sidebar ===== */
.sidebar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.sidebar-card h3 { font-size: 1.05rem; margin-bottom: 0.75rem; }
.sidebar-card p { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 0.75rem; }
/* ===== Map ===== */
.building-map {
  width: 100%;
  height: 300px;
  border: none;
  border-radius: var(--radius);
}

/* ===== Listing Detail ===== */
.listing-hero-compact {
  background: var(--color-primary);
  color: white;
  padding: 1rem 0;
}
/* Photo gallery layout */
.listing-gallery-section { margin-bottom: 0; }
.gallery-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4px;
  max-height: 450px;
  overflow: hidden;
}
.gallery-main {
  position: relative;
  overflow: hidden;
}
.gallery-main img {
  width: 100%;
  height: 450px;
  object-fit: cover;
  cursor: pointer;
}
.gallery-counter {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
}
.gallery-thumbs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gallery-thumb {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.gallery-thumb-more { cursor: pointer; }
.gallery-more-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  pointer-events: none;
}
.gallery-img { cursor: pointer; }

/* Listing info section */
.listing-info-section {
  padding: 1.5rem 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.listing-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.listing-price-large {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Stat boxes — equal width grid */
.stat-boxes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.stat-box {
  text-align: center;
  padding: 0.6rem 0.5rem;
  background: var(--color-bg-alt, #f8f9fa);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--color-text);
  white-space: nowrap;
}
.stat-box strong { font-weight: 700; }
.stat-box-active { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.stat-box-active strong { color: #fff; }
.heart-btn-inline {
  position: static; width: 38px; height: 100%; min-height: 38px;
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; cursor: pointer; transition: all 0.2s;
}
.heart-btn-inline:hover { color: #ef4444; }
.heart-btn-inline.saved { color: #ef4444; }
.building-name-row {
  display: flex; align-items: center; gap: 0.5rem;
}
.stat-action-btn {
  width: 38px; height: auto; min-height: 38px; padding: 0;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Address & meta */
.listing-full-address {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-heading);
  margin-top: 0.75rem;
}
.listing-address-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.listing-area-link {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}
.listing-area-link:hover { text-decoration: underline; }
.listing-meta-row {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.listing-meta-sep { color: var(--color-text-muted); }
.listing-actions-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Share button */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.share-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.share-btn svg { flex-shrink: 0; }

/* Inline photo navigation arrows */
.listing-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: background 0.2s;
  z-index: 5;
}
.listing-nav-arrow:hover { background: #fff; }
.listing-nav-prev { left: 12px; }
.listing-nav-next { right: 12px; }
.gallery-main { position: relative; }

@media (max-width: 480px) {
  .listing-nav-arrow { width: 34px; height: 34px; }
  .listing-nav-prev { left: 8px; }
  .listing-nav-next { right: 8px; }
}

/* Viewing scheduler */
.viewing-scheduler {
  border-top: 1px solid var(--color-border);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}
.viewing-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}
.viewing-label svg { opacity: 0.6; flex-shrink: 0; }
.viewing-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.viewing-date { flex: 1; }
.viewing-time { flex: 1; }

.listing-content { padding: 2rem 0 3rem; }
.listing-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; align-items: start; }
.listing-section { margin-bottom: 2rem; }
.listing-section h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }

/* About text */
.about-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--color-text);
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  padding: 0.35rem 0;
  color: var(--color-text);
}
.feature-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* Property details grid */
.property-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.pd-item {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.9rem;
}
.pd-item:nth-child(odd) { padding-right: 1.5rem; }
.pd-item:nth-child(even) { padding-left: 1.5rem; border-left: 1px solid var(--color-border-light); }
.pd-label { color: var(--color-text-muted); }
.pd-value { font-weight: 600; }

.listing-map {
  width: 100%;
  height: 350px;
  border: none;
  border-radius: var(--radius);
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: white;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  background: rgba(255,255,255,0.1);
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

/* ===== Floor Plan Button ===== */
.floor-plan-actions {
  margin-bottom: 2rem;
}
.btn-floor-plans {
  gap: 0.5rem;
  font-size: 0.95rem;
}

/* ===== Floor Plan Modal ===== */
.floorplan-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.floorplan-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: white;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}
.floorplan-close:hover { color: var(--color-accent); }
.floorplan-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1000px;
  height: 90vh;
  gap: 0.75rem;
}
.floorplan-title {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.floorplan-iframe {
  flex: 1;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  background: white;
}
.floorplan-bottom {
  display: flex;
  justify-content: center;
}
.floorplan-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
  transition: background 0.2s;
}
.floorplan-download:hover { background: var(--color-accent); }
.floorplan-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}
.floorplan-nav-btn {
  color: white;
  background: rgba(255,255,255,0.1);
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: background 0.2s;
}
.floorplan-nav-btn:hover { background: var(--color-accent); }

@media (max-width: 768px) {
  .floorplan-overlay { padding: 0.75rem; }
  .floorplan-content { height: 95vh; max-width: 100%; }
  .floorplan-nav { gap: 0.5rem; }
}

/* ===== Forms ===== */
.lead-form { display: flex; flex-direction: column; gap: 0.6rem; }
.form-row { display: flex; gap: 0.6rem; }
.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--color-bg);
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--color-accent); outline: none; }
textarea.form-input { resize: vertical; }
.form-status { font-size: 0.85rem; min-height: 1.2em; }
.form-status.success { color: var(--color-success); }
.form-status.error { color: #ef4444; }
.contact-section {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}
.contact-section .lead-form { max-width: 500px; margin: 0 auto; }

/* ===== Footer ===== */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.75);
  padding: 3rem 0 1.5rem;
}
.site-footer .logo { font-size: 1.2rem; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand p { margin-top: 0.75rem; font-size: 0.85rem; line-height: 1.6; }
.footer-links h4 { color: white; font-size: 0.9rem; margin-bottom: 0.75rem; font-weight: 600; }
.footer-links a { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; margin-bottom: 0.5rem; transition: color 0.2s; }
.footer-links a:hover { color: white; }
.footer-contact .footer-info { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; margin-bottom: 0.5rem; }
.footer-contact svg { flex-shrink: 0; opacity: 0.7; }
.footer-bottom {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-mls-attr { font-style: italic; }
.footer-partners { margin-top: 0.5rem; font-size: 0.85rem; }
.footer-partners a { color: rgba(255,255,255,0.7); text-decoration: underline; }
.footer-partners a:hover { color: white; }
.footer-partners span { color: rgba(255,255,255,0.4); margin: 0 0.3rem; }
.footer-brokerage-logo { height: 50px; width: auto; margin-bottom: 0.75rem; filter: brightness(0) invert(1); }
.footer-bottom { flex-direction: column; align-items: center; text-align: center; }

/* ===== Map Page ===== */
.map-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  overflow: hidden;
}
main:has(.map-page) { display: flex; flex-direction: column; overflow: hidden; }
main:has(.map-page) ~ .site-footer { display: none; }
main:has(.map-page) ~ .chat-fab,
main:has(.map-page) ~ .chat-panel,
main:has(.map-page) ~ .contact-fab,
main:has(.map-page) ~ .contact-modal-overlay { display: none !important; }

.map-filter-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.6rem 1rem;
  flex-shrink: 0;
  z-index: 10;
}
.map-filter-inner {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.map-filter-inner .filter-select {
  min-width: 120px;
  font-size: 0.85rem;
  padding: 0.45rem 0.6rem;
}
.filter-price-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.filter-input-price {
  width: 100px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  font-size: 0.85rem;
}
.filter-price-sep {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.map-result-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-left: auto;
  white-space: nowrap;
}

.map-split {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.map-list-panel {
  width: 38%;
  min-width: 320px;
  overflow-y: auto;
  border-right: 1px solid var(--color-border);
  background: var(--color-bg);
  padding: 0.5rem;
}
.map-container {
  flex: 1;
  position: relative;
  z-index: 1;
}

/* List panel cards */
.map-listing-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.65rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.4rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.map-listing-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}
.map-listing-card.highlighted {
  border-color: var(--color-accent);
  background: #f0fdf4;
  box-shadow: 0 0 0 1px var(--color-accent);
}
.mlc-photo {
  width: 110px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mlc-photo img { width: 100%; height: 100%; object-fit: cover; }
.mlc-photo-placeholder { color: var(--color-text-muted); opacity: 0.25; }
.mlc-info { flex: 1; min-width: 0; }
.mlc-price { font-size: 1.05rem; font-weight: 700; color: var(--color-primary); }
.mlc-meta { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.1rem; }
.mlc-addr {
  font-size: 0.8rem; color: var(--color-text);
  margin-top: 0.15rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mlc-ppsf { font-size: 0.75rem; color: var(--color-accent); font-weight: 500; margin-top: 0.1rem; }
.mlc-brokerage {
  font-size: 0.68rem; color: var(--color-text-muted); margin-top: 0.15rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-style: italic;
}

.map-list-empty, .map-list-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Building markers */
.search-building-marker, .building-marker-icon {
  background: none !important;
  border: none !important;
}
.building-marker-icon svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25)); }
.search-building-marker svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25)); }

/* Price pill markers */
.price-pill {
  background: var(--color-primary);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  text-align: center;
  line-height: 1;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.price-pill span {
  display: block;
  padding: 5px 8px;
}
.price-pill::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--color-primary);
}
.price-pill:hover,
.price-pill-active {
  background: var(--color-accent);
  transform: scale(1.15);
  z-index: 1000 !important;
}
.price-pill-active::after,
.price-pill:hover::after {
  border-top-color: var(--color-accent);
}

/* Cluster overrides */
.marker-cluster-small { background: rgba(13, 138, 106, 0.25); }
.marker-cluster-small div { background: rgba(13, 138, 106, 0.7); color: white; font-weight: 700; font-family: var(--font-sans); }
.marker-cluster-medium { background: rgba(26, 58, 74, 0.25); }
.marker-cluster-medium div { background: rgba(26, 58, 74, 0.7); color: white; font-weight: 700; font-family: var(--font-sans); }
.marker-cluster-large { background: rgba(26, 58, 74, 0.35); }
.marker-cluster-large div { background: rgba(26, 58, 74, 0.85); color: white; font-weight: 700; font-family: var(--font-sans); }

/* Mobile toggle */
.map-mobile-toggle {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  gap: 0.4rem;
  box-shadow: var(--shadow-lg);
  padding: 0.65rem 1.5rem;
  border-radius: 2rem;
}

/* ===== Search Page ===== */
.search-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  padding: 4rem 0 3rem;
  overflow: visible;
  position: relative;
  z-index: 60;
  text-align: center;
}
.search-hero-compact { padding: 2.5rem 0 2rem; }
.search-hero-compact h1 { margin-bottom: 1.2rem; }
.search-hero h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
.search-box-wrap { max-width: 640px; margin: 0 auto; }
.search-box {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.search-box-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  z-index: 1;
}
.search-box-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1.1rem;
  color: var(--color-text);
  background: transparent;
  outline: none;
}
.search-box-input::placeholder { color: var(--color-text-muted); }
.search-box-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 2;
}
.search-box-btn:hover { background: var(--color-accent-hover); }

/* Autocomplete dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% - 4px);
  left: 0;
  right: 0;
  background: white;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  z-index: 200;
  border-top: 1px solid var(--color-border-light);
}
.search-dropdown.hidden { display: none; }
/* Note: generic .hidden utility handles grid/map section toggling */
.search-group-label {
  padding: 0.6rem 1rem 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.search-group-label svg { opacity: 0.5; }
.search-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0.5rem 1.75rem;
  cursor: pointer;
  transition: background 0.1s;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}
.search-item:hover, .search-item.selected {
  background: var(--color-border-light);
}
.search-item-label {
  font-weight: 500;
  color: var(--color-text);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.search-item-detail {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-item-detail::before {
  content: "—";
  margin-right: 0.4rem;
  opacity: 0.4;
}
.search-no-results {
  padding: 1.25rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Results section below hero */
/* Search filter bar */
.search-filters-section {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0 0.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.search-filter-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.filter-spacer { flex: 1; }
.search-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  gap: 0.5rem;
}
.search-result-count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.save-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.save-search-btn.saved { color: var(--color-primary); border-color: var(--color-primary); pointer-events: none; }

/* Checkbox filter dropdowns */
.filter-group { position: relative; }
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--color-text);
  transition: border-color 0.15s;
  white-space: nowrap;
}
.filter-toggle:hover, .filter-toggle.open { border-color: var(--color-accent); }
.filter-toggle.has-selection { border-color: var(--color-accent); color: var(--color-accent); font-weight: 600; }
.filter-toggle svg { transition: transform 0.2s; }
.filter-toggle.open svg { transform: rotate(180deg); }
.filter-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  z-index: 100;
}
.filter-dropdown.open { display: block; }
.cb-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s;
  font-size: 0.85rem;
}
.cb-filter:hover { background: var(--color-border-light); }
.cb-filter input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* Active filter pills */
.search-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.search-active-filters:empty { display: none; }
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.filter-pill:hover { opacity: 0.8; }
.filter-pill span { font-size: 0.9rem; line-height: 1; }

/* View toggle (grid / map) */
.view-toggle {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.view-btn:not(:last-child) { border-right: 1px solid var(--color-border); }
.view-btn:hover { color: var(--color-text); background: var(--color-border-light); }
.view-btn.active { background: var(--color-accent); color: white; }

/* Search map split view */
.search-map-section { border-top: 1px solid var(--color-border); }
.search-map-split {
  display: flex;
  height: calc(100vh - 180px);
  overflow: hidden;
}
.search-map-list {
  width: 38%;
  min-width: 320px;
  overflow-y: auto;
  border-right: 1px solid var(--color-border);
  background: var(--color-bg);
  padding: 0.5rem;
}
.search-map-container {
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Search grid */
.search-grid-section { padding: 2rem 0 3rem; }
.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.search-grid-loading, .search-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-text-muted);
}
.search-grid-empty svg { margin-bottom: 1rem; opacity: 0.3; }
.search-grid-empty p { margin-bottom: 1rem; }

/* Search grid cards */
.sg-card {
  display: block;
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
}
.sg-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}
.sg-photo {
  aspect-ratio: 16 / 10;
  background: var(--color-border-light);
  overflow: hidden;
}
.sg-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sg-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  opacity: 0.3;
}
.sg-body { padding: 0.85rem 1rem 1rem; }
.sg-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
}
.sg-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}
.sg-addr {
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sg-area {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.1rem;
}
.sg-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.sg-ppsf { font-weight: 500; }

/* Pagination */
.search-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2rem;
  padding: 1rem 0;
}
.pg-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  transition: all 0.15s;
}
.pg-btn:hover:not(.pg-disabled):not(.pg-active) {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.pg-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}
.pg-disabled {
  opacity: 0.3;
  cursor: default;
}
.pg-ellipsis {
  width: 36px;
  text-align: center;
  color: var(--color-text-muted);
}

/* ===== Sales History Table ===== */
.sales-history-table-wrap { overflow-x: auto; }
.sales-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.sales-history-table th {
  text-align: left;
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sales-history-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--color-border-light);
}
.sales-history-table tr:hover td { background: var(--color-bg); }
.sh-price { font-weight: 600; color: var(--color-primary); }

/* ===== Mortgage Calculator ===== */
.mortgage-calc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.mc-inputs { display: flex; flex-direction: column; gap: 1rem; }
.mc-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}
.mc-field input[type="number"],
.mc-field select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--color-surface);
}
.mc-field input:focus, .mc-field select:focus {
  outline: none;
  border-color: var(--color-accent);
}
.mc-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.mc-row input[type="range"] { flex: 1; accent-color: var(--color-accent); }
.mc-pct { width: 65px !important; flex-shrink: 0; }

.mc-result {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.mc-monthly {
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}
.mc-monthly-label {
  display: block;
  font-size: 0.8rem;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}
.mc-monthly-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
}
.mc-breakdown {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.8;
}
.mc-breakdown .mc-line {
  display: flex;
  justify-content: space-between;
  padding: 0.15rem 0;
}
.mc-breakdown .mc-line-val { font-weight: 600; color: var(--color-text); }

.mc-ad-slot {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.mc-ad-placeholder span {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-primary);
}
.mc-ad-placeholder small {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

/* ===== Similar Listings (horizontal scroll) ===== */
.similar-listings-section {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0 2.5rem;
  background: var(--color-bg);
}
.similar-listings-section h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}
.scroll-wrap {
  position: relative;
}
.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, box-shadow 0.2s;
  color: var(--color-text);
}
.scroll-arrow:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.18); }
.scroll-arrow.hidden { opacity: 0; pointer-events: none; }
.scroll-arrow-left { left: -12px; }
.scroll-arrow-right { right: -12px; }
.similar-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.similar-scroll::-webkit-scrollbar { height: 6px; }
.similar-scroll::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

.similar-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}
.similar-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}
.similar-photo {
  position: relative;
  height: 140px;
  background: linear-gradient(135deg, #2a4a5a 0%, #1a3a4a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.similar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.similar-photo-placeholder { color: rgba(255,255,255,0.3); }
.similar-price {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.88rem;
}
.similar-body { padding: 0.75rem; }
.similar-addr {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.similar-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .building-layout, .listing-layout {
    grid-template-columns: 1fr;
  }
  .building-sidebar .sidebar-contact,
  .listing-sidebar .sidebar-contact { display: none; }
  .building-sidebar, .listing-sidebar { order: -1; }
  .gallery-layout { grid-template-columns: 1fr; max-height: 300px; }
  .gallery-thumbs { flex-direction: row; }
  .gallery-main img { height: 300px; }
  .property-details-grid { grid-template-columns: 1fr; }
  .pd-item:nth-child(even) { padding-left: 0; border-left: none; }
  .pd-item:nth-child(odd) { padding-right: 0; }
  .listings-grid:not(.saved-grid) {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 0.5rem;
    grid-template-columns: none;
  }
  .listings-grid:not(.saved-grid) > * {
    flex: 0 0 280px;
    scroll-snap-align: start;
  }
  .buildings-grid:not(.saved-grid) {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 0.5rem;
    grid-template-columns: none;
  }
  .buildings-grid:not(.saved-grid) > * {
    flex: 0 0 260px;
    scroll-snap-align: start;
  }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; }
  .main-nav.open {
    display: flex; flex-direction: column; align-items: stretch; text-align: left;
    position: absolute; top: 56px; left: 0; right: 0;
    background: var(--color-primary); padding: 0.5rem 1.25rem; gap: 0; box-shadow: var(--shadow-lg); z-index: 100;
    max-height: calc(100vh - 56px); overflow-y: auto;
  }
  .main-nav.open > a, .main-nav.open > .nav-dropdown > a {
    display: block; padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 0.9rem;
    text-align: left;
  }
  .main-nav.open > a:last-child { border-bottom: none; }
  .main-nav.open .nav-dropdown { border-bottom: 1px solid rgba(255,255,255,0.08); }
  .main-nav.open .nav-dropdown:last-of-type { border-bottom: none; }
  .main-nav.open .nav-dropdown > a { position: relative; padding-right: 1.5rem; }
  .main-nav.open .nav-dropdown > a::after {
    content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    border: 5px solid transparent; border-top: 5px solid rgba(255,255,255,0.5);
    transition: transform 0.2s;
  }
  .main-nav.open .nav-dropdown.sub-open > a::after { transform: translateY(-50%) rotate(180deg); }
  /* Hamburger → X animation */
  .mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
  .mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
  .mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }
  /* Force all dropdown submenus closed by default on mobile */
  .nav-dropdown-menu { display: none !important; }
  .main-nav.open .mobile-menu-extras {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding-top: 0.75rem; margin-top: 0.25rem; border-top: 1px solid rgba(255,255,255,0.15);
  }
  .main-nav.open .mobile-menu-extras a {
    display: flex; align-items: center; gap: 0.4rem;
    color: rgba(255,255,255,0.85); font-size: 0.9rem; font-weight: 500; padding: 0.4rem 0;
  }
  .header-right { display: none; }
  .header-phone { display: none; }
  .mobile-menu-btn { display: flex; }
  .filter-bar { flex-direction: column; }
  .filter-select, .filter-search { width: 100%; }
  .form-row { flex-direction: column; }
  .listing-card { flex-direction: column; }
  .listing-photo { width: 100%; height: 160px; }
  .buildings-grid.saved-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .amenities-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: 1fr; }
  .listing-price-row { flex-wrap: wrap; }
  .mortgage-calc { grid-template-columns: 1fr; }
  .similar-card { flex: 0 0 180px; }
  .similar-photo { height: 110px; }

  /* Search page mobile */
  .search-hero { padding: 2rem 0 1.5rem; }
  .search-hero-compact { padding: 1.5rem 0 1.2rem; }
  .search-hero h1 { font-size: 1.4rem; }
  .search-filter-bar { gap: 0.4rem; }
  .search-filter-bar .filter-select,
  .search-filter-bar .filter-input-price { font-size: 0.8rem; padding: 0.4rem 0.5rem; }
  .filter-toggle { font-size: 0.8rem; padding: 0.4rem 0.6rem; }
  .search-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
  .search-map-split { position: relative; height: calc(100vh - 140px); }
  .search-map-container { width: 100%; height: 100%; }
  .search-map-list {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 500;
    width: 100%; min-width: 0; max-height: none; height: auto;
    border-right: none; border-top: none;
    background: transparent; padding: 0;
    display: flex; flex-direction: row;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem; padding: 0.5rem 0.5rem 0.75rem;
    pointer-events: none;
  }
  .search-map-list > * { pointer-events: auto; }
  .search-map-list .map-listing-card {
    flex: 0 0 280px; scroll-snap-align: start;
    flex-direction: row; background: white;
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    border: none; padding: 0; overflow: hidden;
  }
  .search-map-list .mlc-photo { width: 100px; height: 90px; border-radius: 0; }
  .search-map-list .mlc-info { padding: 0.5rem 0.6rem; }
  .search-map-list .map-listing-card.highlighted {
    border: 2px solid var(--color-accent);
    background: white;
  }
  .search-map-list .map-list-empty {
    flex: 0 0 100%; background: rgba(255,255,255,0.95);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 1rem; font-size: 0.85rem;
  }

  /* Map page mobile */
  .map-page { height: calc(100dvh - 56px); }
  .map-split { flex-direction: column; position: relative; flex: 1; min-height: 0; }
  .map-list-panel { width: 100%; min-width: 0; height: 100%; border-right: none; }
  .map-container { width: 100%; height: 100%; display: none; }
  .map-page.show-map .map-container { display: block; }
  .map-page.show-map .map-list-panel {
    position: absolute; bottom: 3.5rem; left: 0; right: 0; z-index: 500;
    width: 100%; height: auto; max-height: none;
    background: transparent; padding: 0;
    display: flex; flex-direction: row;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem; padding: 0.5rem 0.5rem 0.75rem;
    touch-action: pan-x;
    pointer-events: auto;
  }
  .map-page.show-map .map-list-panel .map-listing-card {
    flex: 0 0 280px; scroll-snap-align: start;
    flex-direction: row; background: white;
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    border: none; padding: 0; overflow: hidden;
  }
  .map-page.show-map .map-list-panel .mlc-photo { width: 100px; height: 90px; border-radius: 0; }
  .map-page.show-map .map-list-panel .mlc-info { padding: 0.5rem 0.6rem; }
  .map-page.show-map .map-list-panel .heart-btn {
    position: absolute; top: 0.3rem; right: 0.3rem;
    width: 28px; height: 28px; z-index: 3;
  }
  .map-page.show-map .map-list-panel .heart-btn svg { width: 14px; height: 14px; }
  .map-page.show-map .map-list-panel .map-listing-card.highlighted {
    border: 2px solid var(--color-accent); background: white;
  }
  .map-page.show-map .map-list-panel .map-list-empty {
    flex: 0 0 100%; background: rgba(255,255,255,0.95);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 1rem; font-size: 0.85rem; pointer-events: auto;
  }
  .map-mobile-toggle { display: inline-flex; }
  .map-filter-inner { gap: 0.35rem; }
  .map-filter-inner .filter-select { min-width: 0; flex: 1; font-size: 0.8rem; }
  .filter-price-group { width: 100%; }
  .filter-input-price { flex: 1; }
  .main-nav.open .nav-dropdown.sub-open .nav-dropdown-menu {
    display: block !important;
    position: static;
    transform: none;
    background: transparent;
    box-shadow: none;
    padding: 0 0 0.25rem 1rem;
    min-width: 0;
    margin-top: 0;
  }
  .main-nav.open .nav-dropdown-menu a {
    color: rgba(255,255,255,0.65) !important; padding: 0.3rem 0; font-size: 0.85rem;
    border-bottom: none;
  }
  .main-nav.open .nav-dropdown-menu a:hover { background: transparent; color: white !important; }
}

/* ===== Breadcrumbs ===== */
.breadcrumb { margin-bottom: 0.75rem; }
.breadcrumb ol {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
  overflow: hidden;
  white-space: nowrap;
}
.breadcrumb li { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb li.current { flex-shrink: 1; }
.breadcrumb li { display: flex; align-items: center; color: rgba(255,255,255,0.6); }
.breadcrumb li + li::before {
  content: "/";
  margin: 0 0.5rem;
  color: rgba(255,255,255,0.4);
}
.breadcrumb li a { color: rgba(255,255,255,0.8); }
.breadcrumb li a:hover { color: white; text-decoration: underline; }
.breadcrumb li.current { font-weight: 500; color: white; }
.page-header .breadcrumb li { color: rgba(255,255,255,0.6); }
.page-header .breadcrumb li a { color: rgba(255,255,255,0.8); }
.page-header .breadcrumb li a:hover { color: white; }
.page-header .breadcrumb li.current { color: white; }
.page-header .breadcrumb li + li::before { color: rgba(255,255,255,0.4); }

/* ===== Filter toggle + map toggle ===== */
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
}
.filter-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent);
}
.btn-map-toggle { white-space: nowrap; gap: 0.35rem; }

/* ===== Buildings split view ===== */
.buildings-split { display: flex; gap: 0; min-height: 600px; }
.buildings-list-panel { flex: 1; }
.buildings-map-panel {
  flex: 1;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  border-left: 1px solid var(--color-border);
}
.buildings-map-panel.hidden { display: none; }
.buildings-split:not(.split-active) .buildings-list-panel { flex: 1; }
.buildings-split.split-active .buildings-list-panel {
  width: 38%;
  min-width: 320px;
  flex: 0 0 38%;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  padding: 0.5rem;
}
.buildings-split.split-active .buildings-grid {
  grid-template-columns: 1fr;
  gap: 0.4rem;
}
/* Compact card style in split view — match map page listing cards */
.buildings-split.split-active .building-card {
  display: flex;
  flex-direction: row;
  border-radius: var(--radius);
  border-width: 2px;
}
.buildings-split.split-active .building-card:hover {
  transform: none;
}
.buildings-split.split-active .card-image {
  width: 110px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 6px;
  margin: 0.65rem 0 0.65rem 0.65rem;
}
.buildings-split.split-active .card-image-placeholder {
  width: 28px;
  height: 28px;
}
.buildings-split.split-active .card-badges { display: none; }
.buildings-split.split-active .card-body {
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.buildings-split.split-active .card-title {
  font-size: 0.9rem;
  margin-bottom: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.buildings-split.split-active .card-address {
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.buildings-split.split-active .card-price-body {
  font-size: 0.9rem;
  margin-top: 0.2rem;
}
.buildings-split.split-active .card-meta {
  margin-top: 0.2rem;
  font-size: 0.72rem;
}

/* Building map pills */
.bldg-map-pill span {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  color: white;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ===== Homepage ===== */
.hp-hero {
  background: linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url('/docs/homepage_banners/white-rock-pier-ocean-view-south-surrey-real-estate.jpg') no-repeat center center;
  background-size: cover;
  padding: 6rem 0 5rem;
}
.hp-hero h1 { font-size: 2.8rem; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
/* Section styles */
.hp-section {
  padding: 3.5rem 0;
}
.hp-section-alt {
  background: var(--color-bg);
}
.hp-section-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}
.hp-divider {
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  margin: 1rem auto 2rem;
  border-radius: 2px;
}
.hp-cta {
  text-align: center;
  margin-top: 2rem;
}
.btn-outline {
  display: inline-block;
  padding: 0.65rem 2rem;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.btn-outline:hover {
  background: var(--color-primary);
  color: white;
}

/* Newest listings grid */
.hp-listing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.listing-card-lg .card-price-body {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.2rem;
}
.card-brokerage {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
  opacity: 0.7;
}
.card-pill-oh {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* New developments grid */
.hp-building-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* Search Properties boxes */
.hp-search-boxes {
  max-width: 900px;
  margin: 0 auto;
}
.hp-search-row-top {
  display: grid;
  grid-template-columns: 59% 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.hp-search-row-bottom {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.hp-search-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s;
}
.hp-search-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
  transition: background 0.2s;
}
.hp-search-box:hover::before { background: rgba(0,0,0,0.35); }
.hp-search-box:hover { transform: scale(1.02); }
.hp-search-box-label {
  position: relative;
  z-index: 1;
  color: white;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
  padding: 1rem;
  line-height: 1.3;
}

/* Quick Search boxes */
.hp-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.hp-quick-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.quick-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 2rem 1.5rem;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s;
}
.quick-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
  transition: background 0.2s;
}
.quick-box:hover::before { background: rgba(0,0,0,0.35); }
.quick-box:hover { transform: scale(1.02); }
.quick-box-label {
  position: relative;
  z-index: 1;
  color: white;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
  line-height: 1.4;
}

/* Homepage responsive */
@media (max-width: 900px) {
  .hp-listing-grid, .hp-building-grid { grid-template-columns: repeat(2, 1fr); }
  .hp-search-row-top { grid-template-columns: 1fr; }
  .hp-search-row-bottom { grid-template-columns: 1fr 1fr; }
  .hp-quick-grid { grid-template-columns: 1fr 1fr; }
  .hp-hero h1 { font-size: 2rem; }
}
@media (max-width: 600px) {
  .hp-listing-grid, .hp-building-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 0.5rem;
    grid-template-columns: none;
  }
  .hp-listing-grid > *, .hp-building-grid > * {
    flex: 0 0 280px;
    scroll-snap-align: start;
  }
  .hp-search-row-bottom { grid-template-columns: 1fr; }
  .hp-quick-grid { grid-template-columns: 1fr; }
}

/* ===== Resources Page ===== */
.resources-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}
.resources-hero h1 { font-size: 2.2rem; font-weight: 700; margin: 0; }
.resources-hero p { color: rgba(255,255,255,0.8); margin-top: 0.5rem; font-size: 1.05rem; }
.resources-section { padding: 3rem 0; }
.resources-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.resource-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.resource-card:hover { box-shadow: var(--shadow-lg); }
.resource-image {
  width: 100%;
  height: 100%;
  min-height: 180px;
  overflow: hidden;
}
.resource-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.resource-body {
  padding: 1.5rem 1.5rem 1.5rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.resource-body h2 { font-size: 1.2rem; margin: 0 0 0.75rem; line-height: 1.3; }
.resource-body h2 a { color: var(--color-text); transition: color 0.2s; }
.resource-body h2 a:hover { color: var(--color-accent); }
.resource-body p { color: var(--color-text-muted); font-size: 0.9rem; line-height: 1.6; margin: 0 0 1rem; }
.resource-read-more {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.9rem;
}
.resource-read-more:hover { color: var(--color-accent-hover); }

@media (max-width: 700px) {
  .resource-card { grid-template-columns: 1fr; }
  .resource-body { padding: 1rem; }
  .resource-image { min-height: 160px; }
}

/* ===== Area Landing Pages ===== */

.area-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  padding: 2.5rem 0 2rem;
}
.area-hero h1 { font-size: 2rem; margin: 0 0 0.25rem; }
.area-hero .breadcrumb a { color: rgba(255,255,255,0.7); }
.area-hero .breadcrumb .current { color: rgba(255,255,255,0.9); }
.area-tagline { font-size: 1.1rem; opacity: 0.85; margin: 0; }

/* Stats bar */
.area-stats-section { padding: 1.5rem 0; background: var(--color-bg-alt, #f8f9fa); }
.area-stats-bar {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.area-stat-box {
  text-align: center;
  padding: 1rem 2rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  min-width: 140px;
}
.area-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--color-primary); }
.area-stat-label { font-size: 0.8rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 0.25rem; }

/* About section */
.area-about-section { padding: 2.5rem 0; }
.area-about-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}
.area-about-text h2 { margin: 0 0 0.75rem; font-size: 1.4rem; }
.area-about-text p { color: var(--color-text-muted); line-height: 1.7; margin: 0 0 1rem; }
.area-sold-summary { font-weight: 500; color: var(--color-text); }
.area-sold-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.area-sold-type {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.area-type-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.area-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--color-bg-alt, #f8f9fa);
  border: 1px solid var(--color-border-light);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 0.15s;
}
.area-type-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.area-type-count { font-weight: 600; color: var(--color-primary); }

.area-highlights {
  background: var(--color-bg-alt, #f8f9fa);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--color-border-light);
}
.area-highlights h3 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.area-highlights-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.area-highlights-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text);
}
.area-highlights-list svg { color: var(--color-accent); flex-shrink: 0; }

.area-cta { text-align: center; margin-top: 1.5rem; }

/* Area view toggle (list / map) */
.area-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.area-view-header h2 { margin: 0; font-size: 1.4rem; }
.area-view-toggle {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.area-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.area-toggle-btn:not(:last-child) { border-right: 1px solid var(--color-border); }
.area-toggle-btn.active {
  background: var(--color-primary);
  color: white;
}
.area-toggle-btn:hover:not(.active) { background: var(--color-border-light); }
.area-toggle-btn svg { flex-shrink: 0; }

/* Area map legend */
.area-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.legend-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
}
.legend-highrise { background: #1a3a4a; }
.legend-lowrise { background: #24506a; }
.legend-townhouse { background: #0d8a6a; }
.legend-listing { background: #ef4444; border-radius: 50%; }

/* Leaflet marker overrides */
.area-building-marker {
  background: none !important;
  border: none !important;
}
.area-building-marker svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25)); }

/* Leaflet popup styling */
#area-leaflet-map .leaflet-popup-content-wrapper {
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
}
#area-leaflet-map .leaflet-popup-content { margin: 10px 14px; }
#area-leaflet-map .leaflet-popup-content a {
  color: var(--color-accent);
  font-weight: 500;
}

/* Area content section */
.area-content-section { padding: 2rem 0; }

/* Area map filter bar */
.area-map-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.area-map-filter-bar .filter-select,
.area-map-filter-bar .filter-input-price {
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
}
.area-map-filter-bar .map-result-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Area map split layout */
.area-map-split {
  display: flex;
  height: 600px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
}
.area-map-list {
  width: 340px;
  min-width: 340px;
  overflow-y: auto;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border-light);
}
.area-map-container {
  flex: 1;
  min-width: 0;
}

/* Contextual inline area links in blog content */
.area-inline-link { color: var(--color-accent); text-decoration: none; border-bottom: 1px dotted var(--color-accent); }
.area-inline-link:hover { border-bottom-style: solid; }

/* Property type cross-links */
.type-cross-links-section { padding: 2rem 0; border-top: 1px solid var(--color-border); }
.type-cross-links-section h2 { margin-bottom: 1rem; font-size: 1.2rem; }
.type-cross-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.type-cross-link {
  display: inline-block; padding: 0.5rem 1rem; border: 1px solid var(--color-border);
  border-radius: 999px; text-decoration: none; color: var(--color-text);
  font-size: 0.88rem; transition: border-color 0.2s, background 0.2s;
}
.type-cross-link:hover { border-color: var(--color-accent); background: var(--color-accent-bg, rgba(0,119,182,0.05)); }

/* Browse by property type grid */
.area-browse-type-section { padding: 2rem 0; border-top: 1px solid var(--color-border); }
.area-browse-type-section h2 { margin-bottom: 1rem; }
.area-browse-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.75rem; }
.area-browse-type-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1.25rem 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius);
  text-decoration: none; color: var(--color-text); text-align: center;
  font-size: 0.88rem; font-weight: 500; transition: border-color 0.2s, box-shadow 0.2s;
}
.area-browse-type-card:hover { border-color: var(--color-accent); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.area-browse-type-card svg { color: var(--color-accent); }

/* Area guides / blog posts section */
.area-guides-section { padding: 2rem 0; border-top: 1px solid var(--color-border); }
.area-guides-section h2 { margin-bottom: 1rem; }
.area-guides-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.area-guide-card {
  display: block; border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow 0.2s;
}
.area-guide-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.area-guide-card img { width: 100%; height: 140px; object-fit: cover; }
.area-guide-body { padding: 0.75rem 1rem; }
.area-guide-category { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; color: var(--color-accent); }
.area-guide-body h3 { font-size: 0.95rem; margin: 0.25rem 0; }
.area-guide-body p { font-size: 0.82rem; color: var(--color-text-muted); margin: 0; }

/* Related neighbourhoods */
.area-related-section { padding: 2.5rem 0; border-top: 1px solid var(--color-border); }
.area-related-section h2 { margin-bottom: 1.25rem; }
.area-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.area-related-card {
  display: block; border: 1px solid var(--color-border);
  border-radius: var(--radius); text-decoration: none; color: inherit;
  overflow: hidden; transition: border-color 0.2s, box-shadow 0.2s;
}
.area-related-card:hover {
  border-color: var(--color-accent); box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.area-related-img { width: 100%; height: 160px; overflow: hidden; }
.area-related-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.area-related-card:hover .area-related-img img { transform: scale(1.05); }
.area-related-body { padding: 1rem 1.25rem; }
.area-related-card h3 { font-size: 1.05rem; margin: 0 0 0.35rem; }
.area-related-card p { font-size: 0.88rem; color: var(--color-text-muted); margin: 0 0 0.5rem; }
.area-related-arrow { font-size: 0.85rem; color: var(--color-accent); font-weight: 600; }

/* Area contact CTA */
.area-contact-section { padding: 2.5rem 0; }
.area-contact-box {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
}
.area-contact-box h2 { margin: 0 0 0.5rem; font-size: 1.5rem; }
.area-contact-box p { opacity: 0.85; margin: 0 0 1.25rem; }
.area-lead-form { max-width: 700px; margin: 0 auto; }
.area-lead-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.area-lead-row .form-input {
  flex: 1;
  min-width: 150px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
}
.area-lead-row .form-input::placeholder { color: rgba(255,255,255,0.6); }
.area-lead-row .btn { white-space: nowrap; }

/* Area index page */
.area-index-section { padding: 2rem 0; }
.area-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.area-index-card {
  display: block;
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.area-index-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.area-index-card h3 { margin: 0 0 0.25rem; font-size: 1.2rem; color: var(--color-primary); }
.area-index-tagline { margin: 0 0 0.75rem; font-size: 0.9rem; color: var(--color-text-muted); }
.area-index-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.area-index-stats span { font-weight: 500; }

@media (max-width: 768px) {
  .area-about-layout { grid-template-columns: 1fr; }
  .area-stats-bar { flex-direction: column; align-items: stretch; }
  .area-stat-box { padding: 0.75rem 1rem; min-width: 0; display: flex; justify-content: space-between; align-items: center; }
  .area-stat-value { font-size: 1.2rem; }
  .area-lead-row { flex-direction: column; }
  .area-hero h1 { font-size: 1.5rem; }
  .area-view-header { flex-direction: column; align-items: stretch; }
  .area-view-toggle { align-self: flex-start; }
  .area-map-filter-bar { gap: 0.35rem; }
  .area-map-filter-bar .filter-select,
  .area-map-filter-bar .filter-input-price { font-size: 0.8rem; padding: 0.35rem 0.5rem; }
  .area-map-filter-bar .filter-price-group { width: 100%; }
  .area-map-split { position: relative; height: calc(100dvh - 200px); min-height: 400px; flex-direction: column; border: none; }
  .area-map-container { width: 100%; height: 100%; }
  .area-map-list {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 500;
    width: 100%; min-width: 0; max-height: none; height: auto;
    border-right: none; border-top: none;
    background: transparent; padding: 0;
    display: flex; flex-direction: row;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem; padding: 0.5rem 0.5rem 0.75rem;
    pointer-events: none;
  }
  .area-map-list > * { pointer-events: auto; }
  .area-map-list .map-listing-card {
    flex: 0 0 280px; scroll-snap-align: start;
    flex-direction: row; background: white;
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    border: none; padding: 0; overflow: hidden;
  }
  .area-map-list .mlc-photo { width: 100px; height: 90px; border-radius: 0; }
  .area-map-list .mlc-info { padding: 0.5rem 0.6rem; }
  .area-map-list .map-listing-card.highlighted { border: 2px solid var(--color-accent); }
  .area-map-list .map-list-empty {
    flex: 0 0 280px; background: white; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 1rem; text-align: center;
  }
  .area-map-legend { gap: 0.5rem; font-size: 0.78rem; padding: 0.5rem 0.75rem; }
}

/* ===== Contact Page ===== */

.contact-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  padding: 2.5rem 0 2rem;
}
.contact-hero h1 { font-size: 2rem; margin: 0 0 0.25rem; }
.contact-hero .breadcrumb a { color: rgba(255,255,255,0.7); }
.contact-hero .breadcrumb .current { color: rgba(255,255,255,0.9); }
.contact-sub { font-size: 1.05rem; opacity: 0.85; margin: 0; }

.contact-section { padding: 2.5rem 0; }
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

/* Contact form */
.contact-form-panel h2 { margin: 0 0 1.25rem; font-size: 1.4rem; }
.contact-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.contact-field { margin-bottom: 0.75rem; }
.contact-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: var(--color-text);
}

/* Contact info sidebar */
.contact-info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.contact-info-card h3 { margin: 0 0 1rem; font-size: 1.15rem; }

.contact-methods { display: flex; flex-direction: column; gap: 0.75rem; }
.contact-method {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}
a.contact-method:hover { background: var(--color-bg-alt, #f8f9fa); }
.contact-method-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-bg-alt, #f8f9fa);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-primary);
}
.contact-method strong { display: block; font-size: 0.85rem; }
.contact-method span { font-size: 0.9rem; color: var(--color-text-muted); }

.contact-quick-links { display: flex; flex-direction: column; gap: 0.5rem; }
.contact-quick-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-primary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.35rem 0;
  transition: color 0.15s;
}
.contact-quick-links a:hover { color: var(--color-accent); }

/* Contact map */
.contact-map-section { padding: 0 0 2.5rem; }
.contact-map {
  width: 100%;
  height: 350px;
  border: none;
  border-radius: var(--radius-lg);
}

@media (max-width: 768px) {
  .contact-layout { grid-template-columns: 1fr; }
  .contact-form-row { grid-template-columns: 1fr; }
  .contact-hero h1 { font-size: 1.5rem; }
}

/* ===== Auth Nav ===== */
.header-saved, .header-signin {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s;
  white-space: nowrap;
}
.header-saved:hover, .header-signin:hover { color: #fff; }
.header-admin-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
}
.header-admin-link:hover { color: #fff; border-color: rgba(255,255,255,0.6); }
.building-developer {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}
.saved-count {
  background: var(--color-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.header-logout-form { display: inline; }
.header-link-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.header-link-btn:hover { color: #fff; }
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ===== Login Page ===== */
.login-section {
  padding: 4rem 0;
  min-height: 60vh;
  display: flex;
  align-items: center;
}
.login-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.login-card h1 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}
.login-card > p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.login-form .form-input {
  text-align: left;
  font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
}
.login-tabs {
  display: flex;
  margin: -2.5rem -2.5rem 1.5rem;
  border-bottom: 2px solid var(--color-border);
}
.login-tab {
  flex: 1;
  padding: 1rem;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}
.login-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.login-tab:hover { color: var(--color-primary); }
.login-tab-content { display: none; }
.login-tab-content.active { display: block; }
.login-field { text-align: left; margin-bottom: 0.75rem; }
.login-field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--color-text); }
.terms-box {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  background: var(--color-bg);
  margin-bottom: 0.75rem;
  text-align: left;
}
.terms-box h3 { font-size: 0.85rem; color: var(--color-text); margin: 0.75rem 0 0.25rem; }
.terms-box h3:first-child { margin-top: 0; }
.terms-box ul { padding-left: 1.2rem; }
.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}
.terms-check input { margin-top: 0.2rem; }
.login-success {
  color: var(--color-accent);
}
.login-success svg { margin: 0 auto 1rem; }
.login-error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.login-error-block {
  background: #fef2f2;
  color: #b91c1c;
  padding: 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  text-align: center;
}
.login-error-block a { color: var(--color-accent); }
.login-success-msg {
  background: #f0fdf4;
  color: #166534;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.login-forgot {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}
.login-forgot a { color: var(--color-text-muted); }
.login-forgot a:hover { color: var(--color-accent); }
.login-back {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
}
.login-back a { color: var(--color-accent); }

/* ===== Blog ===== */
.blog-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  padding: 2.5rem 0 2rem;
}
.blog-hero h1 { font-size: 2rem; margin: 0 0 0.25rem; }
.blog-hero .breadcrumb a { color: rgba(255,255,255,0.7); }
.blog-hero .breadcrumb .current { color: rgba(255,255,255,0.9); }
.blog-hero-sub { font-size: 1.05rem; opacity: 0.85; margin: 0; }

.blog-hero-compact {
  background: var(--color-primary);
  color: white;
  padding: 1.5rem 0 1rem;
}
.blog-hero-compact .breadcrumb a { color: rgba(255,255,255,0.7); }
.blog-hero-compact .breadcrumb .current { color: rgba(255,255,255,0.9); }

.blog-grid-section { padding: 2.5rem 0; }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.blog-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.blog-card-link { display: block; text-decoration: none; color: inherit; }
.blog-card-image { height: 200px; overflow: hidden; background: var(--color-bg); }
.blog-card-image img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}
.blog-card-body { padding: 1.25rem; }
.blog-card-title { font-size: 1.1rem; margin: 0 0 0.5rem; line-height: 1.3; }
.blog-card-excerpt {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
/* Blog category/tag styles */
.blog-card-category {
  display: inline-block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--color-accent); margin-bottom: 0.25rem;
}
.blog-card-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.blog-tag-chip {
  font-size: 0.72rem; padding: 0.15rem 0.5rem; background: var(--color-bg-alt, #f5f5f5);
  border-radius: 999px; color: var(--color-text-muted);
}
.blog-article-category {
  display: inline-block; font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--color-accent); text-decoration: none; margin-bottom: 0.5rem;
}
.blog-article-category:hover { text-decoration: underline; }
.blog-post-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }

/* Blog index layout with sidebar */
.blog-index-layout { display: grid; grid-template-columns: 1fr 260px; gap: 2rem; }
@media (max-width: 768px) { .blog-index-layout { grid-template-columns: 1fr; } }
.blog-index-main { min-width: 0; }
.blog-index-sidebar {}
.blog-sidebar-section { margin-bottom: 1.5rem; }
.blog-sidebar-section h3 { font-size: 0.95rem; margin-bottom: 0.5rem; }
.blog-sidebar-links { display: flex; flex-direction: column; gap: 0.25rem; }
.blog-sidebar-link {
  display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0.6rem;
  text-decoration: none; color: var(--color-text); font-size: 0.88rem;
  border-radius: var(--radius); transition: background 0.15s;
}
.blog-sidebar-link:hover { background: var(--color-bg-alt, #f5f5f5); }
.blog-sidebar-link.active { background: var(--color-accent-bg, rgba(0,119,182,0.08)); color: var(--color-accent); font-weight: 600; }
.blog-sidebar-count { font-size: 0.78rem; color: var(--color-text-muted); }
.blog-tag-cloud { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.blog-tag-link {
  display: inline-block; padding: 0.3rem 0.65rem; font-size: 0.8rem; text-decoration: none;
  border: 1px solid var(--color-border); border-radius: 999px; color: var(--color-text);
  transition: border-color 0.2s, background 0.2s;
}
.blog-tag-link:hover { border-color: var(--color-accent); background: var(--color-accent-bg, rgba(0,119,182,0.05)); }
.blog-tag-link.active { border-color: var(--color-accent); background: var(--color-accent-bg, rgba(0,119,182,0.08)); color: var(--color-accent); font-weight: 600; }

.blog-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}
.blog-pagination a, .blog-pagination .page-current {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.blog-pagination a {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: background 0.15s;
}
.blog-pagination a:hover { background: var(--color-bg); }
.page-current {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

/* Blog Article */
.blog-cover-section { padding: 0; }
.blog-cover-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}
.blog-article-section { padding: 2.5rem 0; }
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: start;
}
.blog-article-header { margin-bottom: 1.5rem; }
.blog-article-header h1 { font-size: 1.8rem; line-height: 1.3; margin: 0 0 0.75rem; }
.blog-article-meta {
  display: flex;
  gap: 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.blog-article-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.blog-article-body.prose {
  font-size: 1rem;
  line-height: 1.75;
}
.prose h2 { font-size: 1.35rem; margin: 2rem 0 0.75rem; }
.prose h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.prose p { margin: 0 0 1.25rem; }
.prose ul, .prose ol { margin: 0 0 1.25rem; padding-left: 1.5rem; }
.prose li { margin-bottom: 0.35rem; }
.prose img { border-radius: var(--radius); margin: 1rem 0; }
.prose a { color: var(--color-accent); text-decoration: underline; }

/* Blog Sidebar */
.blog-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.sidebar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.sidebar-card h3 { font-size: 1rem; margin: 0 0 0.75rem; }
.sidebar-recent-posts { display: flex; flex-direction: column; gap: 0.75rem; }
.sidebar-recent-post {
  display: flex;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: color 0.15s;
}
.sidebar-recent-post:hover { color: var(--color-accent); }
.sidebar-recent-post img {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.sidebar-recent-title { font-size: 0.85rem; font-weight: 500; margin: 0; line-height: 1.3; }
.sidebar-recent-date { font-size: 0.75rem; color: var(--color-text-muted); }
.sidebar-contact form { display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-contact p { font-size: 0.85rem; color: var(--color-text-muted); margin: 0 0 0.5rem; }

@media (max-width: 768px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-article-header h1 { font-size: 1.4rem; }
  .blog-hero h1 { font-size: 1.5rem; }
}

/* ===== Saved Page ===== */
.saved-section { padding: 2rem 0 3rem; }
.saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.saved-item {
  position: relative;
}
.saved-item .building-card,
.saved-item .listing-grid-card {
  display: block;
}
.unsave-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ef4444;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, background 0.15s;
  z-index: 2;
}
.unsave-btn:hover { transform: scale(1.15); background: #fff; }
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}
.empty-state svg { color: var(--color-text-muted); margin-bottom: 1rem; }
.empty-state p { margin: 0 0 1rem; font-size: 1.05rem; }

/* Saved item actions (notify toggle + remove) */
.saved-item-note {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--color-border-light);
}
.saved-item-note .user-note-input {
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  background: #fff;
  width: 100%;
  min-height: 80px;
  resize: vertical;
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.saved-item-note .user-note-input:focus {
  border-color: var(--color-accent);
  outline: none;
}
.saved-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--color-border-light);
}

/* Notify toggle switch */
.notify-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
}
.notify-toggle input { display: none; }
.notify-slider {
  position: relative;
  width: 36px;
  height: 20px;
  background: #ccc;
  border-radius: 20px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.notify-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.notify-toggle input:checked + .notify-slider {
  background: var(--color-primary);
}
.notify-toggle input:checked + .notify-slider::after {
  transform: translateX(16px);
}
.notify-label { color: var(--color-text-muted); }
.notify-toggle input:checked ~ .notify-label { color: var(--color-primary); font-weight: 500; }

.saved-item .unsave-btn {
  position: static;
  margin-left: auto;
  box-shadow: none;
  background: transparent;
  width: 28px;
  height: 28px;
}

/* Saved Searches list */
.saved-searches-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.saved-search-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}
.saved-search-info { flex: 1; min-width: 0; }
.saved-search-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
}
.saved-search-link:hover strong { color: var(--color-primary); }
.saved-search-link svg { color: var(--color-text-muted); flex-shrink: 0; }
.saved-search-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}
.saved-search-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.delete-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.delete-search-btn:hover { color: #ef4444; }

@media (max-width: 600px) {
  .saved-search-card { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .saved-search-actions { justify-content: space-between; }
}

/* ===== Admin ===== */
.admin-section { padding: 2rem 0; }
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.admin-header h1 { font-size: 1.5rem; margin: 0; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.admin-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.9rem;
}
.admin-table td a { color: var(--color-primary); font-weight: 500; }
.admin-table td a:hover { text-decoration: underline; }

.admin-form { max-width: 800px; }
.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.admin-field { margin-bottom: 1rem; }
.admin-field-wide { grid-column: 1; }
.admin-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: var(--color-text);
}
.admin-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.admin-error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.btn-danger {
  background: #ef4444;
  color: #fff;
  border: 1px solid #ef4444;
}
.btn-danger:hover { background: #dc2626; }
.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

/* Admin Dashboard */
.admin-nav-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.stat-card-accent { border-left: 4px solid var(--color-accent); }
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.admin-panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
}
.admin-panel-header h2 { font-size: 1.1rem; margin: 0; }
.admin-panel .admin-table { box-shadow: none; border-radius: 0; }
.admin-empty { padding: 2rem; text-align: center; color: var(--color-text-muted); }
.admin-search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
}
.admin-search-bar .form-input { max-width: 400px; }
.admin-pagination {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.pagination-info { font-size: 0.85rem; color: var(--color-text-muted); }
.admin-success {
  background: #f0fdf4;
  color: #15803d;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.td-truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-muted { color: var(--color-text-muted); }

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-header { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
  .admin-search-bar { flex-direction: column; }
  .admin-search-bar .form-input { max-width: 100%; }
  .admin-table { font-size: 0.8rem; }
  .admin-table th, .admin-table td { padding: 0.5rem 0.6rem; }
}

/* ===== Chat Widget ===== */
.chat-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.2s, background 0.2s;
}
.chat-fab:hover { transform: scale(1.08); background: var(--color-primary-light); }
.chat-fab svg { width: 24px; height: 24px; }

.chat-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 380px;
  max-height: 520px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  z-index: 1001;
  overflow: hidden;
}
.chat-panel.open { display: flex; }

.chat-header {
  background: var(--color-primary);
  color: #fff;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-header-title {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.chat-header-title .chat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
}
.chat-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  padding: 0;
  display: flex;
}
.chat-close-btn:hover { color: #fff; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 200px;
  max-height: 350px;
}
.chat-msg {
  max-width: 85%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.45;
  word-wrap: break-word;
}
.chat-msg-bot {
  background: var(--color-bg);
  color: var(--color-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-msg-user {
  background: var(--color-primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-typing {
  align-self: flex-start;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.chat-input-row {
  display: flex;
  border-top: 1px solid var(--color-border);
  padding: 0.5rem;
  gap: 0.4rem;
}
.chat-input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  outline: none;
  resize: none;
}
.chat-input:focus { border-color: var(--color-primary); }
.chat-send-btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.15s;
}
.chat-send-btn:hover { background: var(--color-primary-light); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-self: flex-start;
  max-width: 90%;
}
.chat-suggestion-btn {
  background: var(--color-surface);
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  border-radius: 1rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  line-height: 1.35;
}
.chat-suggestion-btn:hover {
  background: var(--color-primary);
  color: #fff;
}
.chat-suggestion-free {
  border-style: dashed;
  color: var(--color-text-muted);
  border-color: var(--color-text-muted);
}
.chat-suggestion-free:hover {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-text);
}
.chat-msg-bot a {
  color: var(--color-primary);
  text-decoration: underline;
}
.chat-msg-bot a:hover {
  color: var(--color-primary-light);
}

@media (max-width: 480px) {
  .chat-panel {
    width: calc(100% - 1rem);
    right: 0.5rem;
    bottom: 0.5rem;
    max-height: 70vh;
  }
  /* Question mark icon on mobile chatbot FAB */
  .chat-fab .chat-icon-chat { display: none; }
  .chat-fab .chat-icon-help { display: block; }
}
@media (min-width: 481px) {
  .chat-fab .chat-icon-help { display: none; }
}

/* ===== Mobile Contact FAB ===== */
.contact-fab {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.2s, background 0.2s;
}
.contact-fab:hover { transform: scale(1.08); background: var(--color-accent-hover); }
.contact-fab svg { width: 24px; height: 24px; }
@media (max-width: 768px) {
  .contact-fab { display: flex; }
  .contact-form-panel { display: none; }
  .contact-layout { grid-template-columns: 1fr !important; }
  .chat-fab { bottom: 1.5rem; }
}

/* Mobile contact modal */
.contact-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: flex-end;
  justify-content: center;
}
.contact-modal-overlay.open { display: flex; }
.contact-modal {
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  animation: slideUp 0.3s ease;
}
.contact-modal h2 { margin-bottom: 1rem; font-size: 1.2rem; }
.contact-modal .lead-form .form-input { margin-bottom: 0.75rem; }
.contact-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ===== Heart / Save Buttons ===== */
.card-wrap, .listing-card, .map-listing-card { position: relative; }
.heart-btn {
  position: absolute; top: 0.5rem; right: 0.5rem; z-index: 2;
  background: rgba(255,255,255,0.9); border: none; border-radius: 50%;
  width: 34px; height: 34px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; transition: all 0.2s; box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.heart-btn:hover { color: #ef4444; transform: scale(1.1); }
.heart-btn.saved { color: #ef4444; }
.heart-btn-detail {
  position: static; margin-left: 0.75rem;
  width: 38px; height: 38px;
  background: var(--color-bg); flex-shrink: 0;
}
.heart-pop { animation: heartPop 0.3s ease; }
@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ===== Quill Editor ===== */
.quill-editor { background: #fff; border-radius: 0 0 6px 6px; }
.quill-editor .ql-editor { min-height: 160px; font-size: 0.95rem; line-height: 1.7; }
.quill-editor-tall .ql-editor { min-height: 400px; }
.ql-toolbar.ql-snow { border-radius: 6px 6px 0 0; border-color: var(--color-border); }
.ql-container.ql-snow { border-color: var(--color-border); border-radius: 0 0 6px 6px; }

/* ===== Admin Photo Grid ===== */
.admin-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.admin-photo-thumb { position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 1; background: var(--color-bg); }
.admin-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-photo-delete {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.6); color: #fff; border: none;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
}
.admin-photo-thumb:hover .admin-photo-delete,
.admin-floorplan-item:hover .admin-photo-delete { opacity: 1; }

/* ===== Admin Floor Plan List ===== */
.admin-floorplan-list { display: flex; flex-direction: column; gap: 0.5rem; }
.admin-floorplan-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.75rem; background: var(--color-bg); border-radius: 6px;
  font-size: 0.9rem; position: relative;
}
.admin-floorplan-item .admin-photo-delete {
  position: static; opacity: 0; background: rgba(220,38,38,0.8);
  width: 22px; height: 22px; font-size: 14px;
}

/* ===== Admin Users ===== */
.admin-user-avatar { border-radius: 50%; width: 32px; height: 32px; object-fit: cover; }
.admin-user-profile {
  display: flex; gap: 1.5rem; align-items: flex-start;
  background: var(--color-surface); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow-sm); border: 1px solid var(--color-border);
}
.admin-user-avatar-lg { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.admin-user-info { flex: 1; }
.admin-user-info h2 { margin-bottom: 0.25rem; font-size: 1.2rem; }
.admin-user-stats-row { display: flex; gap: 1rem; margin: 0.75rem 0; flex-wrap: wrap; }
.admin-user-stat {
  background: var(--color-bg); padding: 0.35rem 0.75rem; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 500; color: var(--color-text);
}
.admin-social-links { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.admin-social-btn { font-size: 0.8rem !important; padding: 0.3rem 0.7rem !important; }
@media (max-width: 600px) {
  .admin-user-profile { flex-direction: column; align-items: center; text-align: center; }
  .admin-user-stats-row { justify-content: center; }
  .admin-social-links { justify-content: center; }
}

/* Pet policy */
.pet-not-allowed {
  font-size: 0.95rem;
  font-weight: 600;
  color: #991b1b;
  background: #fee2e2;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  display: inline-block;
}
.pet-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pet-tag {
  padding: 0.4rem 0.9rem;
  background: var(--color-bg-alt, #f3f4f6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-heading);
}
.pet-details {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}
.pet-details p { margin-bottom: 0.35rem; }

/* Registration modal */
.reg-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.reg-modal {
  background: #fff; border-radius: 10px; padding: 28px; width: 100%; max-width: 380px;
  position: relative; box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
.reg-modal-close {
  position: absolute; top: 10px; right: 14px; background: none; border: none;
  font-size: 1.5rem; cursor: pointer; color: var(--color-text-muted); line-height: 1;
}
.reg-modal h3 { font-size: 1.2rem; margin-bottom: 2px; }
.reg-modal-sub { font-size: 0.88rem; color: var(--color-text-muted); margin-bottom: 16px; }
.reg-modal .form-input { margin-bottom: 0.5rem; }
.reg-terms-check {
  display: flex; align-items: flex-start; gap: 0.4rem; font-size: 0.82rem;
  color: var(--color-text-muted); margin-bottom: 0.75rem; cursor: pointer;
}
.reg-terms-check input { margin-top: 2px; }
.reg-terms-check a { color: var(--color-accent); }
.reg-modal .btn { margin-top: 0.25rem; }
.reg-modal-login { font-size: 0.85rem; color: var(--color-text-muted); text-align: center; margin-top: 1rem; }
.reg-modal-login a { color: var(--color-accent); font-weight: 500; }

/* Legal pages */
.legal-section { padding: 2.5rem 0; }
.legal-content { max-width: 720px; }
.legal-content h2 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; color: var(--color-heading); }
.legal-content h3 { font-size: 1rem; margin: 1.25rem 0 0.4rem; color: var(--color-heading); }
.legal-content p { margin-bottom: 0.75rem; line-height: 1.7; color: var(--color-text); font-size: 0.92rem; }
.legal-content ul { margin: 0.5rem 0 1rem 1.5rem; line-height: 1.7; font-size: 0.92rem; }
.legal-content li { margin-bottom: 0.35rem; }
.legal-content a { color: var(--color-accent); }
.legal-updated { font-size: 0.82rem; color: var(--color-text-muted); margin-bottom: 1.5rem; }
