:root {
  --page: #ffffff;
  --soft: #f4f8f8;
  --soft-blue: #e6f4f8;
  --ink: #111827;
  --muted: #667085;
  --line: #d8e2e3;
  --teal: #075965;
  --teal-dark: #063f49;
  --teal-soft: #d9f0f2;
  --coral: #ee4d43;
  --coral-dark: #c63731;
  --green: #238b45;
  --sky: #277da1;
  --amber: #b7791f;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

main {
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px 38px 52px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 84px;
  overflow: visible;
  padding: 8px 38px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--teal-dark);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0;
  min-width: 0;
  align-self: center;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: auto;
  height: 56px;
  max-width: min(300px, 44vw);
  object-fit: contain;
  object-position: left center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a,
.nav-links button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 550;
  padding: 23px 2px 21px;
}

.nav-links .active {
  color: var(--teal);
  border-bottom: 2px solid var(--teal);
}

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

.signed-in {
  display: grid;
  gap: 0;
  color: var(--ink);
  font-weight: 700;
  text-align: right;
}

.signed-in small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  text-transform: uppercase;
}

.market-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 2px 0 16px;
}

.market-header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.market-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.header-stat {
  display: grid;
  justify-items: end;
  gap: 0;
  padding-bottom: 6px;
}

.header-stat strong {
  color: var(--teal);
  font-size: 1.6rem;
}

.header-stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 140px 128px 128px 145px;
  gap: 14px;
  margin-bottom: 20px;
}

.search-box,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
}

.search-box svg {
  width: 20px;
  height: 20px;
  color: var(--teal);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
}

select,
input,
textarea {
  min-height: 44px;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
.search-box:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(7, 89, 101, 0.12);
  outline: none;
}

.app-grid {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 306px;
  gap: 26px;
  align-items: start;
}

.filter-panel,
.rail-card,
.listing-card,
.modal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.filter-panel {
  position: sticky;
  top: 92px;
  padding: 18px 16px;
}

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

.panel-head h2,
.filter-panel h2,
.rail-card h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.filter-group {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.filter-group:first-of-type {
  border-top: 0;
}

.filter-group h3 {
  margin: 0 0 10px;
  font-size: 0.92rem;
}

.filter-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  color: #344054;
  font-size: 0.9rem;
}

.filter-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: auto;
  padding: 0;
  accent-color: var(--teal);
}

.filter-group label span {
  margin-left: auto;
  color: #8a97a6;
  font-size: 0.78rem;
}

.price-track {
  height: 5px;
  margin: 18px 10px 8px;
  background: #d9e6e8;
  border-radius: 999px;
}

.price-track span {
  display: block;
  width: 72%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--sky));
  border-radius: inherit;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.8rem;
}

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

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

.results-toolbar p {
  margin: 0;
  font-weight: 700;
}

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

.toolbar-actions label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.toolbar-actions select {
  min-height: 38px;
  padding: 8px 34px 8px 10px;
  border: 0;
  color: var(--ink);
  font-weight: 700;
}

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

.listing-grid.list-view {
  grid-template-columns: 1fr;
}

.listing-grid.list-view .listing-card {
  display: grid;
  grid-template-columns: 300px 1fr;
}

.listing-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  border-color: #b7d1d5;
  box-shadow: var(--shadow);
}

.listing-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--soft);
}

.listing-grid.list-view .listing-media {
  height: 100%;
  min-height: 238px;
}

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

