* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  color: #1a1a1a;
}

/* ── Hero ── */
.hero {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  height: 40px;
  display: flex; align-items: center;
}

.hero-inner {
  width: 100%; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.hero-headline {
  font-size: 0.82rem; font-weight: 600; color: #374151;
  letter-spacing: -0.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-headline span { color: #7c3aed; }

.hero-stats {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.hero-stat { font-size: 0.75rem; color: #9ca3af; font-weight: 500; white-space: nowrap; }
.stat-num { font-weight: 700; color: #6b7280; }
.hero-stat-sep { color: #e5e7eb; font-size: 0.72rem; }

@media (max-width: 600px) {
  .hero-headline { display: none; }
  .hero-inner { justify-content: center; }
}

/* ── Header ── */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 52px; background: #fff;
  border-bottom: 1px solid #f0f0f0; z-index: 1000; flex-shrink: 0;
}
.logo { font-size: 1.15rem; font-weight: 700; color: #1a1a1a; letter-spacing: -0.5px; text-decoration: none; }
.logo span { color: #7c3aed; }

.header-actions { display: flex; align-items: center; gap: 8px; }

/* ── Inbox Icon ── */
.inbox-icon-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; color: #6b7280;
  text-decoration: none; border: 1px solid #f0f0f0; transition: all 0.15s;
  flex-shrink: 0;
}
.inbox-icon-btn:hover { background: #f5f3ff; color: #7c3aed; border-color: #ede9fe; }

.inbox-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 16px; height: 16px; padding: 0 3px;
  background: #7c3aed; color: #fff; border-radius: 999px;
  font-size: 0.58rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; line-height: 1;
}

/* ── Auth Area ── */
.btn-signin {
  display: flex; align-items: center; gap: 6px;
  background: #fff; color: #374151; border: 1px solid #d1d5db;
  padding: 7px 12px; border-radius: 8px; font-size: 0.82rem;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-signin:hover { background: #f9fafb; border-color: #9ca3af; }

.auth-user {
  position: relative; display: flex; align-items: center; gap: 6px;
  cursor: pointer; padding: 5px 10px; border-radius: 8px;
  border: 1px solid #e5e7eb; background: #fff; transition: all 0.15s;
  user-select: none;
}
.auth-user:hover { background: #f9fafb; }
.auth-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.auth-avatar-placeholder {
  width: 26px; height: 26px; border-radius: 50%;
  background: #7c3aed; color: #fff; display: flex;
  align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}
.auth-name { font-size: 0.82rem; font-weight: 600; color: #374151; }

.auth-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 5000; min-width: 160px;
  overflow: hidden;
}
.auth-dropdown.open { display: block; }

.auth-dropdown-item {
  display: block; width: 100%; text-align: left; padding: 10px 16px;
  font-size: 0.83rem; color: #374151; background: none; border: none;
  cursor: pointer; text-decoration: none; transition: background 0.1s;
}
.auth-dropdown-item:hover { background: #f5f3ff; color: #7c3aed; }
.auth-signout { color: #dc2626; }
.auth-signout:hover { background: #fef2f2; color: #dc2626; }
.auth-dropdown-divider { height: 1px; background: #f3f4f6; margin: 2px 0; }

/* ── Auth Modal ── */
.auth-modal-body {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 24px 28px 32px; text-align: center;
}
.auth-modal-icon { font-size: 2.5rem; }
.auth-modal-body p { font-size: 0.88rem; color: #4b5563; line-height: 1.5; max-width: 280px; }
.auth-modal-body small { font-size: 0.75rem; color: #9ca3af; }

.btn-google-signin {
  display: flex; align-items: center; gap: 10px;
  background: #fff; color: #374151; border: 1.5px solid #d1d5db;
  padding: 10px 20px; border-radius: 8px; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.btn-google-signin:hover { background: #f9fafb; border-color: #9ca3af; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

/* ── Apartment Dots (all-societies layer) ── */
.apt-dot {
  border-radius: 50%; cursor: pointer;
  transition: transform 0.12s, opacity 0.12s;
}
.apt-dot-ghost {
  width: 10px; height: 10px;
  background: rgba(124, 58, 237, 0.18);
  border: 1.5px solid rgba(124, 58, 237, 0.35);
}
.apt-dot-ghost:hover {
  background: rgba(124, 58, 237, 0.35);
  transform: scale(1.4);
}
.apt-dot-active {
  width: 18px; height: 18px;
  background: #7c3aed; border: 2px solid #fff;
  box-shadow: 0 1px 5px rgba(124, 58, 237, 0.45);
  color: #fff; font-size: 0.6rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.apt-dot-active:hover { transform: scale(1.2); }

/* ── Society Filter (filter bar) ── */
.society-filter-input { width: 170px; padding-right: 26px; }
.society-filter-input.has-selection {
  border-color: #7c3aed; background: #f5f3ff; color: #5b21b6; font-weight: 600;
}
.society-filter-clear {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #9ca3af; font-size: 1rem;
  cursor: pointer; padding: 0; line-height: 1; display: flex; align-items: center;
}
.society-filter-clear:hover { color: #dc2626; }

/* ── Apt Autocomplete (post form) ── */
.apt-search-wrap {
  position: relative; display: flex; align-items: center; margin-top: 5px;
}
.apt-search-icon {
  position: absolute; left: 9px; width: 16px; height: 16px; pointer-events: none; flex-shrink: 0;
}
.apt-search-input {
  width: 100%; padding: 8px 12px 8px 30px; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 0.85rem; color: #1a1a1a; font-family: inherit;
}
.apt-search-input:focus { outline: none; border-color: #7c3aed; }

.apt-dropdown {
  display: none; position: absolute; top: calc(100% + 5px); left: 0; right: 0;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 6000; overflow: hidden;
}
.apt-dropdown.open { display: block; }

.apt-item {
  padding: 10px 14px; cursor: pointer; transition: background 0.1s;
  border-bottom: 1px solid #f3f4f6;
}
.apt-item:last-child { border-bottom: none; }
.apt-item:hover, .apt-item.highlighted { background: #f5f3ff; }
.apt-item-name { font-size: 0.85rem; font-weight: 600; color: #1a1a1a; }
.apt-item-name mark { background: #ede9fe; color: #5b21b6; border-radius: 2px; font-weight: 700; }
.apt-item-meta { font-size: 0.72rem; color: #9ca3af; margin-top: 2px; }

/* Selected pill */
.apt-selected-pill {
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
  background: #f5f3ff; border: 1.5px solid #c4b5fd; border-radius: 8px;
  padding: 8px 12px;
}
.apt-pill-info { flex: 1; min-width: 0; }
.apt-pill-name { display: block; font-size: 0.85rem; font-weight: 700; color: #5b21b6; }
.apt-pill-meta { display: block; font-size: 0.72rem; color: #7c3aed; margin-top: 1px; }
.apt-pill-clear {
  background: none; border: none; color: #9ca3af; font-size: 1.1rem;
  cursor: pointer; padding: 0 2px; line-height: 1; flex-shrink: 0;
  transition: color 0.1s;
}
.apt-pill-clear:hover { color: #dc2626; }

/* Not listed button + fallback */
.btn-not-listed {
  display: inline-block; margin-top: 4px; padding: 0;
  background: none; border: none; color: #7c3aed; font-size: 0.78rem;
  font-weight: 600; cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-not-listed:hover { color: #5b21b6; }
.fallback-hint { font-size: 0.72rem; color: #6b7280; margin-top: 6px; }

/* ── Amenities ── */
.amenities-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px; margin-top: 6px;
}
.amenity-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1.5px solid #e5e7eb; border-radius: 8px;
  font-size: 0.78rem; font-weight: 500; color: #374151; cursor: pointer;
  transition: all 0.12s; white-space: nowrap;
}
.amenity-item:hover { border-color: #c4b5fd; background: #faf5ff; }
.amenity-item input[type="checkbox"] { width: 14px; height: 14px; accent-color: #7c3aed; cursor: pointer; }
.amenity-item:has(input:checked) {
  border-color: #7c3aed; background: #f5f3ff; color: #5b21b6;
}

/* ── Photo Grid (upload) ── */
.photo-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; min-height: 80px;
  padding: 8px; border: 2px dashed #d1d5db; border-radius: 10px;
}
.photo-grid:empty { border-color: transparent; }

.photo-thumb {
  position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden;
  border: 1px solid #e5e7eb;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb-remove {
  position: absolute; top: 2px; right: 2px;
  background: rgba(0,0,0,0.65); color: #fff; border: none;
  width: 18px; height: 18px; border-radius: 50%; font-size: 0.7rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

.photo-thumb-add {
  width: 80px; height: 80px; border: 2px dashed #d1d5db; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; color: #9ca3af; font-size: 0.68rem; font-weight: 500;
  transition: all 0.15s;
}
.photo-thumb-add:hover { border-color: #7c3aed; color: #7c3aed; background: #faf5ff; }

/* ── Detail Gallery ── */
.detail-gallery { width: 100%; }
.detail-gallery-main { width: 100%; height: 200px; object-fit: cover; display: block; }
.detail-gallery-thumbs {
  display: flex; gap: 4px; padding: 6px 8px;
  background: #f9fafb; border-bottom: 1px solid #f0f0f0; overflow-x: auto;
}
.gallery-thumb {
  width: 52px; height: 52px; object-fit: cover; border-radius: 6px;
  cursor: pointer; border: 2px solid transparent; opacity: 0.7;
  transition: all 0.12s; flex-shrink: 0;
}
.gallery-thumb.active { border-color: #7c3aed; opacity: 1; }
.gallery-thumb:hover { opacity: 1; }

/* ── Amenity Badges (detail panel) ── */
.detail-amenities {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px;
}
.amenity-badge {
  font-size: 0.72rem; padding: 3px 8px; background: #f3f4f6; color: #374151;
  border-radius: 6px; font-weight: 500;
}

.btn-listings-toggle {
  display: flex; align-items: center; gap: 6px;
  background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe;
  padding: 7px 14px; border-radius: 8px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-listings-toggle:hover, .btn-listings-toggle.active {
  background: #ede9fe; border-color: #c4b5fd;
}

.btn-post {
  background: #7c3aed; color: #fff; border: none;
  padding: 8px 16px; border-radius: 8px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.btn-post:hover { background: #6d28d9; }

/* ── Filter Bar ── */
.filter-bar {
  display: flex; gap: 6px; padding: 8px 16px; align-items: center;
  background: #fff; border-bottom: 1px solid #f0f0f0;
  z-index: 999; flex-shrink: 0; flex-wrap: wrap;
  height: 52px;
}

.search-wrap {
  position: relative; display: flex; align-items: center; flex-shrink: 0;
}
.search-icon {
  position: absolute; left: 9px; width: 16px; height: 16px; pointer-events: none;
}
.search-input {
  padding: 6px 12px 6px 30px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 0.82rem; width: 180px; color: #374151; background: #fff;
}
.search-input:focus { outline: none; border-color: #7c3aed; }

.filter-bar select {
  padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 0.82rem; background: #fff; cursor: pointer; color: #374151;
}
.filter-bar select:focus { outline: none; border-color: #7c3aed; }

.btn-clear {
  padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 0.82rem; background: #fff; cursor: pointer; color: #6b7280;
}
.btn-clear:hover { background: #f3f4f6; }

/* ── Bottom Bar ── */
.bottom-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 32px; background: #fff;
  border-top: 1px solid #f0f0f0; flex-shrink: 0;
}
.bottom-bar-maker { font-size: 0.72rem; color: #9ca3af; }
.bottom-bar-maker a { color: #6b7280; text-decoration: none; font-weight: 500; }
.bottom-bar-maker a:hover { color: #7c3aed; }
.bottom-bar-links { display: flex; align-items: center; gap: 6px; }
.bottom-bar-links a { font-size: 0.72rem; color: #9ca3af; text-decoration: none; transition: color 0.12s; }
.bottom-bar-links a:hover { color: #6b7280; }
.bottom-bar-dot { font-size: 0.65rem; color: #d1d5db; }

/* ── Layout ── */
.layout {
  display: flex;
  height: calc(100vh - 176px);  /* 52 header + 40 hero + 52 filter + 32 bottom bar */
  height: calc(100dvh - 176px);
  min-height: 420px;
  flex-shrink: 0;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: 0; flex-shrink: 0; background: #fff;
  border-right: none; display: flex;
  flex-direction: column; overflow: hidden;
  transition: width 0.2s ease;
}
.sidebar.open {
  width: 300px;
  border-right: 1px solid #f0f0f0;
}
.sidebar-header {
  padding: 10px 14px; border-bottom: 1px solid #f5f5f5;
  font-size: 0.75rem; color: #9ca3af; font-weight: 500; letter-spacing: 0.02em;
}
.listing-list { overflow-y: auto; flex: 1; }

/* ── Listing Card ── */
.listing-card {
  border-bottom: 1px solid #f5f5f5; cursor: pointer;
  transition: background 0.12s; overflow: hidden;
}
.listing-card:hover { background: #fafafa; }
.listing-card.active { background: #f9f7ff; border-left: 3px solid #7c3aed; }

/* Photo / Placeholder */
.card-photo { width: 100%; height: 130px; object-fit: cover; display: block; }
.card-photo-placeholder {
  width: 100%; height: 130px;
}

/* Card body */
.card-body { padding: 11px 14px 12px; display: flex; flex-direction: column; gap: 4px; }

.card-society-name {
  font-size: 0.88rem; font-weight: 700; color: #111827;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-meta-line { font-size: 0.71rem; color: #9ca3af; font-weight: 400; }

/* Rent */
.card-rent-row { display: flex; align-items: baseline; gap: 4px; margin: 3px 0 4px; }
.card-rent-hero { font-size: 1.3rem; font-weight: 800; color: #111827; line-height: 1; }
.card-rent-suffix { font-size: 0.67rem; color: #9ca3af; font-weight: 400; }
/* Legacy aliases used by inbox/detail */
.card-rent-big { font-size: 1.15rem; font-weight: 800; color: #7c3aed; line-height: 1; }
.card-rent { font-size: 0.9rem; font-weight: 700; color: #7c3aed; }
.per-person { font-size: 0.7rem; font-weight: 400; color: #9ca3af; }

/* Occupancy bar */
.card-occupancy {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.72rem; color: #6b7280; font-weight: 500;
}
.occupancy-bar {
  flex: 1; max-width: 60px; height: 4px; background: #f3f4f6;
  border-radius: 99px; overflow: hidden;
}
.occupancy-fill { height: 100%; background: #7c3aed; border-radius: 99px; }

.card-badges-row { display: flex; gap: 5px; flex-wrap: wrap; }

/* Footer row */
.card-footer-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 2px;
}
/* Freshness */
.card-freshness { display: flex; align-items: center; gap: 4px; }
.freshness-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.freshness-green { background: #22c55e; }
.freshness-amber { background: #f59e0b; }
.freshness-gray  { background: #d1d5db; }
.freshness-label { font-size: 0.67rem; color: #9ca3af; font-weight: 400; }

/* Poster */
.card-poster { display: flex; align-items: center; gap: 4px; }
.poster-name { font-size: 0.67rem; color: #9ca3af; font-weight: 500; }
.verified-badge {
  font-size: 0.6rem; color: #16a34a; font-weight: 700;
}

/* Card action button */
.btn-card-enquire {
  display: block; width: 100%; margin-top: 6px;
  padding: 8px 10px; font-size: 0.78rem; font-weight: 600;
  color: #7c3aed; background: #f5f3ff; border: 1.5px solid #ede9fe;
  border-radius: 8px; cursor: pointer; transition: all 0.12s; text-align: center;
}
.btn-card-enquire:hover { background: #ede9fe; border-color: #c4b5fd; }

/* Legacy */
.card-rooms { font-size: 0.85rem; font-weight: 600; color: #1a1a1a; margin-bottom: 2px; }
.card-location { font-size: 0.75rem; color: #6b7280; margin-bottom: 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-bottom-row { display: flex; align-items: center; justify-content: space-between; }
.card-age { font-size: 0.68rem; color: #9ca3af; }

/* ── Empty States ── */
.empty-state {
  padding: 36px 24px 32px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty-emoji { font-size: 2.2rem; line-height: 1; }
.empty-title {
  font-size: 0.95rem; font-weight: 700; color: #111827; line-height: 1.4;
}
.empty-title em { font-style: normal; color: #7c3aed; }
.empty-desc { font-size: 0.8rem; color: #6b7280; line-height: 1.5; max-width: 220px; }

.empty-post-btn {
  margin-top: 4px; background: #7c3aed; color: #fff; border: none;
  padding: 9px 20px; border-radius: 8px; font-size: 0.83rem;
  font-weight: 700; cursor: pointer; transition: background 0.15s;
}
.empty-post-btn:hover { background: #6d28d9; }

/* Notify form */
.empty-notify-form {
  display: flex; gap: 6px; width: 100%; margin-top: 4px;
}
.empty-notify-form input {
  flex: 1; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 7px;
  font-size: 0.8rem; color: #1a1a1a; font-family: inherit; min-width: 0;
}
.empty-notify-form input:focus { outline: none; border-color: #7c3aed; }
.empty-notify-form button {
  background: #7c3aed; color: #fff; border: none;
  padding: 8px 12px; border-radius: 7px; font-size: 0.78rem;
  font-weight: 700; cursor: pointer; white-space: nowrap; transition: background 0.15s;
}
.empty-notify-form button:hover { background: #6d28d9; }
.empty-notify-form button:disabled { background: #a78bfa; cursor: not-allowed; }
.empty-alert-confirm {
  font-size: 0.78rem; color: #16a34a; font-weight: 600;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  padding: 8px 12px; border-radius: 7px; text-align: center;
}

/* WhatsApp share */
.empty-wa-btn {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
  background: #16a34a; color: #fff; text-decoration: none;
  padding: 9px 18px; border-radius: 8px; font-size: 0.83rem;
  font-weight: 700; transition: background 0.15s;
}
.empty-wa-btn:hover { background: #15803d; }

/* Legacy */
.no-results { padding: 32px 16px; text-align: center; color: #9ca3af; font-size: 0.85rem; }

/* ── Badges ── */
.badge { font-size: 0.7rem; padding: 2px 7px; border-radius: 999px; font-weight: 500; }
.badge-bhk { background: #ede9fe; color: #5b21b6; }
.badge-sector { background: #f3f4f6; color: #374151; }
.badge-gender { background: #f0fdf4; color: #15803d; }
.badge-gender.badge-male { background: #eff6ff; color: #1d4ed8; }
.badge-gender.badge-female { background: #fdf2f8; color: #be185d; }
.badge-furnish { background: #fef9c3; color: #854d0e; }
.badge-filled { background: #fee2e2; color: #dc2626; }

/* ── Map ── */
#map { flex: 1; z-index: 1; }

/* ── Map Markers ── */
.rent-marker {
  background: #7c3aed; color: #fff;
  padding: 5px 10px; border-radius: 5px;
  font-size: 0.76rem; font-weight: 700; line-height: 1.4;
  white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  cursor: pointer; transition: transform 0.1s, background 0.1s;
  letter-spacing: 0.01em;
}
.rent-marker:hover { transform: scale(1.08); }
.rent-marker.active { background: #dc2626; transform: scale(1.12); }

/* ── Cluster Icon ── */
.cluster-icon {
  width: 36px; height: 36px; background: #7c3aed; color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(124,58,237,0.4);
}

/* ── Leaflet Popup Override ── */
.leaflet-popup-content-wrapper {
  border-radius: 12px !important; padding: 0 !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important; overflow: hidden;
}
.leaflet-popup-content { margin: 0 !important; }
.leaflet-popup-tip { background: #fff !important; }

.map-popup { min-width: 180px; }
.popup-photo { width: 100%; height: 100px; object-fit: cover; display: block; }
.popup-body { padding: 10px 12px; }
.popup-rent-big { font-size: 1rem; font-weight: 800; color: #7c3aed; margin-bottom: 2px; }
.popup-pp { font-size: 0.7rem; font-weight: 400; color: #9ca3af; }
.popup-rooms { font-size: 0.8rem; font-weight: 600; color: #1a1a1a; margin-bottom: 2px; }
.popup-loc { font-size: 0.72rem; color: #6b7280; margin-bottom: 5px; }
.popup-meta { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Search Dropdown ── */
.search-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  width: 260px; background: #fff; border: 1px solid #e5e7eb;
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 5000; overflow: hidden;
}
.search-dropdown.open { display: block; }

.search-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; cursor: pointer; transition: background 0.1s;
  font-size: 0.82rem;
}
.search-item:hover, .search-item.highlighted { background: #f5f3ff; }
.search-item-icon { color: #9ca3af; font-size: 0.85rem; flex-shrink: 0; }
.search-item-name { flex: 1; color: #1a1a1a; font-weight: 500; }
.search-item-type { font-size: 0.68rem; color: #9ca3af; background: #f3f4f6; padding: 1px 6px; border-radius: 4px; }

/* ── Metro Overlay ── */
.metro-dot {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 800; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25); cursor: default;
}
.metro-yellow { background: #FFB800; color: #fff; }
.metro-rapid  { background: #e53e3e; color: #fff; }

.metro-tooltip {
  background: #1a1a1a !important; color: #fff !important;
  border: none !important; border-radius: 6px !important;
  font-size: 0.72rem !important; font-weight: 500 !important;
  padding: 3px 8px !important; box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}
.metro-tooltip::before { display: none !important; }

/* ── Area Labels ── */
.area-label {
  font-size: 0.65rem; font-weight: 700; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: rgba(255,255,255,0.75); padding: 2px 6px;
  border-radius: 3px; white-space: nowrap; pointer-events: none;
  backdrop-filter: blur(2px);
}

/* ── Landmark Labels ── */
.landmark-label {
  display: flex; align-items: center; gap: 3px;
  padding: 3px 7px; border-radius: 99px;
  font-size: 0.68rem; font-weight: 600; white-space: nowrap;
  pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  backdrop-filter: blur(2px);
}
.lm-icon { font-size: 0.72rem; line-height: 1; }
.lm-name { line-height: 1.2; }

.landmark-mall     { background: rgba(220,252,231,0.92); color: #15803d; }
.landmark-market   { background: rgba(255,237,213,0.92); color: #c2410c; }
.landmark-hospital { background: rgba(254,226,226,0.92); color: #b91c1c; }

/* ── Rapid Metro ── */
.metro-rapid { background: #e53e3e; color: #fff; font-size: 0.55rem; font-weight: 900; }

/* ── Society in Cards ── */
.card-society { font-size: 0.75rem; color: #7c3aed; font-weight: 500; margin-bottom: 4px; }
.detail-society { font-size: 0.8rem; color: #7c3aed; font-weight: 500; margin-bottom: 6px; }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 2000;
  align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #fff; border-radius: 16px; width: 540px;
  max-width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-sm { width: 420px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0;
}
.modal-header h2 { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #6b7280; }

/* ── Forms ── */
#postForm, #enquiryForm {
  display: flex; flex-direction: column; gap: 12px; padding: 16px 24px 24px;
}
#postForm label, #enquiryForm label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.78rem; font-weight: 600; color: #374151;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

#postForm input, #postForm select, #postForm textarea,
#enquiryForm input, #enquiryForm select, #enquiryForm textarea {
  padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 0.85rem; color: #1a1a1a; font-family: inherit;
}
#postForm input:focus, #postForm select:focus, #postForm textarea:focus,
#enquiryForm input:focus, #enquiryForm textarea:focus { outline: none; border-color: #7c3aed; }

.private-tag {
  font-size: 0.65rem; background: #f0fdf4; color: #15803d;
  padding: 1px 5px; border-radius: 4px; font-weight: 500; margin-left: 4px;
}
.private-tag.optional { background: #f3f4f6; color: #6b7280; }

/* ── Photo Upload ── */
.photo-upload-area {
  position: relative; border: 2px dashed #d1d5db; border-radius: 10px;
  overflow: hidden; cursor: pointer; transition: border-color 0.15s;
  margin-top: 4px;
}
.photo-upload-area:hover { border-color: #7c3aed; }
.photo-upload-area input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; border: none; padding: 0;
}
.photo-upload-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; padding: 20px;
  color: #9ca3af; font-size: 0.8rem; font-weight: 500;
}
.photo-preview-img { width: 100%; height: 160px; object-fit: cover; display: block; }

#miniMap { height: 180px; border-radius: 8px; border: 1px solid #d1d5db; margin-top: 4px; }
#coordsDisplay { font-size: 0.73rem; color: #6b7280; font-weight: 400; margin-top: 4px; }

.btn-submit {
  background: #7c3aed; color: #fff; border: none; padding: 10px;
  border-radius: 8px; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; margin-top: 4px; transition: background 0.15s;
}
.btn-submit:hover { background: #6d28d9; }
.btn-submit:disabled { background: #a78bfa; cursor: not-allowed; }

.enquiry-listing-title {
  margin: 12px 24px 0; padding: 10px 14px; background: #f5f3ff;
  border-radius: 8px; font-size: 0.82rem; font-weight: 600; color: #5b21b6;
}

/* ── Success Modal ── */
.success-body {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 36px 28px 32px; text-align: center;
  position: relative;
}
.success-confetti { font-size: 3rem; line-height: 1; animation: pop 0.4s cubic-bezier(0.175,0.885,0.32,1.275); }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.success-headline { font-size: 1.3rem; font-weight: 800; color: #111827; letter-spacing: -0.3px; }
.success-sub { font-size: 0.85rem; color: #6b7280; line-height: 1.6; max-width: 280px; }
.success-sub strong { color: #111827; }

.btn-go-inbox {
  display: block; width: 100%;
  background: #7c3aed; color: #fff;
  padding: 11px 20px; border-radius: 9px; font-size: 0.88rem;
  font-weight: 700; text-align: center; transition: background 0.15s;
}
.btn-go-inbox:hover { background: #6d28d9; }

.success-dismiss {
  background: none; border: none; color: #9ca3af; font-size: 0.8rem;
  cursor: pointer; padding: 0; transition: color 0.12s; font-family: inherit;
}
.success-dismiss:hover { color: #6b7280; }

/* ── Detail Panel ── */
.detail-panel {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid #e0e0e0;
  z-index: 500; box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  max-height: 260px; overflow-y: auto;
}
.detail-panel.open { display: block; }
.detail-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; font-size: 1.3rem; cursor: pointer; color: #6b7280; z-index: 1;
}

.detail-photo { width: 100%; height: 160px; object-fit: cover; display: block; }
.detail-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding: 14px 20px 8px;
}
.detail-top h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.detail-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.detail-main { display: flex; flex-direction: column; gap: 2px; }
.detail-rent-big { font-size: 1.2rem; font-weight: 800; color: #7c3aed; line-height: 1; }
.detail-rooms { font-size: 0.9rem; font-weight: 600; color: #1a1a1a; }
.detail-loc { font-size: 0.8rem; color: #6b7280; margin-bottom: 4px; }

.btn-enquire {
  flex-shrink: 0; background: #7c3aed; color: #fff; border: none;
  padding: 9px 18px; border-radius: 8px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.15s;
}
.btn-enquire:hover { background: #6d28d9; }

.detail-desc { font-size: 0.83rem; color: #4b5563; line-height: 1.5; padding: 0 20px 8px; }
.detail-poster { font-size: 0.78rem; color: #9ca3af; padding: 0 20px 14px; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a1a; color: #fff; padding: 10px 20px;
  border-radius: 999px; font-size: 0.85rem; font-weight: 500;
  z-index: 3000; transition: transform 0.3s ease; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ─────────────────────────────────────────
   INBOX PAGE
───────────────────────────────────────── */
body.inbox-page { height: auto; overflow: auto; background: #f9fafb; }
.inbox-label { font-size: 0.82rem; font-weight: 600; color: #6b7280; }

.inbox-container { max-width: 680px; margin: 32px auto; padding: 0 16px 80px; }

.inbox-listing-info {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  overflow: hidden; margin-bottom: 24px;
}
.inbox-listing-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; flex-wrap: wrap;
}
.inbox-listing-photo { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.inbox-listing-details { flex: 1; }
.inbox-listing-details h2 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; }
.inbox-listing-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.btn-mark-filled {
  margin-left: auto; background: #fff; color: #dc2626;
  border: 1px solid #dc2626; padding: 7px 14px; border-radius: 8px;
  font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.btn-mark-filled:hover { background: #dc2626; color: #fff; }
.btn-mark-filled:disabled { background: #f0fdf4; border-color: #16a34a; color: #16a34a; cursor: default; }

.filled-banner {
  background: #fef2f2; border-top: 1px solid #fecaca;
  color: #dc2626; font-size: 0.82rem; padding: 10px 20px; font-weight: 500;
}

.expiry-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fffbeb; border-top: 1px solid #fcd34d;
  color: #92400e; font-size: 0.82rem; padding: 10px 20px; font-weight: 500;
}
.btn-renew {
  margin-left: auto; background: #f59e0b; color: #fff; border: none;
  padding: 5px 14px; border-radius: 6px; font-size: 0.78rem;
  font-weight: 600; cursor: pointer; transition: background 0.15s; white-space: nowrap;
}
.btn-renew:hover { background: #d97706; }

.skeleton-line { height: 16px; background: #f0f0f0; border-radius: 4px; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

.inbox-loading { text-align: center; padding: 48px; color: #9ca3af; font-size: 0.9rem; }

.enquiry-count {
  font-size: 0.8rem; color: #6b7280; font-weight: 500;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.unseen-count {
  background: #7c3aed; color: #fff;
  font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; font-weight: 600;
}

.enquiry-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 18px 20px; margin-bottom: 12px;
}
.enquiry-card.unseen { border-color: #c4b5fd; background: #faf5ff; }

.enquiry-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.enquiry-name { font-size: 0.9rem; font-weight: 700; }
.new-badge {
  font-size: 0.65rem; background: #7c3aed; color: #fff;
  padding: 2px 7px; border-radius: 999px; margin-left: 6px; font-weight: 600;
}
.enquiry-time { font-size: 0.75rem; color: #9ca3af; }

.enquiry-message {
  font-size: 0.85rem; color: #374151; line-height: 1.55; margin-bottom: 12px;
  border-left: 2px solid #e5e7eb; padding-left: 12px;
}

.enquiry-contact {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #f9fafb; border-radius: 8px; padding: 8px 12px;
}
.contact-label { font-size: 0.75rem; color: #9ca3af; font-weight: 500; }
.contact-value { font-size: 0.85rem; font-weight: 700; }

.btn-whatsapp {
  margin-left: auto; background: #16a34a; color: #fff;
  padding: 4px 12px; border-radius: 6px; font-size: 0.75rem;
  font-weight: 600; text-decoration: none; transition: background 0.15s;
}
.btn-whatsapp:hover { background: #15803d; }

.inbox-empty { text-align: center; padding: 64px 24px; color: #6b7280; }
.inbox-empty-icon { font-size: 2.5rem; margin-bottom: 16px; }
.inbox-empty h2 { font-size: 1.1rem; font-weight: 700; color: #1a1a1a; margin-bottom: 8px; }
.inbox-empty p { font-size: 0.88rem; line-height: 1.5; margin-bottom: 20px; }
.inbox-empty a { color: #7c3aed; font-weight: 600; text-decoration: none; }

/* ── Sidebar Footer ── */
.sidebar-footer {
  flex-shrink: 0; padding: 10px 14px;
  border-top: 1px solid #f0f0f0; background: #fff;
}
.btn-suggest-society {
  display: block; width: 100%; padding: 8px 12px; background: none;
  border: 1.5px dashed #d1d5db; border-radius: 8px; color: #9ca3af;
  font-size: 0.78rem; font-weight: 500; cursor: pointer; text-align: center;
  transition: all 0.15s;
}
.btn-suggest-society:hover {
  border-color: #7c3aed; color: #7c3aed; background: #faf5ff;
}

/* ── Suggest Society Modal ── */
.suggest-intro {
  font-size: 0.82rem; color: #6b7280; line-height: 1.5;
  margin: 8px 0 4px; padding: 0 24px;
}


/* ══════════════════════════════════════
   MOBILE  (≤ 640px)
══════════════════════════════════════ */
@media (max-width: 640px) {

  /* Header — hide name text, tighten spacing */
  header { padding: 0 12px; gap: 6px; }
  .auth-name { display: none; }
  .btn-post { padding: 7px 11px; font-size: 0.78rem; }
  .btn-listings-toggle { padding: 7px 10px; font-size: 0.78rem; }

  /* Hero — centre stats only */
  .hero { height: 36px; }
  .hero-headline { display: none; }
  .hero-inner { justify-content: center; }

  /* Filter bar — single-row horizontal scroll */
  .filter-bar {
    overflow-x: auto; flex-wrap: nowrap;
    padding: 0 12px; height: 46px; gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-bar select,
  .filter-bar .btn-clear,
  .filter-bar .search-wrap { flex-shrink: 0; }
  .search-input { width: 140px; }
  .society-filter-input { width: 140px; }

  /* Bottom bar — hide maker credit, centre links */
  .bottom-bar { height: 28px; padding: 0 12px; }
  .bottom-bar-maker { display: none; }
  .bottom-bar-links { width: 100%; justify-content: center; }

  /* Layout — fill remaining viewport */
  .layout {
    height: calc(100dvh - 162px); /* 52 header + 36 hero + 46 filter + 28 bottom */
    min-height: 300px;
  }

  /* Sidebar — bottom sheet */
  .sidebar {
    position: fixed !important;
    bottom: 28px; left: 0; right: 0; top: auto !important;
    width: 100% !important;
    height: 0;
    max-height: 68vh;
    border-right: none !important;
    border-top: 1px solid #ebebeb;
    border-radius: 18px 18px 0 0;
    z-index: 300;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -6px 32px rgba(0,0,0,0.10);
    overflow: hidden;
  }
  .sidebar.open {
    height: 68vh;
    width: 100% !important;
  }

  /* Drag handle above sidebar header */
  .sidebar-header {
    padding-top: 14px;
  }
  .sidebar-header::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: #e5e7eb; border-radius: 2px;
    margin: -6px auto 10px;
  }

  /* Modals — bottom sheet */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal, .modal-sm {
    width: 100%; max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
  }

  /* Forms — single column */
  .form-row { grid-template-columns: 1fr; }

  /* Detail panel — full width */
  .detail-panel { left: 0; }

  /* Map markers — slightly larger tap targets */
  .rent-marker { padding: 6px 12px; font-size: 0.8rem; }
}
