:root {
  --market-accent: #171717;
  --background: #ffffff;
  --foreground: #0a0a0a;
  --muted: #737373;
  --muted-foreground: #525252;
  --surface: #fafafa;
  --surface-strong: #f5f5f5;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --ring: #a3a3a3;
  --danger: #b91c1c;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.04);
  --shadow-md: 0 4px 14px rgb(0 0 0 / 0.07);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--foreground);
  background: var(--background);
  font-family: "Geist Variable", Geist, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

a {
  color: var(--foreground);
  text-underline-offset: 3px;
}

a:hover { color: #404040; }

h1, h2, h3, h4, h5, h6 {
  color: var(--foreground);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.container { --bs-gutter-x: 2rem; }
.text-secondary { color: var(--muted-foreground) !important; }

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 0.96);
}

.site-header .navbar {
  min-height: 58px;
  padding: 0;
}

.navbar-brand {
  color: var(--foreground);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.navbar-brand:hover,
.navbar-brand:focus { color: var(--foreground); }

.navbar-brand.marketplace-brand,
.navbar-brand.marketplace-brand:hover,
.navbar-brand.marketplace-brand:focus { color: var(--market-accent); }

.navbar-brand span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0;
}

.navbar-nav { gap: 3px; }

.navbar .nav-link {
  padding: 7px 10px !important;
  border-radius: 6px;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 500;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--foreground);
  background: var(--surface-strong);
}

.navbar .dropdown-toggle {
  border: 0;
  background: transparent;
}

.navbar .dropdown-menu {
  min-width: 230px;
  margin-top: 7px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  box-shadow: var(--shadow-md);
}

.navbar .dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 9px;
  border-radius: 5px;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  color: var(--foreground);
  background: var(--surface-strong);
}

.navbar .dropdown-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.navbar-toggler {
  padding: 5px 7px;
  border-color: var(--border);
  border-radius: 6px;
}

.navbar-toggler:focus { box-shadow: 0 0 0 2px var(--ring); }

.btn {
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: var(--shadow-sm);
}

.btn-sm {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 12px;
}

.btn-dark,
.btn-market {
  color: #fff;
  background: var(--foreground);
  border-color: var(--foreground);
}

.btn-dark:hover,
.btn-dark:focus,
.btn-market:hover,
.btn-market:focus {
  color: #fff;
  background: #262626;
  border-color: #262626;
}

.btn-outline-dark {
  color: var(--foreground);
  background: var(--background);
  border-color: var(--border-strong);
}

.btn-outline-dark:hover,
.btn-outline-dark:focus {
  color: var(--foreground);
  background: var(--surface-strong);
  border-color: #a3a3a3;
}

.btn-link {
  min-height: auto;
  padding: 0;
  box-shadow: none;
}

.alert {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--foreground);
  background: var(--surface);
  font-size: 13px;
}

.site-footer {
  margin-top: auto;
  padding: 26px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  background: var(--background);
  font-size: 12px;
}

.footer-row,
.footer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.footer-note {
  margin-left: 18px;
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.footer-links a {
  color: var(--muted-foreground);
  text-decoration: none;
}

.footer-links a:hover { color: var(--foreground); }

.section-kicker {
  margin: 0 0 10px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.directory-hero {
  padding: clamp(64px, 8vw, 112px) 0 54px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(380px, 0.7fr);
  gap: clamp(48px, 8vw, 120px);
  align-items: end;
}

.hero-copy h1 {
  max-width: 800px;
  margin: 0;
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.hero-description {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--muted-foreground);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.65;
}

.market-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.market-stats div {
  min-width: 0;
  padding: 20px;
}

.market-stats div + div { border-left: 1px solid var(--border); }

.market-stats dt {
  overflow: hidden;
  color: var(--foreground);
  font-size: clamp(21px, 2vw, 28px);
  font-weight: 680;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
}

.market-stats dd {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.market-stats.compact {
  flex: 0 0 430px;
  background: var(--background);
}

.market-stats.compact div { padding: 15px 18px; }

.market-stats.compact dt { font-size: 23px; }

.hero-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1030px;
  min-height: 52px;
  margin-top: 40px;
  padding: 5px 5px 5px 48px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--background);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.06), 0 6px 20px rgb(0 0 0 / 0.04);
}

.hero-search:focus-within {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgb(163 163 163 / 0.2);
}

.hero-search input {
  min-width: 0;
  flex: 1;
  padding: 8px 10px 8px 0;
  border: 0;
  outline: 0;
  color: var(--foreground);
  background: transparent;
  font-size: 14px;
}

.hero-search input::placeholder { color: #a3a3a3; }

.search-mark {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-55%);
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 25px;
  line-height: 1;
}

