/* HomeGPT UI System v3 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');
:root {
  --nav-height: 80px;
  --brand-50: #eef7ff;
  --brand-500: #3b82b8;
  --brand-600: #256f9c;
  --brand-700: #1f5f86;
  --brand-800: #184a68;
  --accent-600: #2f855a;
  --danger-500: #b45309;
  --danger-soft: #fff7ed;
  --ink-900: #111827;
  --ink-800: #1f2937;
  --ink-700: #374151;
  --ink-600: #4b5563;
  --ink-500: #6b7280;
  --line: #e5e7eb;
  --line-strong: #cbd5e1;
  --shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow-sm: 0 8px 20px rgba(17, 24, 39, 0.07);
  --shadow-md: 0 14px 32px rgba(17, 24, 39, 0.10);
  --shadow-lg: 0 22px 46px rgba(17, 24, 39, 0.14);
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition-fast: 0.16s ease;
  --transition-base: 0.24s ease;
}

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

html {
  scroll-behavior: smooth
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink-800);
  line-height: 1.6;
  background: #f6f7f9;
}

a {
  color: inherit;
  text-decoration: none
}

img {
  display: block;
  max-width: 100%
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-heading);
  color: var(--ink-900);
  line-height: 1.2;
  letter-spacing: 0
}

input,
select,
textarea,
button {
  font-family: var(--font-body)
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px
}

.is-hidden {
  display: none
}

.text-secondary {
  color: var(--ink-500)
}

.loading-msg {
  color: var(--ink-500);
  font-style: italic
}

.loading-msg::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid rgba(31, 142, 230, .22);
  border-top-color: var(--brand-600);
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin .75s linear infinite
}

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

.error-msg {
  color: var(--danger-500);
  border: 1px solid #fed7aa;
  background: #fff7ed;
  border-radius: var(--radius-sm);
  padding: 12px 14px
}

.mt-6 {
  margin-top: 6px
}

.mb-8 {
  margin-bottom: 8px
}

.mb-12 {
  margin-bottom: 12px
}

.mb-16 {
  margin-bottom: 16px
}

.mt-8 {
  margin-top: 8px
}

.mt-12 {
  margin-top: 12px
}

.mt-16 {
  margin-top: 16px
}

.loading-pad {
  padding: 2rem
}

.panel-error {
  margin: 1rem
}

.mr-8 {
  margin-right: 8px
}

.pad-y-2 {
  padding-top: 2rem;
  padding-bottom: 2rem
}

.flex-1 {
  flex: 1
}

.upload-status {
  font-size: .85rem;
  color: var(--ink-500)
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--ink-500)
}

.empty-state-wide {
  padding: 12px 0;
  text-align: center;
  color: var(--ink-500);
  grid-column: 1/-1
}

.empty-note {
  color: var(--ink-500);
  font-size: .85rem
}

.row-market-badge {
  margin-top: 4px
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px)
  }

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

@keyframes drift-fade {
  from {
    opacity: 0;
    transform: translateY(28px) scale(.985)
  }

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

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
  transition-delay: var(--reveal-delay, 0ms)
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0)
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 800;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  color: rgba(244, 248, 255, .92);
  margin-bottom: 14px
}

.site-ready .hero-copy,
.site-ready .hero-showcase,
.site-ready .dashboard-hero {
  animation: drift-fade .55s ease
}

[data-hover-glow] {
  position: relative;
  overflow: hidden;
  isolation: isolate
}

[data-hover-glow]::after {
  content: '';
  position: absolute;
  inset: -18%;
  pointer-events: none;
  background: radial-gradient(280px circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(54, 167, 247, .2), transparent 58%);
  opacity: 0;
  transition: opacity .28s ease;
  z-index: 0;
}

[data-hover-glow].is-spotlit::after {
  opacity: 1
}

[data-hover-glow]>* {
  position: relative;
  z-index: 1
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  border-bottom: 1px solid rgba(190, 199, 220, .8);
  background: rgba(249, 251, 255, .9);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(29, 37, 61, .06)
}

.nav-container {
  max-width: 1280px;
  height: var(--nav-height);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 186px
}

.nav-logo .logo-img {
  height: 60px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(17, 39, 72, .1))
}

.nav-logo::after {
  content: 'HomeGPT';
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: 0
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap
}

.nav-link {
  color: var(--ink-600);
  font-size: .95rem;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all var(--transition-base)
}

.nav-link:hover {
  color: var(--ink-900);
  border-color: var(--line);
  background: rgba(255, 255, 255, .8);
  transform: translateY(-1px)
}

.nav-link.active {
  color: var(--brand-700);
  border-color: rgba(31, 142, 230, .35);
  background: var(--brand-50)
}

.site-footer {
  margin-top: 56px;
  background: linear-gradient(160deg, #141a2a 0%, #212a43 100%);
  color: rgba(236, 240, 255, .8);
  padding: 48px 0 24px
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 32px
}

.footer-col h4 {
  color: #f5f7ff;
  margin-bottom: 12px
}

.footer-col a {
  display: block;
  margin-bottom: 8px;
  transition: color var(--transition-fast)
}

.footer-col a:hover {
  color: #fff
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .15);
  padding-top: 16px;
  text-align: center;
  font-size: .85rem
}

.btn-primary,
.apply-filters-btn,
.search-btn,
.search-btn-sm,
.send-btn,
.action-btn:not(.secondary) {
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 12px 22px rgba(17, 105, 177, .24)
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  min-height: 50px;
  padding: 12px 18px;
  font-size: .98rem;
  line-height: 1.05
}

.btn-sm {
  min-height: 42px;
  padding: 9px 14px;
  font-size: .84rem
}

.btn-primary:hover,
.apply-filters-btn:hover,
.search-btn:hover,
.search-btn-sm:hover,
.send-btn:hover,
.action-btn:not(.secondary):hover {
  transform: translateY(-1px);
  filter: brightness(1.03)
}

.btn-secondary,
.action-btn.secondary {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f4f6fb);
  color: var(--ink-700);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast)
}

.btn-secondary:hover,
.action-btn.secondary:hover {
  border-color: var(--line-strong);
  background: #fff;
  transform: translateY(-1px)
}

.btn-danger,
.btn-danger-delete {
  border-color: #b8d3f1 !important;
  color: var(--danger-500) !important;
  background: var(--danger-soft) !important
}

.favorite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .92);
  color: var(--ink-700);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 10px 18px rgba(18, 28, 45, .12)
}

.favorite-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 142, 230, .28);
  color: var(--brand-700)
}

.favorite-btn.is-favorited {
  background: linear-gradient(135deg, #fff3cb, #ffe38d);
  border-color: #f7cb52;
  color: #8c5a00
}

.favorite-btn.is-busy {
  opacity: .72;
  cursor: wait
}

.favorite-btn-card {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2
}

.favorite-btn-inline {
  margin-left: 10px
}

.favorite-btn-detail {
  justify-content: center
}

.favorite-icon {
  font-size: .95rem;
  line-height: 1
}

input,
select,
textarea,
.filter-input,
.filter-select,
.search-input,
.search-input-sm {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  background: #fff;
  color: var(--ink-800);
  transition: all var(--transition-fast)
}

input:focus,
select:focus,
textarea:focus,
.filter-input:focus,
.filter-select:focus,
.search-input:focus,
.search-input-sm:focus {
  outline: none;
  border-color: rgba(31, 93, 143, .7);
  box-shadow: 0 0 0 3px rgba(31, 93, 143, .18)
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 98px 0 86px;
  color: #f8faff;
  background: linear-gradient(125deg, #11192f 0%, #1f2a45 45%, #274367 100%)
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 260px at 15% 20%, rgba(54, 167, 247, .24), transparent 68%), radial-gradient(540px 260px at 85% 22%, rgba(122, 181, 230, .24), transparent 68%), linear-gradient(180deg, transparent 0%, rgba(17, 25, 47, .35) 100%)
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  animation: rise-in .52s ease
}

.hero-content-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 32px;
  align-items: center
}

.hero-copy {
  text-align: left
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.35rem);
  margin-bottom: 14px;
  color: #f8fbff
}

.hero-sub {
  color: rgba(245, 249, 255, .86);
  font-size: 1.08rem;
  max-width: 700px;
  margin: 0 0 24px
}

.hero-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: stretch;
  margin-bottom: 22px
}

.hero-cta {
  min-height: 56px;
  padding: 0 22px;
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
  border-radius: 16px
}

.hero-cta.secondary {
  box-shadow: none
}

.hero-search {
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-lg)
}

.hero-showcase {
  display: grid;
  gap: 14px
}

.hero-metric-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .08));
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md)
}

.hero-metric-card strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: #fff;
  margin: 4px 0
}

.hero-metric-card p {
  color: rgba(245, 249, 255, .78);
  font-size: .94rem
}

.hero-metric-label {
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 800;
  color: rgba(245, 249, 255, .72)
}

.hero-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px
}

.hero-preview-card {
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base)
}

.hero-preview-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg)
}

.hero-preview-image {
  position: relative;
  height: 180px;
  background: rgba(255, 255, 255, .06)
}

.hero-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.hero-preview-card:hover .hero-preview-image img,
.local-data-gallery-card:hover .local-data-gallery-media img {
  transform: scale(1.04)
}

.hero-preview-image img,
.local-data-gallery-media img {
  transition: transform .55s ease
}

.hero-preview-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  color: #fff
}

.hero-preview-copy strong {
  font-size: 1rem;
  line-height: 1.2
}

.hero-preview-copy span {
  color: rgba(245, 249, 255, .82);
  font-weight: 700
}

.hero-preview-skeleton {
  min-height: 236px;
  border-radius: 18px;
  background: linear-gradient(110deg, rgba(255, 255, 255, .08) 8%, rgba(255, 255, 255, .2) 18%, rgba(255, 255, 255, .08) 33%);
  background-size: 220% 100%;
  animation: shimmer 1.6s linear infinite
}

@keyframes shimmer {
  to {
    background-position: -120% 0
  }
}

.search-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px
}

.search-tab {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f6fb;
  color: var(--ink-600);
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast)
}

.search-tab.active {
  border-color: rgba(31, 142, 230, .35);
  background: var(--brand-50);
  color: var(--brand-700)
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px
}

.search-input {
  min-height: 46px
}

.search-btn {
  min-height: 46px;
  min-width: 132px;
  padding: 0 20px
}

.hero-tags {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center
}

.hero-tag {
  border: 1px solid rgba(255, 255, 255, .42);
  color: #fff;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  padding: 6px 14px;
  font-weight: 600;
  font-size: .84rem;
  transition: all var(--transition-fast)
}

.hero-tag:hover {
  background: rgba(255, 255, 255, .2);
  transform: translateY(-1px)
}

.features-section,
.map-preview-section,
.listings-section {
  position: relative;
  padding: 70px 0
}

.features-section {
  padding-bottom: 54px
}

.map-preview-section,
.listings-section {
  padding-top: 14px
}

.section-title {
  font-size: clamp(1.55rem, 2.3vw, 2.1rem);
  text-align: center;
  margin-bottom: 30px
}

.section-title-left {
  text-align: left;
  margin-bottom: 12px
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px
}

.section-header .section-title {
  margin-bottom: 0;
  text-align: left
}

.view-all-link {
  color: var(--accent-600);
  font-weight: 700
}

.features-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1.26fr);
  gap: 22px;
  align-items: stretch
}

.features-intro-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: var(--shadow-md)
}

.features-eyebrow {
  background: var(--brand-50);
  border-color: rgba(31, 142, 230, .16);
  color: var(--brand-700)
}

.features-intro-copy {
  color: var(--ink-600);
  max-width: 620px
}

.local-data-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 20px
}

.local-data-stat {
  padding: 14px 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(31, 142, 230, .1);
  background: linear-gradient(180deg, #f9fbff, #f1f6ff)
}

.local-data-stat strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.18rem;
  color: var(--ink-900);
  margin-bottom: 3px
}

.local-data-stat span {
  display: block;
  color: var(--ink-500);
  font-size: .84rem;
  line-height: 1.45
}

.local-data-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px
}

.local-data-gallery-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(31, 142, 230, .12);
  background: #fff;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base)
}

.local-data-gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md)
}

.local-data-gallery-media {
  height: 150px;
  background: linear-gradient(145deg, #dfe5f4, #cad5ea)
}

.local-data-gallery-media img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.local-data-gallery-copy {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px
}

.local-data-gallery-copy strong {
  font-size: .96rem;
  color: var(--ink-900);
  line-height: 1.25
}

.local-data-gallery-copy span {
  font-size: .83rem;
  color: var(--ink-500)
}

.local-data-gallery-skeleton {
  min-height: 214px;
  background: linear-gradient(110deg, #eef2fb 8%, #f8fbff 18%, #eef2fb 33%);
  background-size: 220% 100%;
  animation: shimmer 1.6s linear infinite
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: linear-gradient(180deg, #fff, #fafbff);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 18px;
  transition: all var(--transition-base)
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(31, 93, 143, .22)
}

.feature-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 138px;
  padding: 18px;
  border-radius: 8px;
  overflow: hidden;
  background-position: center;
  background-size: cover
}

.feature-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, .04), rgba(15, 23, 42, .46));
  opacity: 1
}

.feature-card-school .feature-visual {
  background-image: url('/static/images/property-living-room-bright.jpg')
}

.feature-card-mrt .feature-visual {
  background-image: url('/static/images/singapore-apartments-skyline.jpg')
}

.feature-card-health .feature-visual {
  background-image: url('/static/images/property-open-plan.jpg')
}

.feature-card-ai .feature-visual {
  background-image: url('/static/images/property-living-room.jpg')
}

.feature-icon {
  display: none
}

.feature-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(255, 255, 255, .68);
  color: #172033;
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(8px);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .02em
}

.feature-copy h3 {
  font-size: 1.14rem;
  margin-bottom: 8px
}

.feature-copy p {
  color: var(--ink-500);
  font-size: .94rem
}

@keyframes float-soft {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-6px)
  }
}

.home-map {
  height: 430px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm)
}

.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px
}

.property-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: all var(--transition-base)
}

.property-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(31, 93, 143, .25)
}

.card-image {
  position: relative;
  height: 194px;
  overflow: hidden;
  background: linear-gradient(145deg, #dfe5f4, #cdd8ec)
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.card-image.row-image-failed img {
  display: none
}

.card-image.row-image-failed::after {
  content: 'No Image';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-500);
  font-weight: 600
}

.card-badge,
.listing-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  border-radius: 999px;
  background: rgba(17, 26, 45, .86);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 4px 10px
}

.card-body {
  padding: 16px
}

.card-body h4 {
  font-size: 1.03rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.card-address {
  color: var(--ink-500);
  font-size: .87rem;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.card-price {
  color: var(--brand-700);
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 8px
}

.card-meta,
.card-proximity,
.listing-row .row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px
}

.card-meta span,
.listing-row .row-meta span,
.prox-tag {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .76rem;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--ink-600);
  background: #f4f6fb
}

.prox-tag.mrt {
  color: #1f6646;
  border-color: #b7dfc7;
  background: #e9f8ef
}

.prox-tag.school {
  color: #8f4f06;
  border-color: #efd5af;
  background: #fff4e1
}

.prox-tag.hospital {
  color: #1b4d8f;
  border-color: #b4d0ee;
  background: #e8f1ff
}

.gallery-placeholder {
  display: grid;
  place-items: center;
  color: var(--ink-500)
}

.search-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - var(--nav-height))
}

.search-sidebar {
  background: rgba(255, 255, 255, .9);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  backdrop-filter: blur(8px)
}

.filter-panel {
  padding: 22px 20px 24px
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px
}

.filter-header h3 {
  font-size: 1.12rem
}

.filter-reset {
  border: none;
  background: none;
  color: var(--accent-600);
  font-weight: 700;
  cursor: pointer
}

.filter-group {
  margin-bottom: 14px
}

.filter-group>label,
.stat-label {
  display: block;
  font-size: .76rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-500);
  margin-bottom: 6px
}

.price-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px
}

.price-sep {
  color: var(--ink-500);
  font-weight: 700
}

.toggle-group,
.bed-buttons,
.view-toggles {
  display: flex;
  gap: 6px
}

.bed-buttons {
  flex-wrap: wrap
}

.toggle-btn,
.bed-btn,
.view-btn,
.tab-btn,
.admin-tab,
.persona-btn,
.quick-q {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-600);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast)
}

.toggle-btn,
.bed-btn {
  flex: 1;
  padding: 8px 9px;
  font-weight: 700;
  font-size: .84rem
}

.toggle-btn.active,
.bed-btn.active,
.view-btn.active,
.tab-btn.active,
.admin-tab.active,
.persona-btn.active {
  color: var(--brand-700);
  border-color: rgba(31, 142, 230, .35);
  background: var(--brand-50)
}

.search-filter-note {
  margin-top: 8px;
  font-size: .78rem
}

.named-amenity-group {
  margin-top: 10px
}

.named-amenity-results {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden
}

.named-amenity-option {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink-700);
  cursor: pointer;
  text-align: left
}

.named-amenity-option:last-child {
  border-bottom: none
}

.named-amenity-option:hover {
  background: #f7faff
}

.named-amenity-option span,
.named-amenity-empty {
  font-size: .82rem;
  color: var(--ink-500)
}

.named-amenity-empty {
  padding: 10px 12px
}

.named-amenity-selected {
  margin-top: 8px
}

.named-amenity-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(31, 142, 230, .22);
  border-radius: 999px;
  background: #eff7ff;
  color: var(--brand-700);
  padding: 8px 12px;
  font-size: .84rem;
  font-weight: 700
}

.named-amenity-clear {
  border: none;
  background: none;
  color: var(--brand-700);
  font-weight: 800;
  cursor: pointer
}

.check-label,
.overlay-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: var(--ink-600)
}

.inline-select {
  width: auto;
  font-size: .8rem;
  padding: 3px 6px
}

.apply-filters-btn {
  width: 100%;
  padding: 11px 14px
}

.search-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0
}

.search-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .9)
}

.search-bar-wrapper {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px
}

.search-btn-sm {
  padding: 10px 18px
}

.view-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 1rem
}

.results-count {
  white-space: nowrap;
  color: var(--ink-500);
  font-size: .88rem;
  font-weight: 600
}

.search-content {
  flex: 1;
  display: flex;
  min-height: 0
}

.search-content.split-view .listings-panel {
  width: 52%
}

.search-content.split-view .map-panel {
  width: 48%
}

.search-content.list-view .listings-panel {
  width: 100%
}

.search-content.list-view .map-panel {
  display: none
}

.search-content.map-view .listings-panel {
  display: none
}

.search-content.map-view .map-panel {
  width: 100%
}

.listings-panel {
  overflow-y: auto;
  padding: 16px
}

.listings-list {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.map-panel {
  position: relative;
  border-left: 1px solid var(--line)
}

.search-map {
  width: 100%;
  height: 100%
}

.map-overlays {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: var(--shadow-sm);
  z-index: 900
}

.listing-row {
  display: flex;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base)
}

.listing-row:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 93, 143, .25);
  box-shadow: var(--shadow-md)
}

.listing-row .row-image {
  width: 220px;
  min-height: 152px;
  background: linear-gradient(145deg, #dfe5f4, #cdd8ec);
  overflow: hidden;
  position: relative
}

.listing-row .row-image img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.listing-row .row-image.row-image-failed img {
  display: none
}

.listing-row .row-image.row-image-failed::after {
  content: 'No Image';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-500);
  font-weight: 600
}

.listing-row .row-body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px 12px 0;
  display: flex;
  flex-direction: column
}

.listing-row .row-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem
}

.listing-row .row-address {
  color: var(--ink-500);
  font-size: .86rem;
  margin: 2px 0 8px
}

.listing-row .row-price {
  color: var(--brand-700);
  font-weight: 800;
  font-size: 1.16rem;
  margin-bottom: 8px
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 18px 0 24px
}

.page-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-700);
  min-width: 38px;
  height: 36px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
  transition: all var(--transition-fast)
}

.page-btn:hover {
  border-color: var(--line-strong)
}

.page-btn.active {
  border-color: rgba(31, 142, 230, .35);
  background: var(--brand-50);
  color: var(--brand-700)
}

.property-container {
  padding: 30px 24px 58px
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-600);
  font-weight: 700;
  margin-bottom: 14px
}

.property-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px
}

.property-title-row h1 {
  font-size: clamp(1.7rem, 2.8vw, 2.3rem)
}

.prop-address {
  color: var(--ink-500);
  margin-top: 6px
}

.prop-price-box {
  text-align: right
}

.prop-price {
  color: var(--brand-700);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1
}

.prop-psf {
  color: var(--ink-500);
  font-size: .88rem
}

.property-gallery {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 220px 220px;
  gap: 8px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px
}

.property-gallery .gallery-img:first-child {
  grid-row: span 2
}

.property-gallery .gallery-img {
  position: relative;
  background: linear-gradient(145deg, #dfe5f4, #cad5ea)
}

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

.property-gallery .gallery-img.img-failed img {
  display: none
}

.property-gallery .gallery-img.img-failed::after {
  content: 'Image unavailable';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-500);
  font-size: .86rem
}

.gallery-placeholder-inner {
  min-height: 76px
}

.gallery-no-images-msg {
  margin-top: 8px;
  text-align: center;
  font-size: .8rem;
  color: var(--ink-500);
  padding: 0 10px
}

.gallery-no-images-msg code {
  background: #edf1fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1px 5px
}

.gallery-main-placeholder {
  grid-row: span 2
}

.property-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px
}

.detail-card,
.proximity-card,
.summary-card,
.form-card,
.agent-list li,
.admin-list .row {
  background: linear-gradient(180deg, #fff, #fafbff);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs)
}

.detail-card {
  padding: 20px;
  margin-bottom: 16px
}

.detail-card h3,
.proximity-card h3,
.summary-card h3,
.form-card h2 {
  margin-bottom: 14px
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px
}

.detail-label {
  font-size: .74rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-500)
}

.detail-value {
  font-weight: 700;
  color: var(--ink-800)
}

.property-map {
  width: 100%;
  height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden
}

.map-amenity-toggles {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--ink-600);
  font-size: .84rem
}

.map-toggle-label {
  color: var(--ink-500)
}

.property-map-note {
  margin-top: 8px;
  font-size: .84rem
}

.proximity-source-note {
  margin-top: 10px;
  font-size: .78rem
}

.proximity-card {
  padding: 18px;
  margin-bottom: 14px
}

.proximity-bands,
.proximity-list {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.band-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  color: var(--ink-500);
  margin-bottom: 5px
}

.band-items {
  display: flex;
  flex-direction: column;
  gap: 5px
}

.band-item,
.proximity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9ff;
  padding: 6px 9px;
  font-size: .86rem
}

.dist {
  color: var(--ink-500);
  font-size: .8rem
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.action-btn {
  display: block;
  text-align: center;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700
}

.txn-attribution {
  margin-top: 12px;
  font-size: .78rem
}

.txn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem
}

.txn-table th,
.txn-table td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line)
}

.txn-table th {
  color: var(--ink-500);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em
}

.val-verdict-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px
}

.val-badge {
  border-radius: 999px;
  padding: 7px 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 7px
}

.val-badge-good {
  background: #e7f7ee;
  color: #1e6f49
}

.val-badge-neutral {
  background: #eaf0ff;
  color: #244d91
}

.val-badge-warn {
  background: #fff0e7;
  color: #a65e00
}

.val-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 12px
}

.val-metric {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9ff;
  padding: 10px
}

.val-metric-label {
  display: block;
  margin-bottom: 4px;
  font-size: .76rem;
  text-transform: uppercase;
  color: var(--ink-500);
  font-weight: 700
}

.val-metric-value {
  font-weight: 800;
  color: var(--ink-800)
}

.val-reasons-list {
  padding-left: 20px
}

.val-reasons-list li {
  color: var(--ink-600);
  font-size: .9rem
}

.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - var(--nav-height))
}

.chat-sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcff, #f3f6fd);
  padding: 22px;
  overflow-y: auto
}

.persona-section,
.quick-questions {
  margin-bottom: 22px
}

.persona-section h3,
.quick-questions h3 {
  font-size: .84rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-500);
  margin-bottom: 10px
}

.persona-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px
}

.persona-btn {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: .84rem;
  font-weight: 700
}

.quick-questions {
  display: flex;
  flex-direction: column;
  gap: 7px
}

.quick-q {
  text-align: left;
  padding: 10px 12px;
  font-size: .85rem
}

.quick-q:hover {
  border-color: rgba(31, 142, 230, .35);
  background: var(--brand-50);
  color: var(--brand-700)
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0
}

.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f8fbff)
}

.chat-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap
}

.chat-memory-note {
  font-size: .84rem;
  color: var(--ink-500)
}

.chat-save-btn,
.chat-delete-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-700);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast)
}

.chat-save-btn:hover {
  border-color: rgba(31, 142, 230, .3);
  background: #f3f9ff;
  color: var(--brand-700)
}

.chat-save-btn.is-saved {
  background: linear-gradient(135deg, #eef7ff, #dceefe);
  border-color: rgba(31, 142, 230, .35);
  color: var(--brand-700)
}

.chat-save-btn:disabled,
.chat-delete-btn:disabled {
  cursor: not-allowed;
  opacity: .58;
  background: #f5f7fb;
  color: var(--ink-400);
  border-color: var(--line)
}

.chat-delete-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-700);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast)
}

.chat-delete-btn:hover {
  border-color: rgba(211, 68, 68, .28);
  background: #fff5f5;
  color: #b42318
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px
}

.welcome-message {
  max-width: 620px;
  margin: 42px auto 0;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fff, #f6f8ff);
  box-shadow: var(--shadow-sm);
  padding: 28px 24px
}

.welcome-message p {
  color: var(--ink-500)
}

.message {
  max-width: 78%;
  margin-bottom: 14px;
  border-radius: 16px;
  padding: 11px 14px;
  font-size: .95rem;
  line-height: 1.55;
  border: 1px solid transparent;
  animation: rise-in .2s ease
}

.message.user {
  margin-left: auto;
  border-color: rgba(31, 142, 230, .22);
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  color: #fff
}

.message.assistant,
.message.loading {
  margin-right: auto;
  background: #fff;
  border-color: var(--line);
  color: var(--ink-800)
}

.message .chat-link {
  color: var(--accent-600);
  font-weight: 700;
  text-decoration: underline
}

.chat-concierge-block {
  max-width: 78%;
  margin: 0 0 14px 0;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f8fbff);
  border-radius: 16px;
  padding: 12px 14px
}

.chat-concierge-title {
  font-weight: 800;
  color: var(--ink-800);
  margin-bottom: 8px
}

.chat-concierge-filters {
  margin: -2px 0 8px;
  color: var(--ink-600);
  font-size: .84rem;
  font-weight: 600
}

.chat-concierge-subtitle {
  margin: -2px 0 8px;
  color: var(--ink-500);
  font-size: .88rem
}

.chat-shortlist-row {
  border-top: 1px solid #e6ebf5;
  padding-top: 8px;
  margin-top: 8px
}

.chat-shortlist-row:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0
}

.chat-shortlist-header {
  font-weight: 700;
  color: var(--ink-800)
}

.chat-shortlist-meta {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: .86rem
}

.chat-shortlist-why {
  margin-top: 3px;
  color: var(--ink-600);
  font-size: .9rem
}

.chat-shortlist-actions {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: .86rem
}

.chat-shortlist-actions .favorite-btn {
  margin-top: 8px
}

.chat-clarification-list {
  display: flex;
  flex-direction: column;
  gap: 7px
}

.chat-clarification-option {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-700);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast)
}

.chat-clarification-option:hover {
  border-color: rgba(31, 142, 230, .35);
  background: var(--brand-50);
  color: var(--brand-700)
}

.message.loading::after {
  content: '...';
  animation: dots 1.4s infinite
}

@keyframes dots {

  0%,
  20% {
    content: '.'
  }

  40% {
    content: '..'
  }

  60%,
  100% {
    content: '...'
  }
}

.chat-input-area {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  padding: 14px 24px 16px
}

.input-wrapper {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px
}

.input-wrapper textarea {
  min-height: 44px;
  max-height: 128px;
  resize: none
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px
}

.send-btn:disabled {
  cursor: not-allowed;
  background: #d7dce9;
  box-shadow: none
}

.input-hint {
  margin-top: 5px;
  font-size: .76rem;
  color: var(--ink-500)
}

.transactions-page-wrap {
  padding: 2rem 1rem
}

.transactions-intro {
  margin-bottom: 1.5rem
}

.transactions-empty-hint {
  margin-bottom: 1rem
}

.txn-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem
}

.tab-btn {
  padding: 8px 16px;
  font-weight: 700
}

.tab-content {
  display: none
}

.tab-content.active {
  display: block
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
  flex-wrap: wrap
}

.summary-card {
  padding: 20px;
  margin-top: 1rem
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.stat-value {
  font-weight: 800;
  color: var(--ink-800)
}

.school-query-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-height))
}

.school-query-sidebar {
  width: 390px;
  min-width: 330px;
  background: rgba(255, 255, 255, .94);
  border-right: 1px solid var(--line);
  padding: 1rem;
  overflow-y: auto
}

.school-query-map {
  flex: 1;
  position: relative
}

#school-query-map-id {
  height: 100%
}

.sq-title {
  margin-bottom: 1rem
}

.sq-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line)
}

.sq-tab {
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--ink-500);
  cursor: pointer;
  font-weight: 700;
  padding: 10px 14px;
  margin-bottom: -1px
}

.sq-tab:hover {
  color: var(--ink-700)
}

.sq-tab.active {
  color: var(--brand-700);
  border-bottom-color: var(--brand-600)
}

.sq-panel {
  display: none
}

.sq-panel.active {
  display: block
}

.sq-legend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px 0
}

.sq-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink-700)
}

.sq-legend-swatch {
  width: 20px;
  height: 4px;
  border-radius: 99px
}

.sq-legend-red {
  background: #0ea5e9
}

.sq-legend-blue {
  background: #1d4ed8
}

.sq-legend-red-alt {
  background: #0ea5e9
}

.sq-legend-blue-alt {
  background: #1d4ed8
}

.sq-layer-toggles {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 10px;
  margin: 10px 0 12px
}

.sq-toggle {
  display: grid;
  grid-template-columns: 16px 1fr;
  column-gap: 10px;
  align-items: start;
  line-height: 1.4;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink-700)
}

.sq-toggle input {
  margin-top: 3px
}

.sq-house-marker {
  background: none !important;
  border: none !important
}

.sq-counts {
  font-size: .84rem;
  color: var(--ink-500);
  margin-bottom: 8px
}

.sq-list {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff
}

.sq-list-schools {
  max-height: 320px
}

.sq-list-item {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  font-size: .88rem;
  cursor: pointer;
  transition: background var(--transition-fast)
}

.sq-list-item:last-child {
  border-bottom: none
}

.sq-list-item:hover {
  background: var(--brand-50)
}

.sq-school-name {
  font-weight: 700
}

.sq-school-addr {
  margin-top: 1px;
  color: var(--ink-500);
  font-size: .78rem
}

.sq-detail-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 300px;
  max-height: 82%;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  padding: 1rem;
  z-index: 1000;
  display: none
}

.sq-detail-panel.visible {
  display: block
}

.sq-detail-panel h4 {
  margin-bottom: 8px
}

.close-panel {
  float: right;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--ink-500)
}

.sq-group {
  margin-top: 12px
}

.sq-group h4 {
  font-size: .94rem;
  margin-bottom: 4px
}

.sq-group-title {
  font-size: .95rem
}

.sq-control {
  margin-bottom: 8px
}

.sq-selected-school-label,
.sq-property-message {
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: .86rem
}

.sq-export-btn {
  margin-top: 12px;
  width: 100%
}

.agent-portal-page {
  min-height: 100vh
}

.auth-page {
  min-height: 100vh
}

.auth-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 80px
}

.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: 28px;
  align-items: stretch
}

.auth-copy,
.auth-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff, #f7f9ff);
  box-shadow: var(--shadow-md)
}

.auth-copy {
  padding: 34px 34px 30px;
  position: relative;
  overflow: hidden
}

.auth-page .eyebrow {
  background: var(--brand-50);
  border-color: rgba(31, 142, 230, .16);
  color: var(--brand-700)
}

.auth-copy h1 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  margin-bottom: 14px
}

.auth-copy p {
  max-width: 640px;
  color: var(--ink-600)
}

.auth-copy-points {
  display: grid;
  gap: 12px;
  margin-top: 24px
}

.auth-point {
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff, #f1f5fd);
  border: 1px solid rgba(31, 142, 230, .08)
}

.auth-point strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-900)
}

.auth-point span {
  color: var(--ink-600);
  font-size: .94rem
}

.auth-card {
  padding: 30px
}

.auth-card h2 {
  margin-bottom: 4px
}

.auth-card-subtitle {
  color: var(--ink-500);
  margin-bottom: 16px
}

.auth-submit-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 14px
}

.auth-links-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  color: var(--ink-500);
  font-size: .9rem
}

.auth-links-row a {
  color: var(--accent-600);
  font-weight: 700
}

.dashboard-page {
  min-height: 100vh
}

.dashboard-shell {
  padding: 32px 24px 64px
}

.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, #16223b, #23456e);
  color: #fff;
  box-shadow: var(--shadow-lg);
  margin-bottom: 28px
}

.dashboard-hero h1 {
  color: #fff;
  font-size: clamp(1.8rem, 2.6vw, 2.5rem);
  margin-bottom: 8px
}

.dashboard-hero p {
  max-width: 640px;
  color: rgba(241, 246, 255, .84)
}

.dashboard-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 22px
}

.dashboard-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: var(--shadow-sm);
  padding: 24px
}

.dashboard-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px
}

.dashboard-panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap
}

.dashboard-panel-note {
  margin: -6px 0 16px;
  font-size: .84rem
}

.dashboard-property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px
}

.dashboard-property-card {
  cursor: pointer
}

.dashboard-favorite-list {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.dashboard-favorite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease
}

.dashboard-favorite-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(31, 142, 230, .22)
}

.dashboard-favorite-row:focus-visible {
  outline: 3px solid rgba(31, 142, 230, .22);
  outline-offset: 3px
}

.dashboard-favorite-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.dashboard-favorite-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px
}

.dashboard-favorite-title-row h3 {
  margin: 0;
  font-size: 1.12rem
}

.dashboard-favorite-price {
  color: var(--brand-700);
  font-weight: 800;
  white-space: nowrap
}

.dashboard-favorite-address {
  margin: 0;
  color: var(--ink-500)
}

.dashboard-favorite-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px
}

.dashboard-favorite-meta span {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .76rem;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--ink-600);
  background: #f4f6fb
}

.dashboard-favorite-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end
}

.dashboard-compare-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  font-weight: 700;
  color: var(--ink-600)
}

.dashboard-compare-toggle input {
  width: auto
}

.dashboard-chat-list {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.dashboard-chat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease
}

.dashboard-chat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(31, 142, 230, .22)
}

.dashboard-chat-card:focus-visible {
  outline: 3px solid rgba(31, 142, 230, .22);
  outline-offset: 3px
}

.dashboard-chat-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.dashboard-chat-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px
}

.dashboard-chat-copy h3 {
  font-size: 1rem;
  margin: 0
}

.dashboard-chat-updated {
  color: var(--ink-500);
  font-size: .82rem;
  white-space: nowrap
}

.dashboard-chat-preview {
  margin: 0;
  color: var(--ink-600);
  line-height: 1.5
}

.dashboard-chat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px
}

.dashboard-chat-meta span {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .76rem;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--ink-600);
  background: #f4f6fb
}

.dashboard-chat-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.compare-shell .dashboard-panel {
  overflow-x: auto
}

.compare-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px
}

.compare-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm)
}

.compare-card h3 {
  margin: 0 0 6px
}

.compare-card-price {
  margin: 0 0 8px;
  color: var(--brand-700);
  font-weight: 800
}

.compare-card-address {
  margin: 0 0 12px;
  color: var(--ink-500)
}

.compare-table-wrap {
  overflow-x: auto
}

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0
}

.compare-table th,
.compare-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  background: #fff
}

.compare-table th {
  width: 220px;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--ink-700)
}

.agent-login-box {
  max-width: 430px;
  margin: 68px auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fff, #f8faff);
  box-shadow: var(--shadow-md);
  animation: rise-in .42s ease
}

.agent-login-box h1 {
  margin-bottom: 4px
}

.agent-login-sub {
  color: var(--ink-500);
  margin-bottom: 16px
}

.agent-form label,
.form-card label {
  display: block;
  margin: 10px 0 5px;
  font-weight: 700;
  color: var(--ink-700)
}

.agent-form button,
.form-card button,
.btn-primary {
  padding: 10px 18px
}

.agent-form .btn-primary {
  display: flex;
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  position: relative;
  z-index: 1
}

.portal-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(31, 142, 230, .18);
  border-radius: 14px;
  background: #f5faff;
  color: var(--brand-700);
  font-size: .88rem
}

.agent-register-hint {
  margin-top: 14px;
  text-align: center;
  color: var(--ink-500)
}

.agent-register-hint a {
  color: var(--accent-600);
  font-weight: 700
}

.agent-dashboard-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 18px
}

.agent-list {
  list-style: none
}

.agent-list li {
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 3px 9px;
  font-size: .76rem;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--ink-600);
  background: #f4f6fb
}

.status.pending {
  color: #8a5311;
  background: #fff3dc;
  border-color: #f0d4a9
}

.status.approved {
  color: #1e6f49;
  background: #e9f8ef;
  border-color: #b7dfc7
}

.status.rejected {
  color: #1f5f9c;
  background: #eaf4ff;
  border-color: #b8d3f1
}

.status.sold,
.status.rented {
  color: #1f4f8d;
  background: #e8f1ff;
  border-color: #b4d0ee
}

.form-card {
  max-width: 760px;
  margin: 32px auto;
  padding: 24px
}

.form-card .form-group {
  margin-bottom: 12px
}

.form-card .form-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap
}

.form-card .form-row .form-group {
  flex: 1;
  min-width: 160px
}

.hint {
  color: var(--ink-500);
  font-size: .85rem
}

.listing-map-box {
  width: 100%;
  height: 260px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px
}

.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px
}

.admin-tab {
  padding: 8px 14px;
  font-weight: 700
}

.admin-list .row {
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

@media (min-width:981px) {
  body.search-page {
    height: 100vh;
    overflow: hidden
  }

  .search-layout {
    height: calc(100dvh - var(--nav-height));
    min-height: calc(100dvh - var(--nav-height));
    overflow: hidden;
  }

  .search-sidebar {
    height: 100%;
    overflow-y: auto
  }

  .search-main {
    height: 100%;
    overflow: hidden
  }

  .search-content {
    overflow: hidden
  }

  .listings-panel {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain
  }

  .map-panel {
    height: 100%;
    overflow: hidden
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important
  }
}

@media (max-width:1180px) {
  .nav-links {
    gap: 6px
  }

  .nav-link {
    font-size: .9rem;
    padding: 8px 11px
  }

  .search-layout {
    grid-template-columns: 288px 1fr
  }

  .property-grid {
    grid-template-columns: 1fr
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px
  }

  .features-shell {
    grid-template-columns: 1fr
  }
}

@media (max-width:980px) {

  .search-layout,
  .chat-layout,
  .school-query-layout {
    display: flex;
    flex-direction: column;
    min-height: auto
  }

  .search-sidebar,
  .chat-sidebar,
  .school-query-sidebar {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: none
  }

  .chat-toolbar {
    flex-direction: column;
    align-items: flex-start
  }

  .hero-content-split,
  .auth-split,
  .dashboard-grid,
  .features-grid {
    grid-template-columns: 1fr
  }

  .hero-showcase {
    order: 2
  }

  .hero-preview-grid {
    grid-template-columns: 1fr
  }

  .local-data-stats,
  .local-data-gallery {
    grid-template-columns: 1fr
  }

  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start
  }

  .search-content {
    min-height: 620px
  }

  .search-content.split-view {
    flex-direction: column
  }

  .search-content.split-view .listings-panel,
  .search-content.split-view .map-panel {
    width: 100%
  }

  .search-content.split-view .map-panel {
    height: 360px
  }

  .map-panel {
    border-left: none;
    border-top: 1px solid var(--line)
  }

  .property-gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 200px 200px
  }

  .property-gallery .gallery-img:first-child {
    grid-column: span 2;
    grid-row: auto
  }

  .nav-container {
    height: auto;
    min-height: var(--nav-height);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    padding-bottom: 10px
  }

  .nav-logo .logo-img {
    height: 54px
  }

  .nav-logo::after {
    font-size: 1.2rem
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px
  }

  .nav-links::-webkit-scrollbar {
    height: 6px
  }
}

@media (max-width:760px) {

  .container,
  .nav-container,
  .hero-content,
  .agent-dashboard-wrap,
  .property-container {
    padding-left: 16px;
    padding-right: 16px
  }

  .hero {
    padding: 74px 0 64px
  }

  .hero h1 {
    font-size: 1.95rem
  }

  .hero-cta-row {
    flex-direction: column
  }

  .hero-cta {
    width: 100%
  }

  .search-form,
  .search-bar-wrapper,
  .input-wrapper {
    grid-template-columns: 1fr
  }

  .search-btn,
  .search-btn-sm,
  .send-btn {
    width: 100%;
    height: 44px
  }

  .search-topbar {
    flex-wrap: wrap;
    align-items: stretch
  }

  .results-count {
    width: 100%
  }

  .listing-row {
    flex-direction: column
  }

  .listing-row .row-image {
    width: 100%;
    height: 180px
  }

  .listing-row .row-body {
    padding: 12px
  }

  .message {
    max-width: 92%
  }

  .chat-concierge-block {
    max-width: 92%
  }

  .agent-login-box {
    margin: 44px 16px;
    padding: 24px
  }

  .auth-shell,
  .dashboard-shell {
    padding-left: 16px;
    padding-right: 16px
  }

  .auth-copy,
  .auth-card,
  .dashboard-panel,
  .dashboard-hero {
    padding: 22px
  }

  .features-intro-card {
    padding: 22px
  }

  .form-card {
    margin: 20px 16px
  }

  .property-title-row {
    flex-direction: column
  }

  .prop-price-box {
    text-align: left
  }

  .dashboard-favorite-row,
  .dashboard-chat-card {
    align-items: flex-start;
    flex-direction: column
  }

  .dashboard-favorite-actions,
  .dashboard-chat-actions {
    width: 100%;
    justify-content: flex-start
  }

  .dashboard-favorite-title-row,
  .dashboard-chat-title-row {
    align-items: flex-start;
    flex-direction: column
  }

  .dashboard-panel-head,
  .dashboard-panel-actions {
    align-items: flex-start;
    flex-direction: column
  }

  .map-overlays {
    border-radius: var(--radius-sm);
    flex-wrap: wrap
  }

  .school-query-map {
    min-height: 420px
  }

  .sq-detail-panel {
    width: calc(100% - 24px);
    right: 12px
  }
}

/* Final layout override must live after the product polish block. */
@media (min-width: 981px) {
  .school-query-layout {
    height: calc(100dvh - var(--nav-height));
    min-height: 0;
    overflow: hidden
  }

  .school-query-sidebar {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: hidden
  }

  .sq-title {
    margin-bottom: 8px
  }

  .sq-tabs {
    margin-bottom: 8px
  }

  .sq-tab {
    padding: 7px 9px;
    font-size: .78rem
  }

  .sq-panel.active {
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden
  }

  #panel-buildings.sq-panel.active,
  #panel-schools.sq-panel.active {
    display: flex;
    flex-direction: column
  }

  #sq-school-list,
  #sq-property-pick-list {
    flex: 0 1 82px;
    max-height: 82px;
    overflow-y: auto
  }

  .sq-selected-school-label {
    max-height: 38px;
    overflow: hidden;
    margin: 6px 0;
    line-height: 1.25
  }

  .sq-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 8px 0
  }

  .sq-legend-item {
    font-size: .78rem;
    gap: 7px
  }

  .sq-layer-toggles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 6px 0
  }

  .sq-toggle {
    grid-template-columns: 14px 1fr;
    column-gap: 7px;
    font-size: .76rem;
    line-height: 1.25
  }

  .sq-counts {
    font-size: .76rem;
    margin: 4px 0
  }

  #sq-action-bar:not(.is-hidden) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    margin: 6px 0;
    flex: 0 0 auto
  }

  .sq-export-btn {
    min-width: 0;
    min-height: 32px;
    padding: 6px 7px;
    font-size: .72rem;
    line-height: 1.1;
    white-space: normal
  }

  .sq-property-filters {
    flex: 0 0 auto;
    padding: 7px;
    margin-bottom: 6px
  }

  .sq-filter-row {
    gap: 6px;
    margin-bottom: 5px
  }

  .sq-filter-group {
    min-width: 0
  }

  .sq-toggle-btns {
    gap: 4px
  }

  .sq-filter-btn {
    padding: 4px 7px;
    font-size: .72rem
  }

  .sq-price-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 5px
  }

  .sq-price-group .stat-label {
    grid-column: 1 / -1
  }

  .sq-price-input {
    min-width: 0;
    height: 32px;
    padding: 6px 8px
  }

  #sq-properties-list {
    flex: 1 1 auto;
    min-height: 58px;
    max-height: none;
    overflow-y: auto
  }

  .sq-list-colored {
    max-height: 15dvh
  }
}