.save-button {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

.save-button svg {
  width: 22px;
  height: 22px;
  fill: transparent;
  stroke-width: 2;
}

.save-button.active {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.save-button.active svg {
  fill: currentColor;
}

.listing-body {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.price-row,
.card-actions,
.listing-tags,
.detail-specs,
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.price-row {
  justify-content: space-between;
  align-items: flex-start;
}

.price {
  margin: 0;
  font-size: 1.38rem;
  font-weight: 800;
  line-height: 1;
}

.price span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.availability {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  color: var(--green);
  background: #e7f6e9;
  border: 1px solid #bbdfc1;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
}

.listing-card h2 {
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.25;
}

.specs,
.address,
.muted,
.form-note,
.role-line {
  margin: 0;
  color: var(--muted);
}

.specs {
  font-size: 0.9rem;
}

.address {
  font-size: 0.9rem;
}

.listing-tags {
  gap: 8px;
}

.listing-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  color: #35505a;
  background: var(--soft);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
}

.listing-tags svg {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.card-actions {
  margin-top: 2px;
}

.account-rail {
  display: grid;
  gap: 16px;
}

.rail-card {
  padding: 20px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.rail-card p {
  color: var(--muted);
}

.rail-card.panel-highlight {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(7, 89, 101, 0.12), var(--shadow);
}

.account-card h2 {
  font-size: 1.25rem;
  text-align: center;
}

.landlord-card {
  background: linear-gradient(180deg, #f8fcfd 0%, #edf8fb 100%);
}

.landlord-card h2 {
  margin-bottom: 18px;
  font-size: 1.45rem;
}

.landlord-card ul {
  display: grid;
  gap: 14px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.landlord-card li,
.secure-note,
.safety-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.landlord-card svg,
.secure-note svg,
.safety-row svg {
  width: 21px;
  height: 21px;
  color: var(--teal);
  flex: 0 0 auto;
}

.secure-note {
  justify-content: center;
  margin-bottom: 0;
  font-size: 0.88rem;
}

.safety-card {
  display: grid;
  gap: 16px;
}

.trust-card,
.release-card,
.admin-card {
  display: grid;
  gap: 16px;
}

.trust-block {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.trust-block:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.trust-block h3,
.report-box h3 {
  margin: 0;
  font-size: 0.98rem;
}

.trust-block p {
  margin: 0;
}

.trust-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.compact-form {
  display: grid;
  gap: 10px;
}

.legal-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #344054;
  line-height: 1.35;
}

.legal-check input {
  width: 16px;
  height: 16px;
  min-height: auto;
  margin-top: 2px;
  accent-color: var(--teal);
}

.check-list,
.admin-list,
.audit-list {
  display: grid;
  gap: 10px;
}

.check-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.check-item.needs {
  background: #fff8ed;
  border-color: #f2cf9c;
}

.check-item svg {
  width: 18px;
  height: 18px;
  color: var(--green);
  flex: 0 0 auto;
  margin-top: 2px;
}

.check-item.needs svg {
  color: var(--amber);
}

.check-item span,
.audit-list p {
  display: grid;
  gap: 2px;
  margin: 0;
}

.check-item small,
.audit-list span {
  color: var(--muted);
  font-size: 0.78rem;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--amber);
}

.status-dot.good {
  background: var(--green);
}

.admin-list article {
  display: grid;
  gap: 7px;
  padding: 11px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.admin-list small,
.admin-list p {
  color: var(--muted);
  font-size: 0.83rem;
}

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

.safety-row {
  align-items: flex-start;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.safety-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.safety-row span {
  display: grid;
  gap: 2px;
}

.safety-row small {
  color: var(--muted);
}

.mini-list,
.inquiry-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.mini-list button,
.inquiry-list article {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  text-align: left;
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 7px;
}

.mini-list button:hover {
  border-color: var(--teal);
}

.mini-list span,
.inquiry-list span,
.inquiry-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.primary-button,
.ghost-button,
.coral-button,
.danger-button,
.text-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: var(--radius);
  font-weight: 750;
  text-align: center;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
  padding: 10px 16px;
}

.primary-button:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.ghost-button {
  border: 1px solid var(--teal);
  background: #fff;
  color: var(--teal);
  padding: 10px 16px;
}

.ghost-button:hover {
  background: var(--teal-soft);
}

.coral-button {
  border: 1px solid var(--coral);
  background: var(--coral);
  color: #fff;
  padding: 10px 16px;
}

.coral-button:hover {
  background: var(--coral-dark);
}

.danger-button {
  border: 1px solid #f0b9b5;
  background: #fff5f4;
  color: #a33831;
  padding: 10px 16px;
}

.text-button {
  min-height: 32px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--teal);
}

.small {
  min-height: 40px;
  padding: 8px 14px;
}

.compact {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 0.88rem;
}

.full {
  width: 100%;
}

.centered {
  margin: 10px auto 0;
}

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--teal);
}

.icon-button.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 16px 0;
  border-bottom: 1px solid var(--line);
}

.segmented button {
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.segmented button.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.segmented.slim {
  margin-top: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 18, 24, 0.48);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(460px, 100%);
  max-height: min(92vh, 920px);
  overflow: auto;
  padding: 28px;
  box-shadow: var(--shadow);
}

.modal.wide {
  width: min(780px, 100%);
}

.listing-modal {
  width: min(980px, 100%);
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.close-button svg {
  width: 19px;
  height: 19px;
}

.modal h2 {
  margin: 0;
  padding-right: 38px;
  font-size: 1.55rem;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 650;
}

.register-only {
  display: none;
}

.register-only.visible {
  display: grid;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: 16px;
  height: 16px;
  min-height: auto;
  accent-color: var(--teal);
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.image-preview figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.image-preview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.image-preview figcaption {
  padding: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) 1fr;
  gap: 24px;
}

.detail-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

.detail-copy {
  display: grid;
  align-content: start;
  gap: 14px;
}

.detail-copy h2 {
  padding: 0;
  font-size: 1.65rem;
}

.detail-specs span {
  padding: 8px 10px;
  background: var(--soft);
  border-radius: 6px;
  color: #344054;
  font-weight: 750;
  font-size: 0.86rem;
}

.detail-tags {
  margin: 2px 0 8px;
}

.inquiry-box {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  padding: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.report-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #fff8ed;
  border: 1px solid #f2cf9c;
  border-radius: var(--radius);
}

.legal-copy {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.legal-copy p {
  margin: 0;
  color: #344054;
}

.site-footer {
  display: grid;
  justify-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 38px 34px;
  color: var(--muted);
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.site-footer p {
  margin: 0;
  font-size: 0.88rem;
}

.site-footer a {
  color: var(--teal-dark);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.inquiry-box h3 {
  margin: 0;
}

.inquiry-box p {
  margin: 0;
  color: var(--muted);
}

.empty-state {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  min-height: 360px;
  padding: 34px;
  text-align: center;
  background: var(--soft);
  border: 1px dashed #b8cbd0;
  border-radius: var(--radius);
}

.empty-state svg {
  width: 40px;
  height: 40px;
  color: var(--teal);
}

.empty-state h2 {
  margin: 6px 0 0;
}

.empty-state p {
  max-width: 380px;
  margin: 0 0 8px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 16px;
  color: #fff;
  background: var(--teal-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media (max-width: 1260px) {
  .app-grid {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .account-rail {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

}

@media (max-width: 940px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 0 20px;
  }

  .nav-links {
    display: none;
  }

  main {
    padding: 22px 20px 42px;
  }

  .search-row {
    grid-template-columns: 1fr 1fr;
  }

  .search-box {
    grid-column: 1 / -1;
  }

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

  .filter-panel {
    position: static;
  }

  .account-rail {
    grid-template-columns: 1fr;
  }

  .detail-layout,
  .listing-grid.list-view .listing-card {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 680px) {
  .topbar {
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
  }

  .brand {
    font-size: 1.42rem;
  }

  .brand-logo {
    height: 46px;
    max-width: 210px;
  }

  .top-actions {
    justify-content: end;
  }

  .top-actions .ghost-button {
    display: none;
  }

  .market-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-stat {
    justify-items: start;
  }

  .search-row,
  .listing-grid,
  .form-grid.two,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

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

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions label {
    flex: 1;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal {
    padding: 22px;
  }
}