.hero-search kbd {
  margin: 0 8px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-bottom-color: var(--border-strong);
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface);
  font-family: inherit;
  font-size: 10px;
  font-weight: 550;
  box-shadow: none;
}

.listing-section { padding-top: 64px; padding-bottom: 80px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
}

.section-heading p:last-child {
  margin: 8px 0 0;
  color: var(--muted-foreground);
  font-size: 15px;
}

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

.property-card {
  min-width: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  box-shadow: var(--shadow-sm);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.property-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.property-card > a {
  display: flex;
  height: 100%;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.property-media {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.property-media img,
.property-image-placeholder {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: cover;
}

.property-image-placeholder {
  position: relative;
  background-color: #f5f5f5;
  background-image:
    linear-gradient(#e5e5e5 1px, transparent 1px),
    linear-gradient(90deg, #e5e5e5 1px, transparent 1px);
  background-size: 24px 24px;
}

.property-image-placeholder::after {
  position: absolute;
  inset: 18% 24%;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.76);
  content: "";
}

.property-image-placeholder span {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted-foreground);
  font-size: 20px;
  font-weight: 680;
  letter-spacing: 0.08em;
}

.property-kind {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 7px;
  border: 1px solid rgb(255 255 255 / 0.65);
  border-radius: 5px;
  color: var(--foreground);
  background: rgb(255 255 255 / 0.92);
  font-size: 10px;
  font-weight: 650;
  box-shadow: var(--shadow-sm);
}

.property-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}

.property-card-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.property-card-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.property-card-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.property-card-title > span {
  flex: 0 0 auto;
  color: #a3a3a3;
  font-size: 15px;
}

.property-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 11px;
}

.property-specs strong {
  color: var(--foreground);
  font-weight: 650;
}

.property-summary {
  margin: 12px 0 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.55;
}

.property-price {
  margin: auto 0 0;
  padding-top: 12px;
  color: var(--foreground);
  font-size: 12px;
  font-weight: 650;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  padding: 42px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface);
}

.empty-state-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 13px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted-foreground);
  background: var(--background);
  font-size: 18px;
}

.empty-state h3 {
  margin: 0;
  font-size: 17px;
}

.empty-state p {
  max-width: 430px;
  margin: 7px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.about-strip {
  padding: 72px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1fr);
  gap: 60px;
}

.about-grid h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(27px, 3.5vw, 43px);
  line-height: 1.12;
}

.about-grid div > p {
  max-width: 720px;
  margin: 20px 0;
  color: var(--muted-foreground);
  font-size: 16px;
  line-height: 1.7;
}

.about-grid a { font-weight: 600; }

.results-hero {
  padding: 50px 0 38px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.results-hero-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 48px;
}

.results-hero-row > div:first-child { max-width: 680px; }

.results-hero h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.results-hero-row > div > p:last-child {
  margin: 14px 0 0;
  color: var(--muted-foreground);
  font-size: 15px;
}

.results-hero .hero-search {
  max-width: none;
  margin-top: 32px;
}

.browse-section { padding-top: 34px; padding-bottom: 80px; }

.browse-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.filter-sidebar {
  position: sticky;
  top: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

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

.filter-heading h2 {
  margin: 0;
  font-size: 15px;
}

.filter-heading a {
  color: var(--muted-foreground);
  font-size: 11px;
}

.filter-group {
  min-width: 0;
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.filter-group:last-of-type { margin-bottom: 18px; }

.form-label,
.filter-group legend {
  width: auto;
  margin: 0 0 7px;
  padding: 0;
  color: var(--foreground);
  font-size: 11px;
  font-weight: 650;
}

.form-control,
.form-select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--foreground);
  background-color: var(--background);
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}

textarea.form-control { min-height: 96px; }

.form-control:focus,
.form-select:focus {
  color: var(--foreground);
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgb(163 163 163 / 0.2);
}