.sq-price-input::-webkit-outer-spin-button,
.sq-price-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none
}

.sq-price-input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield
}

body:has(.school-query-layout) .floating-chat-btn {
  bottom: max(72px, env(safe-area-inset-bottom))
}

@media (max-width: 980px) {
  .school-query-sidebar {
    width: 100%;
    min-width: 0
  }

  #sq-action-bar:not(.is-hidden) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px
  }

  .sq-export-btn {
    min-width: 0;
    white-space: normal;
    line-height: 1.1
  }

  body:has(.school-query-layout) .floating-chat-btn {
    bottom: max(86px, env(safe-area-inset-bottom));
    right: max(14px, env(safe-area-inset-right))
  }
}

/* Ultimate School Query restore: keep the map red/green and the sidebar naturally scrollable. */
@media (min-width: 981px) {
  .school-query-layout {
    height: calc(100vh - var(--nav-height)) !important;
    min-height: calc(100vh - var(--nav-height)) !important;
    overflow: hidden !important
  }

  .school-query-sidebar {
    display: block !important;
    height: auto !important;
    max-height: calc(100vh - var(--nav-height)) !important;
    padding: 1rem !important;
    overflow-y: auto !important
  }

  .sq-panel.active,
  #panel-buildings.sq-panel.active,
  #panel-schools.sq-panel.active {
    display: block !important;
    min-height: 0 !important;
    overflow: visible !important;
    flex: initial !important
  }

  #sq-school-list,
  #sq-property-pick-list {
    flex: initial !important;
    max-height: 220px !important;
    overflow-y: auto !important
  }

  #sq-properties-list {
    flex: initial !important;
    min-height: 0 !important;
    max-height: 300px !important;
    overflow-y: auto !important
  }

  #sq-action-bar:not(.is-hidden) {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 10px !important;
    margin: 10px 0 6px !important
  }
}

.sq-legend-red,
.sq-legend-red-alt,
.sq-dot-red,
.sq-band-indicator-near {
  background: #ef4444 !important
}

.sq-legend-blue,
.sq-legend-blue-alt,
.sq-dot-green,
.sq-band-indicator-far {
  background: #22c55e !important
}

.sq-school-1km,
.sq-prop-band-red {
  border-left-color: #ef4444 !important
}

.sq-school-2km,
.sq-prop-band-blue {
  border-left-color: #22c55e !important
}

/* AramSpaces-inspired final visual layer */
:root {
  --brand-beige: #f9f7f2;
  --brand-sage-dark: #2d3a30;
  --brand-sage: #5a6b5d;
  --brand-gold: #c5a059;
  --brand-ink: #1a1a1a;
  --brand-50: #f4efe5;
  --brand-500: #c5a059;
  --brand-600: #b8934c;
  --brand-700: #5a6b5d;
  --brand-800: #2d3a30;
  --accent-600: #c5a059;
  --ink-900: #1a1a1a;
  --ink-800: #26302a;
  --ink-700: #38453d;
  --ink-600: #5a6b5d;
  --ink-500: #7b857e;
  --line: rgba(45, 58, 48, .14);
  --line-strong: rgba(45, 58, 48, .24);
  --shadow-xs: 0 8px 24px rgba(26, 26, 26, .05);
  --shadow-sm: 0 14px 32px rgba(26, 26, 26, .08);
  --shadow-md: 0 22px 55px rgba(26, 26, 26, .12);
  --shadow-lg: 0 34px 80px rgba(26, 26, 26, .16);
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif
}