.form-control::placeholder { color: #a3a3a3; }

.range-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.range-fields span { color: var(--muted); }
.range-fields input { min-width: 0; }

.results-column { min-width: 0; }

.results-toolbar {
  display: flex;
  min-height: 42px;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.results-toolbar h2 {
  margin: 0;
  font-size: 16px;
}

.results-toolbar p,
.results-toolbar > span {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.map-card {
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  box-shadow: var(--shadow-sm);
}

.map-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.map-card-heading .section-kicker { margin-bottom: 2px; font-size: 9px; }

.map-card-heading h3 {
  margin: 0;
  font-size: 14px;
}

.map-card-heading > span {
  color: var(--muted);
  font-size: 11px;
}

#property-map {
  min-height: 280px;
  background: var(--surface);
}

#detail-map {
  min-height: 380px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.results-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.compact-empty { min-height: 340px; }

.results-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
}

.results-pagination span {
  color: var(--muted);
  font-size: 11px;
}

.detail-page { padding-top: 36px; padding-bottom: 80px; }

.back-link {
  display: inline-block;
  color: var(--muted-foreground);
  font-size: 12px;
  text-decoration: none;
}

.back-link:hover { color: var(--foreground); }

.badge {
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 650;
}

.badge-market,
.badge-neutral {
  border: 1px solid var(--border);
  color: var(--foreground);
  background: var(--surface);
}

.detail-title {
  max-width: 900px;
  margin: 0;
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.detail-location {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.detail-summary {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted-foreground);
  font-size: 19px;
  line-height: 1.65;
}

.property-gallery img {
  width: 100%;
  max-height: 620px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  object-fit: cover;
}

.detail-section-title {
  margin: 48px 0 16px;
  font-size: 22px;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}

.fact-item {
  padding: 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.fact-item dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fact-item dd {
  margin: 4px 0 0;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 650;
}

.property-description {
  color: var(--muted-foreground);
  font-size: 16px;
  line-height: 1.75;
}

.inquiry-panel,
.manage-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.inquiry-panel { top: 76px !important; }

.inquiry-panel h2 { margin-bottom: 8px; }

.inquiry-panel label,
.manage-panel label {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 650;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border);
  color: var(--foreground);
  font-size: 13px;
}

.table thead th {
  padding: 12px 14px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.table tbody td { padding: 14px; }

.status-pill { font-weight: 600; text-transform: capitalize; }

.fact-form-row {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}

.form-check { margin-bottom: 7px; }

.form-check-input:checked {
  background-color: var(--foreground);
  border-color: var(--foreground);
}

.auth-shell {
  width: 100%;
  max-width: 510px;
  margin: clamp(48px, 9vw, 100px) auto;
}

.auth-card {
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  box-shadow: var(--shadow-md);
}

.auth-card h1 { margin-bottom: 8px; }

.auth-card .form-text,
.auth-card small {
  color: var(--muted);
  font-size: 11px;
}

.errorlist {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--danger);
  font-size: 11px;
}

@media (max-width: 1199px) {
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr); }
}

@media (max-width: 991px) {
  .site-header .navbar { min-height: 56px; padding: 8px 0; }
  .navbar-collapse { padding: 10px 0 4px; }
  .navbar-nav { align-items: stretch !important; }
  .navbar-nav .btn { display: block; margin: 6px 0 0 !important; }
  .navbar .dropdown-menu {
    margin: 2px 0 6px;
    border: 0;
    box-shadow: none;
  }

  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .market-stats { max-width: 620px; }
  .results-hero-row { align-items: start; flex-direction: column; gap: 28px; }
  .market-stats.compact { width: 100%; max-width: 620px; flex-basis: auto; }
  .browse-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 22px; }
  .results-grid { grid-template-columns: 1fr; }
  .property-grid:not(.results-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .container { --bs-gutter-x: 1.5rem; }
  .directory-hero { padding: 52px 0 34px; }
  .hero-copy h1 { font-size: clamp(30px, 9vw, 42px); }
  .hero-description { margin-top: 18px; font-size: 16px; }
  .market-stats div { padding: 14px 12px; }
  .market-stats dt,
  .market-stats.compact dt { font-size: 20px; }
  .market-stats dd { font-size: 9px; }
  .hero-search { min-height: 48px; margin-top: 28px; padding-left: 42px; }
  .hero-search kbd { display: none; }
  .search-mark { left: 15px; }
  .listing-section { padding-top: 46px; padding-bottom: 56px; }
  .section-heading { align-items: start; flex-direction: column; }
  .property-grid,
  .property-grid:not(.results-grid) { grid-template-columns: 1fr; }
  .about-strip { padding: 52px 0; }
  .about-grid { grid-template-columns: 1fr; gap: 18px; }

  .results-hero { padding: 40px 0 30px; }
  .browse-section { padding-top: 24px; padding-bottom: 56px; }
  .browse-layout { grid-template-columns: 1fr; }
  .filter-sidebar { position: static; }
  #property-map { min-height: 250px; }
  #detail-map { min-height: 300px; }
  .detail-page { padding-top: 26px; padding-bottom: 56px; }
  .detail-summary { font-size: 17px; }

  .footer-row,
  .footer-links { align-items: flex-start; flex-direction: column; gap: 10px; }
  .footer-note {
    display: block;
    margin: 6px 0 0;
    padding: 0;
    border: 0;
  }
  .footer-links { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .property-card { transition: none; }
}