body {
  background: var(--brand-beige);
  color: var(--brand-ink);
  font-family: var(--font-body)
}

h1,
h2,
h3 {
  color: var(--brand-sage-dark);
  font-family: var(--font-heading);
  font-weight: 400
}

h4,
h5,
button,
input,
select,
textarea,
.nav-link,
.btn-primary,
.btn-secondary,
.row-action,
.search-btn,
.search-tab,
.filter-input,
.filter-select {
  font-family: var(--font-body)
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1200;
  height: auto;
  padding: 16px clamp(14px, 4vw, 80px);
  border: 0;
  background: transparent;
  box-shadow: none
}

.home-page .navbar {
  position: absolute;
  inset: 0 0 auto 0;
  background: transparent
}

.nav-container {
  width: min(1280px, 100%);
  min-height: 70px;
  margin: 0 auto;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  background: rgba(249, 247, 242, .84);
  box-shadow: 0 14px 40px rgba(26, 26, 26, .12);
  backdrop-filter: blur(22px)
}

.nav-logo {
  gap: 10px;
  color: var(--brand-sage-dark)
}

.nav-logo .logo-img {
  height: 46px
}

.nav-logo::after {
  color: var(--brand-sage-dark);
  font-family: var(--font-body);
  font-size: 1.15rem;
  letter-spacing: 0;
  font-weight: 800
}

.nav-links {
  gap: 10px
}

.nav-link {
  color: rgba(45, 58, 48, .86);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700
}

.nav-link.active,
.nav-link:hover {
  color: var(--brand-sage-dark);
  border-color: rgba(197, 160, 89, .34);
  background: rgba(197, 160, 89, .16)
}

.btn-primary,
.apply-filters-btn,
.search-btn,
.search-btn-sm,
.send-btn,
.action-btn:not(.secondary),
.row-action.primary {
  border-color: var(--brand-gold) !important;
  background: var(--brand-gold) !important;
  color: #fff !important;
  box-shadow: 0 14px 32px rgba(197, 160, 89, .22)
}

.btn-primary:hover,
.apply-filters-btn:hover,
.search-btn:hover,
.search-btn-sm:hover,
.send-btn:hover,
.action-btn:not(.secondary):hover,
.row-action.primary:hover {
  background: #b8934c !important;
  transform: translateY(-1px)
}

.btn-secondary,
.action-btn.secondary,
.row-action {
  border-color: rgba(45, 58, 48, .16);
  background: rgba(255, 255, 255, .78);
  color: var(--brand-sage-dark)
}

.favorite-btn {
  min-width: 38px;
  min-height: 38px;
  padding: 8px;
  border-color: rgba(255, 255, 255, .72);
  color: var(--brand-sage-dark);
  background: rgba(249, 247, 242, .86);
  box-shadow: 0 12px 26px rgba(26, 26, 26, .12)
}

.favorite-btn.is-favorited {
  color: #fff;
  border-color: var(--brand-gold);
  background: var(--brand-gold)
}

.home-page .hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 136px 24px 82px;
  border: 0;
  background: #0f120f;
  color: #fff
}

.home-page .hero-bg {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  background: #0f120f
}

.home-page .hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .62) 0%, rgba(0, 0, 0, .16) 48%, rgba(249, 247, 242, .26) 100%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, .08), rgba(0, 0, 0, .36))
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-image: var(--hero-image);
  background-position: center;
  background-size: cover;
  transform: scale(1.05);
  animation: homeHeroFade 24s infinite ease-in-out
}

.hero-slide:nth-child(2) {
  animation-delay: 6s
}

.hero-slide:nth-child(3) {
  animation-delay: 12s
}

.hero-slide:nth-child(4) {
  animation-delay: 18s
}

@keyframes homeHeroFade {
  0% {
    opacity: 0;
    transform: scale(1.05)
  }
  8%,
  28% {
    opacity: 1;
    transform: scale(1)
  }
  36%,
  100% {
    opacity: 0;
    transform: scale(1.03)
  }
}

.home-page .hero-content,
.home-page .hero-content-split {
  position: relative;
  z-index: 3;
  width: min(980px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center
}

.home-page .hero-copy {
  max-width: 940px;
  margin: 0 auto
}

.home-page .eyebrow {
  color: rgba(255, 255, 255, .86);
  letter-spacing: .42em;
  font-size: .76rem;
  font-weight: 800
}

.home-page .hero h1 {
  max-width: 980px;
  margin: 16px auto 18px;
  color: #fff;
  font-size: clamp(3.1rem, 8vw, 6.6rem);
  line-height: .96;
  text-shadow: 0 18px 70px rgba(0, 0, 0, .38)
}

.home-page .hero h1 em {
  font-style: italic;
  color: #fff
}

.home-page .hero-sub {
  max-width: 720px;
  margin: 0 auto;
  color: rgba(255, 255, 255, .84);
  font-size: clamp(1rem, 2vw, 1.34rem);
  line-height: 1.65
}

.home-page .hero-cta-row {
  justify-content: center;
  margin: 28px 0 0
}

.home-page .hero-cta {
  min-height: 54px;
  border-radius: 999px;
  padding: 14px 28px;
  letter-spacing: .08em;
  text-transform: uppercase
}

.home-page .hero-cta.secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .14)
}

.home-page .hero-search {
  width: min(740px, 100%);
  margin: 8px auto 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 28px;
  background: rgba(249, 247, 242, .88);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .22);
  backdrop-filter: blur(18px)
}

.home-page .search-tabs {
  gap: 8px;
  margin-bottom: 10px
}

.home-page .search-tab {
  border-radius: 999px;
  color: var(--brand-sage-dark);
  background: rgba(255, 255, 255, .64)
}

.home-page .search-tab.active {
  color: #fff;
  border-color: var(--brand-sage-dark);
  background: var(--brand-sage-dark)
}

.home-page .search-form {
  gap: 10px
}

.home-page .search-input {
  min-height: 52px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9)
}

.home-page .search-btn {
  min-height: 52px;
  border-radius: 999px;
  padding-inline: 28px
}

.home-page .hero-showcase {
  display: none
}

.home-page .hero-tags {
  justify-content: center;
  margin-top: 8px
}

.home-page .hero-tag {
  color: rgba(255, 255, 255, .88);
  border-color: rgba(255, 255, 255, .32);
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(10px)
}

.home-page .hero-tag:hover {
  color: #fff;
  border-color: rgba(197, 160, 89, .72);
  background: rgba(197, 160, 89, .24)
}

.features-section,
.map-preview-section,
.listings-section,
.search-layout,
.school-query-layout,
.chat-layout,
.auth-section {
  background: var(--brand-beige)
}

.section-title {
  color: var(--brand-sage-dark);
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 1.04
}

.features-intro-card,
.feature-card,
.property-card,
.listing-row,
.detail-card,
.proximity-card,
.action-card,
.dashboard-panel,
.auth-copy,
.auth-card,
.agent-login-box,
.dashboard-chat-card,
.dashboard-favorite-row {
  border-color: rgba(45, 58, 48, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .74);
  box-shadow: 0 14px 32px rgba(26, 26, 26, .06)
}

.feature-card:hover,
.property-card:hover,
.listing-row:hover {
  border-color: rgba(197, 160, 89, .42);
  box-shadow: 0 22px 55px rgba(26, 26, 26, .12)
}

.feature-visual,
.card-image,
.row-image,
.property-gallery {
  border-radius: 16px
}

.source-badge,
.prop-trust-badge.source-badge {
  color: #166534;
  border-color: rgba(34, 197, 94, .25);
  background: rgba(34, 197, 94, .12)
}

.freshness-badge,
.agent-badge,
.prop-trust-badge,
.row-meta span,
.card-meta span {
  color: var(--brand-sage-dark);
  border-color: rgba(45, 58, 48, .14);
  background: rgba(249, 247, 242, .78)
}

.site-footer {
  margin-top: 48px;
  border: 0;
  background: var(--brand-sage-dark);
  color: rgba(249, 247, 242, .78)
}

.site-footer h4 {
  color: var(--brand-beige);
  font-family: var(--font-heading);
  font-weight: 500
}

.site-footer a {
  color: rgba(249, 247, 242, .78)
}

.site-footer a:hover {
  color: var(--brand-gold)
}

.footer-bottom {
  color: rgba(249, 247, 242, .62);
  border-top-color: rgba(249, 247, 242, .14)
}

/* Restore School Query map semantics and natural sidebar scrolling. */
.sq-legend-red,
.sq-legend-red-alt,
.sq-dot-red,
.sq-band-indicator-near {
  background: #ef4444
}

.sq-legend-blue,
.sq-legend-blue-alt,
.sq-dot-green,
.sq-band-indicator-far {
  background: #22c55e
}

.sq-school-1km,
.sq-prop-band-red {
  border-left-color: #ef4444
}

.sq-school-2km,
.sq-prop-band-blue {
  border-left-color: #22c55e
}

.sq-band-header-red {
  color: #991b1b;
  border-bottom-color: #fecaca;
  background: linear-gradient(90deg, #fff1f2, #fff7f7)
}

.sq-band-header-green {
  color: #166534;
  border-bottom-color: #bbf7d0;
  background: linear-gradient(90deg, #f0fdf4, #ecfdf3)
}

@media (min-width: 981px) {
  .school-query-layout {
    height: calc(100vh - var(--nav-height));
    min-height: calc(100vh - var(--nav-height));
    overflow: hidden
  }

  .school-query-sidebar {
    width: 390px;
    min-width: 330px;
    height: auto;
    max-height: calc(100vh - var(--nav-height));
    display: block;
    padding: 1rem;
    overflow-y: auto
  }

  .school-query-map,
  #school-query-map-id {
    min-height: 0;
    height: 100%
  }

  .sq-panel.active {
    display: block;
    min-height: 0;
    overflow: visible
  }

  #panel-buildings.sq-panel.active,
  #panel-schools.sq-panel.active {
    display: block
  }

  #sq-school-list,
  #sq-property-pick-list {
    max-height: 220px;
    overflow-y: auto
  }

  #sq-properties-list {
    max-height: 300px;
    overflow-y: auto
  }

  #sq-action-bar:not(.is-hidden) {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    margin: 10px 0 6px
  }

  .sq-property-filters {
    padding: 10px;
    margin-bottom: 10px
  }

  .sq-legend,
  .sq-layer-toggles {
    grid-template-columns: 1fr
  }

  .sq-export-btn {
    min-width: 90px;
    min-height: 38px;
    padding: 8px 10px;
    font-size: .8rem
  }
}

@media (max-width: 760px) {
  .navbar {
    padding: 10px 12px
  }

  .nav-container {
    min-height: 62px;
    padding: 0 14px
  }

  .home-page .hero {
    min-height: 100svh;
    padding: 116px 16px 58px
  }

  .home-page .hero h1 {
    font-size: clamp(2.55rem, 15vw, 4.2rem)
  }

  .home-page .hero-search {
    border-radius: 22px
  }

  .home-page .search-form {
    grid-template-columns: 1fr
  }

  .home-page .search-btn {
    width: 100%
  }
}

/* Final client polish: calm color system, image cards, and School Query fit */
@media (min-width: 981px) {
  .school-query-layout {
    height: calc(100dvh - var(--nav-height));
    min-height: 0;
    overflow: hidden
  }

  .school-query-sidebar {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 12px;
    overflow: hidden
  }

  .school-query-map {
    min-height: 0
  }

  #school-query-map-id {
    min-height: 0
  }

  .sq-title,
  .sq-tabs {
    flex: 0 0 auto
  }

  .sq-title {
    margin-bottom: 10px
  }

  .sq-tabs {
    margin-bottom: 10px
  }

  .sq-panel.active {
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden
  }

  #panel-buildings.sq-panel.active,
  #panel-schools.sq-panel.active {
    display: flex;
    flex-direction: column
  }

  #sq-school-list,
  #sq-property-pick-list {
    flex: 0 1 19dvh;
    max-height: 19dvh;
    overflow-y: auto
  }

  #sq-properties-list,
  #sq-list-within-1km,
  #sq-list-between-1-2km {
    min-height: 92px;
    overflow-y: auto
  }

  #sq-properties-list {
    flex: 1 1 auto;
    max-height: none
  }

  .sq-list-colored {
    max-height: 18dvh
  }

  .sq-action-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    margin: 8px 0;
    flex: 0 0 auto
  }

  .sq-export-btn {
    min-width: 0;
    min-height: 34px;
    padding: 7px 8px;
    font-size: .74rem;
    line-height: 1.15;
    white-space: normal
  }

  .sq-property-filters {
    flex: 0 0 auto;
    padding: 8px;
    margin-bottom: 8px
  }

  .sq-filter-row {
    gap: 8px;
    margin-bottom: 6px
  }

  .sq-filter-group {
    min-width: 0
  }

  .sq-toggle-btns {
    gap: 5px
  }

  .sq-filter-btn {
    padding: 5px 8px;
    font-size: .74rem
  }

  .sq-price-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px
  }

  .sq-price-group .stat-label {
    grid-column: 1 / -1
  }
}

.sq-price-input {
  min-width: 0
}

.sq-price-input::-webkit-outer-spin-button,
.sq-price-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none
}

.sq-price-input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield
}

body:has(.school-query-layout) .floating-chat-btn {
  bottom: max(72px, env(safe-area-inset-bottom))
}

@media (max-width: 980px) {
  .school-query-layout {
    min-height: 0
  }

  .school-query-sidebar {
    width: 100%;
    min-width: 0
  }

  .sq-action-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px
  }

  .sq-export-btn {
    min-width: 0;
    white-space: normal;
    line-height: 1.15
  }

  body:has(.school-query-layout) .floating-chat-btn {
    bottom: max(86px, env(safe-area-inset-bottom));
    right: max(14px, env(safe-area-inset-right))
  }
}

/* =====================================================
   Phase A — School Query: OneMap colors, action bar
   ===================================================== */
.sq-action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 6px;
  padding: 10px;
  background: linear-gradient(180deg, #f0f5ff, #e8f0fb);
  border: 1px solid rgba(31, 142, 230, .18);
  border-radius: var(--radius-sm)
}

.sq-action-bar.is-hidden {
  display: none !important
}

.sq-export-btn {
  flex: 1;
  min-width: 90px;
  padding: 8px 10px;
  font-size: .8rem;
  font-weight: 700;
  min-height: 38px
}

.sq-property-filters {
  background: #f7f9ff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 10px
}

.sq-property-filters.is-hidden {
  display: none
}

.sq-filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px
}

.sq-filter-row:last-child {
  margin-bottom: 0
}

.sq-filter-group {
  flex: 1;
  min-width: 100px
}

.sq-toggle-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap
}

.sq-filter-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-600);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast)
}

.sq-filter-btn.active {
  color: var(--brand-700);
  border-color: rgba(31, 142, 230, .35);
  background: var(--brand-50)
}

.sq-price-group {
  flex: 100%
}

.sq-price-input {
  padding: 7px 10px;
  font-size: .85rem
}

.sq-school-band {
  margin: 10px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line)
}

.sq-band-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: .85rem;
  font-weight: 700;
  margin: 0
}

.sq-band-indicator {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .8)
}

.sq-band-indicator-near {
  background: #ef4444
}

.sq-band-indicator-far {
  background: #2f855a
}

.sq-band-header-red {
  background: linear-gradient(90deg, #fff1f2, #fff7f7);
  color: #991b1b;
  border-bottom: 1px solid #fecaca
}

.sq-band-header-green {
  background: linear-gradient(90deg, #f0fdf4, #ecfdf3);
  color: #166534;
  border-bottom: 1px solid #bbf7d0
}

.sq-list-colored {
  max-height: 220px;
  overflow-y: auto;
  background: #fff
}

.sq-school-1km {
  border-left: 3px solid #ef4444
}

.sq-school-2km {
  border-left: 3px solid #2f855a
}

.sq-school-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px
}

.sq-dot-red {
  background: #ef4444
}

.sq-dot-green {
  background: #2f855a
}

.sq-school-dist {
  font-size: .76rem;
  color: var(--ink-500)
}

.sq-no-result {
  padding: 8px 12px;
  font-size: .84rem;
  color: var(--ink-500)
}

.sq-prop-band-red {
  border-left: 3px solid #38bdf8
}

.sq-prop-band-blue {
  border-left: 3px solid #2563eb
}

.sq-prop-type-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px
}

.sq-prop-info {
  min-width: 0;
  flex: 1
}

.sq-prop-name {
  font-weight: 700;
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.sq-prop-meta {
  font-size: .76rem;
  color: var(--ink-500);
  margin-top: 1px
}

.sq-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px
}

.sq-popup-heart {
  transition: transform .15s ease
}

.sq-popup-heart:hover {
  transform: scale(1.25)
}

.sq-heart-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 10px;
  transition: all var(--transition-fast);
  color: var(--ink-600)
}

.sq-heart-btn:hover {
  border-color: rgba(37, 111, 156, .35);
  color: var(--brand-700);
  background: var(--brand-50)
}

.sq-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap
}

/* =====================================================
   Phase B — Property: agent, save-top, source btn
   ===================================================== */
.prop-save-top {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  padding: 9px 16px;
  min-height: 40px
}

.prop-agent-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--ink-600);
  font-size: .88rem
}

.prop-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(31, 142, 230, .25);
  background: var(--brand-50);
  color: var(--brand-700);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .8rem;
  font-weight: 700;
  transition: all var(--transition-fast)
}

.prop-source-btn:hover {
  background: #dbeafe;
  border-color: rgba(31, 142, 230, .5)
}

.prop-agent-contact {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f7f9ff;
  padding: 12px 14px;
  margin-top: 4px
}

.prop-agent-contact.is-hidden {
  display: none
}

.prop-agent-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-500);
  margin-bottom: 4px
}

.prop-agent-name {
  font-weight: 700;
  color: var(--ink-800);
  font-size: .95rem
}

.agent-badge {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .76rem;
  font-weight: 600;
  border: 1px solid rgba(31, 142, 230, .18);
  color: var(--brand-700);
  background: #eff7ff
}

.row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0
}

.source-badge,
.freshness-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .72rem;
  font-weight: 800;
  border: 1px solid var(--line);
  background: #f4f6fb;
  color: var(--ink-600)
}

.source-badge {
  color: #1e6f49;
  background: #e9f8ef;
  border-color: #b7dfc7
}

.freshness-badge {
  color: #1f5f9c;
  background: #eaf4ff;
  border-color: #b8d3f1
}

/* =====================================================
   Phase B4/B5 — District multi-select + HDB panels
   ===================================================== */
.search-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px
}

.search-mode-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-600);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition-fast)
}

.search-mode-tab.active,
.search-mode-tab:hover {
  color: var(--brand-700);
  border-color: rgba(31, 142, 230, .35);
  background: var(--brand-50)
}

.district-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden
}

.district-panel.is-hidden {
  display: none
}

.district-panel-header {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  background: #f4f6fb;
  border-bottom: 1px solid var(--line)
}

.district-ctrl-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-600);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast)
}

.district-ctrl-btn:hover {
  border-color: rgba(31, 142, 230, .35);
  background: var(--brand-50);
  color: var(--brand-700)
}

.district-checkboxes {
  max-height: 220px;
  overflow-y: auto;
  padding: 6px 0
}

.district-check-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 10px;
  font-size: .82rem;
  color: var(--ink-700);
  cursor: pointer;
  transition: background var(--transition-fast)
}

.district-check-label:hover {
  background: #f0f5ff
}

.district-check-label input {
  width: auto;
  min-width: auto;
  flex-shrink: 0;
  margin-top: 2px
}

.district-check-label span {
  line-height: 1.35
}

/* =====================================================
   Phase B7 — Compare: agent, print
   ===================================================== */
.compare-card-agent {
  margin: 0 0 6px;
  color: var(--ink-600);
  font-size: .86rem
}

.compare-card-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px
}

@media print {

  .navbar,
  .site-footer,
  .floating-chat-btn,
  .dashboard-hero-actions {
    display: none !important
  }

  .compare-table-wrap {
    overflow: visible !important
  }
}

/* =====================================================
   Final Product Polish — Singapore property portal shell
   ===================================================== */
.navbar {
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(17, 24, 39, .04);
  backdrop-filter: blur(14px)
}

.nav-logo {
  min-width: 160px
}

.nav-logo .logo-img {
  height: 52px;
  filter: none
}

.nav-logo::after {
  font-family: var(--font-heading);
  letter-spacing: 0;
  font-size: 1.22rem;
  font-weight: 800
}

.nav-link {
  border-radius: 8px;
  padding: 9px 11px;
  font-size: .9rem
}

.nav-link.active,
.nav-link:hover {
  color: var(--brand-700);
  border-color: rgba(37, 111, 156, .24);
  background: var(--brand-50);
  transform: none
}

.btn-primary,
.apply-filters-btn,
.search-btn,
.search-btn-sm,
.send-btn,
.action-btn:not(.secondary) {
  background: var(--brand-600);
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(37, 111, 156, .16)
}

.btn-secondary,
.action-btn.secondary {
  background: #fff;
  border-radius: 8px;
  box-shadow: none
}

.eyebrow,
.features-eyebrow,
.hero-metric-label,
.filter-group>label,
.stat-label,
.prop-agent-label {
  letter-spacing: 0
}

.hero {
  min-height: auto;
  padding: 58px 0 34px;
  color: var(--ink-900);
  background: #ffffff;
  border-bottom: 1px solid var(--line)
}

.hero-bg {
  display: none
}

.hero-content-split {
  grid-template-columns: minmax(0, 1fr) minmax(330px, .78fr);
  gap: 28px
}

.hero h1 {
  max-width: 760px;
  color: var(--ink-900);
  font-size: clamp(2.05rem, 4vw, 3.1rem);
  line-height: 1.06;
  margin-bottom: 12px
}

.hero-sub {
  max-width: 690px;
  color: var(--ink-600);
  font-size: 1rem;
  margin-bottom: 20px
}

.hero-cta-row {
  margin-bottom: 18px
}

.hero-cta {
  min-height: 48px;
  border-radius: 8px
}

.hero-search {
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  background: #fff
}

.search-tab {
  border-radius: 8px
}

.search-tab.active,
.toggle-btn.active,
.bed-btn.active,
.view-btn.active,
.tab-btn.active,
.admin-tab.active,
.persona-btn.active,
.search-mode-tab.active,
.search-mode-tab:hover,
.sq-filter-btn.active,
.district-ctrl-btn:hover,
.page-btn.active {
  color: var(--brand-700);
  border-color: rgba(37, 111, 156, .24);
  background: var(--brand-50)
}

.hero-showcase {
  align-self: stretch
}

.hero-copy[data-reveal],
.hero-showcase[data-reveal] {
  opacity: 1;
  transform: none
}

.hero-metric-card {
  border-radius: 8px;
  border-color: var(--line);
  background: #f9fafb;
  box-shadow: none
}

.hero-metric-card strong,
.hero-preview-copy,
.hero-preview-copy strong {
  color: var(--ink-900)
}

.hero-metric-card p,
.hero-preview-copy span,
.hero-metric-label {
  color: var(--ink-600)
}

.hero-preview-card {
  border-color: var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm)
}

.hero-preview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md)
}

.hero-tags {
  margin-top: 18px
}

.hero-tag {
  border-color: var(--line);
  background: #fff;
  color: var(--ink-700)
}

.hero-tag:hover {
  color: var(--brand-700);
  border-color: rgba(37, 111, 156, .24);
  background: var(--brand-50)
}

.features-section,
.map-preview-section,
.listings-section {
  background: #f6f7f9
}

.features-intro-card,
.feature-card,
.property-card,
.detail-card,
.proximity-card,
.action-card,
.dashboard-panel,
.auth-copy,
.auth-card,
.agent-login-box,
.dashboard-chat-card,
.dashboard-favorite-row {
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-xs)
}

.features-intro-copy,
.feature-copy p {
  color: var(--ink-600)
}

.feature-visual {
  border-radius: 8px;
  min-height: 138px;
  background-position: center;
  background-size: cover
}

.feature-card-school .feature-visual {
  background-image: url('/static/images/property-living-room-bright.jpg')
}

.feature-card-mrt .feature-visual {
  background-image: url('/static/images/singapore-apartments-skyline.jpg')
}

.feature-card-health .feature-visual {
  background-image: url('/static/images/property-open-plan.jpg')
}

.feature-card-ai .feature-visual {
  background-image: url('/static/images/property-living-room.jpg')
}

.site-footer {
  margin-top: 32px;
  background: #111827;
  color: rgba(255, 255, 255, .78)
}

.search-layout,
.school-query-layout,
.chat-layout {
  background: #f6f7f9
}

.search-sidebar,
.school-query-sidebar,
.chat-sidebar {
  background: #fff;
  border-color: var(--line)
}

.filter-panel {
  padding: 18px
}

.search-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px)
}

.listing-row {
  border-radius: 8px;
  box-shadow: var(--shadow-xs)
}

.listing-row:hover {
  border-color: rgba(37, 111, 156, .24);
  box-shadow: var(--shadow-md)
}

.listing-row .row-image {
  width: 236px;
  min-height: 172px;
  background: #e5e7eb
}

.listing-row .row-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  line-height: 1.28
}

.listing-row .row-price,
.prop-price,
.dashboard-favorite-price {
  color: var(--brand-700)
}

.row-meta,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px
}

.row-meta span,
.card-meta span {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f9fafb;
  color: var(--ink-600);
  padding: 4px 9px;
  font-size: .76rem;
  font-weight: 700
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px
}

.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-700);
  padding: 7px 11px;
  font-size: .82rem;
  font-weight: 800
}

.row-action.primary {
  border-color: var(--brand-600);
  background: var(--brand-600);
  color: #fff
}

.source-badge,
.prop-trust-badge.source-badge {
  color: #166534;
  background: #ecfdf3;
  border-color: #bbf7d0
}

.freshness-badge,
.agent-badge,
.prop-trust-badge {
  color: var(--ink-700);
  background: #f9fafb;
  border-color: var(--line)
}

.prop-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px
}

.prop-trust-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .74rem;
  font-weight: 800;
  border: 1px solid var(--line)
}

.property-gallery {
  border-radius: 8px
}

.property-map,
.home-map,
.search-map,
#school-query-map-id {
  background: #e5e7eb
}

.hero-preview-image .gallery-placeholder,
.local-data-gallery-media .gallery-placeholder,
.card-image .gallery-placeholder,
.row-image .gallery-placeholder {
  width: 100%;
  height: 100%;
  color: transparent;
  background:
    linear-gradient(135deg, rgba(37, 111, 156, .10), rgba(47, 133, 90, .10)),
    #eef2f7
}

.hero-preview-image,
.hero-preview-image img,
.local-data-gallery-media,
.local-data-gallery-media img {
  background:
    linear-gradient(135deg, rgba(37, 111, 156, .10), rgba(47, 133, 90, .10)),
    #eef2f7
}

.hero-preview-image .gallery-placeholder::before,
.local-data-gallery-media .gallery-placeholder::before,
.card-image .gallery-placeholder::before,
.row-image .gallery-placeholder::before {
  content: '';
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(17, 24, 39, .14);
  background: rgba(255, 255, 255, .55)
}

.dashboard-hero {
  border-radius: 8px;
  background: #111827;
  box-shadow: var(--shadow-md)
}

.sq-legend-red,
.sq-legend-red-alt {
  background: #ef4444
}

.sq-legend-blue,
.sq-legend-blue-alt {
  background: #2f855a
}

.sq-action-bar,
.sq-property-filters {
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--shadow-xs)
}

.sq-prop-band-red {
  border-left-color: #ef4444
}

.sq-prop-band-blue {
  border-left-color: #2f855a
}

.sq-tab.active {
  color: var(--brand-700);
  border-bottom-color: var(--brand-600)
}

.floating-chat-btn {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 999px;
  padding: 8px 14px 8px 8px;
  background: var(--brand-600);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: 0 18px 38px rgba(17, 24, 39, .22);
  font-weight: 800
}

.floating-chat-btn:hover {
  transform: translateY(-2px);
  background: var(--brand-700)
}

.floating-chat-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  font-size: .82rem
}

.floating-chat-label {
  font-size: .9rem
}

@media (max-width:760px) {
  .hero {
    padding: 34px 0 24px
  }

  .hero-content-split {
    gap: 20px
  }

  .hero h1 {
    font-size: 1.92rem
  }

  .hero-showcase {
    display: none
  }

  .listing-row .row-image {
    width: 100%;
    height: 190px
  }

  .row-actions {
    padding-top: 10px
  }

  .floating-chat-btn {
    min-height: 46px;
    padding: 7px;
    border-radius: 50%
  }

  .floating-chat-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0)
  }
}

/* Final layout override must stay after the product polish block. */
@media (min-width: 981px) {
  .school-query-layout {
    height: calc(100dvh - var(--nav-height));
    min-height: 0;
    overflow: hidden
  }

  .school-query-sidebar {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: hidden
  }

  .sq-title {
    margin-bottom: 8px
  }

  .sq-tabs {
    margin-bottom: 8px
  }

  .sq-tab {
    padding: 7px 9px;
    font-size: .78rem
  }

  .sq-panel.active {
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden
  }

  #panel-buildings.sq-panel.active,
  #panel-schools.sq-panel.active {
    display: flex;
    flex-direction: column
  }

  #sq-school-list,
  #sq-property-pick-list {
    flex: 0 1 82px;
    max-height: 82px;
    overflow-y: auto
  }

  .sq-selected-school-label {
    max-height: 38px;
    overflow: hidden;
    margin: 6px 0;
    line-height: 1.25
  }

  .sq-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 8px 0
  }

  .sq-legend-item {
    font-size: .78rem;
    gap: 7px
  }

  .sq-layer-toggles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 6px 0
  }

  .sq-toggle {
    grid-template-columns: 14px 1fr;
    column-gap: 7px;
    font-size: .76rem;
    line-height: 1.25
  }

  .sq-counts {
    font-size: .76rem;
    margin: 4px 0
  }

  #sq-action-bar:not(.is-hidden) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    margin: 6px 0;
    flex: 0 0 auto
  }

  .sq-export-btn {
    min-width: 0;
    min-height: 32px;
    padding: 6px 7px;
    font-size: .72rem;
    line-height: 1.1;
    white-space: normal
  }

  .sq-property-filters {
    flex: 0 0 auto;
    padding: 7px;
    margin-bottom: 6px
  }

  .sq-filter-row {
    gap: 6px;
    margin-bottom: 5px
  }

  .sq-filter-group {
    min-width: 0
  }

  .sq-toggle-btns {
    gap: 4px
  }

  .sq-filter-btn {
    padding: 4px 7px;
    font-size: .72rem
  }

  .sq-price-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 5px
  }

  .sq-price-group .stat-label {
    grid-column: 1 / -1
  }

  .sq-price-input {
    min-width: 0;
    height: 32px;
    padding: 6px 8px
  }

  #sq-properties-list {
    flex: 1 1 auto;
    min-height: 58px;
    max-height: none;
    overflow-y: auto
  }

  .sq-list-colored {
    max-height: 15dvh
  }
}

.sq-price-input::-webkit-outer-spin-button,
.sq-price-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none
}

.sq-price-input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield
}

body:has(.school-query-layout) .floating-chat-btn {
  bottom: max(72px, env(safe-area-inset-bottom))
}

@media (max-width: 980px) {
  .school-query-sidebar {
    width: 100%;
    min-width: 0
  }

  #sq-action-bar:not(.is-hidden) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px
  }

  .sq-export-btn {
    min-width: 0;
    white-space: normal;
    line-height: 1.1
  }

  body:has(.school-query-layout) .floating-chat-btn {
    bottom: max(86px, env(safe-area-inset-bottom));
    right: max(14px, env(safe-area-inset-right))
  }
}

/* True final School Query restore: this intentionally comes last. */
@media (min-width: 981px) {
  .school-query-sidebar {
    display: block !important;
    overflow-y: auto !important
  }

  .sq-panel.active,
  #panel-buildings.sq-panel.active,
  #panel-schools.sq-panel.active {
    display: block !important;
    overflow: visible !important;
    flex: initial !important
  }

  #sq-action-bar:not(.is-hidden) {
    display: flex !important;
    flex-wrap: wrap !important
  }
}
