:root {
  --ink: #172f3d;
  --muted: #50636e;
  --brand: #243b91;
  --line: #d8e0e5;
  --paper: #fff;
  --surface: #f5f7f8;
  --danger: #9f2636;
  --radius: 12px;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  color: inherit;
}
button,
a {
  touch-action: manipulation;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #5374d1;
  outline-offset: 3px;
}
::selection {
  background: #dce5ff;
}
input,
textarea {
  caret-color: var(--brand);
}
.header {
  min-height: 88px;
  padding: 18px 4vw;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.25em;
}
.header nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.header nav > a,
.header nav > button {
  font-size: 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  text-decoration: none;
}
main {
  max-width: 1420px;
  margin: auto;
  padding: 48px 4vw 80px;
  min-height: 65vh;
}
.hero {
  padding: 25px 0 42px;
  max-width: 850px;
}
.hero h1 {
  font-size: clamp(36px, 5.1vw, 68px);
  line-height: 1.04;
  font-weight: 650;
  letter-spacing: -0.035em;
  margin: 0 0 24px;
  max-width: 780px;
  text-wrap: balance;
}
.hero p {
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 60ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--brand);
}
h1 {
  font-size: clamp(30px, 3vw, 44px);
  letter-spacing: -0.025em;
  line-height: 1.15;
}
h2 {
  font-size: 25px;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 18px;
}
p {
  line-height: 1.65;
}
small,
.muted {
  color: var(--muted);
}
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  padding: 12px 19px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.button:hover {
  background: #1b2e75;
}
.button.secondary {
  background: white;
  color: var(--brand);
  border: 1px solid var(--line);
}
.button.secondary:hover {
  background: #eef2ff;
}
.button.danger {
  background: var(--danger);
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.filters {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.filters .search {
  grid-column: span 2;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  border: 1px solid #afbdc6;
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  min-height: 46px;
  font-size: 16px;
}
input::placeholder,
textarea::placeholder {
  color: #5c6c75;
}
textarea {
  min-height: 130px;
  resize: vertical;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: var(--brand);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
}
.check input {
  flex-shrink: 0;
  margin-top: 2px;
}
.check a {
  color: var(--brand);
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0 24px;
}
.section-heading h1,
.section-heading h2 {
  margin: 0 0 10px;
}
.section-heading p {
  margin: 0;
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 24px;
}
.property-card {
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}
.card-image {
  position: relative;
  aspect-ratio: 1.45;
  overflow: hidden;
  border-radius: 10px;
  background: #e9edf0;
}
.card-image > a {
  display: block;
  width: 100%;
  height: 100%;
}
.card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.card-image:hover img {
  transform: scale(1.025);
}
.favorite {
  position: absolute;
  right: 12px;
  top: 12px;
  background: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brand);
  box-shadow: 0 3px 12px #172f3d20;
}
.favorite svg {
  width: 21px;
  height: 21px;
}
.favorite.saved svg {
  fill: var(--brand);
}
.card-price {
  font-size: 27px;
  font-weight: 650;
  margin: 20px 0 9px;
  font-variant-numeric: tabular-nums;
}
.property-card h3 {
  margin: 10px 0;
}
.property-card h3 a {
  color: var(--ink);
  text-decoration: none;
}
.property-card p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 14px;
}
.tag {
  font-size: 12px;
  display: inline-block;
  background: #edf1f8;
  color: #284464;
  padding: 5px 8px;
  border-radius: 4px;
  line-height: 1.5;
}
.empty {
  padding: 55px 0;
  max-width: 660px;
}
.empty h2 {
  font-size: 30px;
}
.empty p {
  color: var(--muted);
}
.workspace {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 42px;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-right: 1px solid var(--line);
  padding-right: 22px;
}
.sidebar button {
  text-align: left;
  padding: 13px 10px;
  border-radius: 6px;
  font-size: 14px;
  min-height: 44px;
}
.sidebar button.active,
.sidebar button:hover {
  background: #eef2fa;
  color: var(--brand);
}
.stats {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  border-block: 1px solid var(--line);
  padding: 22px 0;
  margin: 25px 0;
}
.stats strong {
  display: block;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}
.stats span {
  font-size: 13px;
  color: var(--muted);
}
.listing-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.listing-row img {
  width: 130px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
}
.listing-row h2 {
  font-size: 19px;
  margin: 9px 0;
}
.listing-row p {
  margin: 6px 0;
  color: var(--muted);
}
.listing-row .actions {
  max-width: 215px;
  justify-content: flex-end;
}
.form {
  max-width: 940px;
}
.form-section {
  border: 0;
  padding: 24px 0 32px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.form-section legend {
  font-size: 22px;
  font-weight: 600;
  padding-top: 32px;
  letter-spacing: -0.02em;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.wide {
  grid-column: 1/-1;
}
.help {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin: 8px 0 0;
}
.amenities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.form .actions {
  padding: 26px 0;
}
.notice {
  background: #eef2fa;
  padding: 17px 20px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.7;
  margin: 20px 0;
  color: #2b4268;
}
.error {
  color: var(--danger);
  font-size: 14px;
  line-height: 1.6;
}
.photo-editor {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-top: 22px;
}
.photo-editor figure {
  margin: 0;
  min-width: 0;
}
.photo-editor img {
  width: 100%;
  aspect-ratio: 1.3;
  object-fit: cover;
  border-radius: 6px;
}
.photo-editor figcaption {
  font-size: 12px;
  padding-top: 9px;
}
.photo-editor .actions {
  padding: 6px 0;
  gap: 4px;
}
.photo-editor button {
  min-height: 38px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
}
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: #fffefb;
  padding: 18px 0 !important;
  border-top: 1px solid var(--line);
  z-index: 2;
}
.detail-heading {
  margin-bottom: 25px;
}
.detail-heading p {
  color: var(--muted);
}
.gallery-main {
  display: block;
  background: #eef1f4;
  border-radius: 12px;
  width: 100%;
  height: min(65vh, 650px);
  object-fit: contain;
}
.gallery-thumbs {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  overflow: auto;
}
.gallery-thumbs button {
  padding: 0;
  flex: 0 0 95px;
  border-radius: 6px;
}
.gallery-thumbs img {
  display: block;
  width: 95px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 55px;
  margin-top: 30px;
}
.detail-layout article {
  max-width: 75ch;
}
.detail-layout article > section {
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 25px;
}
.detail-layout aside {
  align-self: start;
  position: sticky;
  top: 25px;
}
.contact-panel {
  background: var(--surface);
  padding: 25px;
  border-radius: 12px;
}
.contact-panel .actions {
  flex-direction: column;
  align-items: stretch;
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.facts div {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.facts dt {
  font-size: 12px;
  color: var(--muted);
}
.facts dd {
  margin: 6px 0 0;
  font-size: 16px;
}
.map {
  width: 100%;
  height: 300px;
  border: 0;
  border-radius: 8px;
}
.auth {
  max-width: 460px;
  margin: 20px auto;
}
.auth h1 {
  font-size: 35px;
}
.auth form {
  display: grid;
  gap: 20px;
}
.auth .button {
  width: 100%;
}
.auth .actions {
  margin: 22px 0;
}
.auth-divider {
  text-align: center;
  position: relative;
  color: var(--muted);
  margin: 25px 0;
  font-size: 13px;
}
.inquiry-row {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}
.inquiry-row h3 {
  margin: 0 0 8px;
}
.inquiry-row p {
  margin: 5px 0;
  font-size: 14px;
  color: var(--muted);
}
.conversation {
  max-width: 860px;
}
.message {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.message strong {
  font-size: 13px;
}
.message p {
  white-space: pre-wrap;
  margin: 10px 0;
}
.message time {
  font-size: 12px;
  color: var(--muted);
}
.conversation form {
  margin-top: 25px;
}
.conversation .actions {
  padding-top: 15px;
}
.loading {
  padding: 55px 0;
  color: var(--muted);
}
footer {
  padding: 36px 4vw;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: space-between;
}
footer p {
  color: var(--muted);
  font-size: 13px;
}
footer > div {
  display: flex;
  gap: 20px;
}
footer button {
  min-height: 44px;
  font-size: 13px;
}
#status:not(:empty) {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 14px 22px;
  max-width: 90vw;
  border-radius: 8px;
  z-index: 100;
  font-size: 14px;
}
.skip {
  position: fixed;
  left: 10px;
  top: 10px;
  z-index: 120;
  background: #fff;
  padding: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  width: auto;
  height: auto;
  padding: 12px;
  overflow: visible;
  clip-path: none;
}
dialog {
  border: 0;
  border-radius: 12px;
  max-width: min(92vw, 660px);
  padding: 30px;
  color: var(--ink);
  box-shadow: 0 15px 60px #10263830;
}
dialog::backdrop {
  background: #142b3b80;
}
dialog p {
  line-height: 1.8;
}
.dialog-close {
  float: right;
  min-height: 44px;
}
.legal {
  max-width: 75ch;
}
.label-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-width: 1000px) {
  .header {
    flex-wrap: wrap;
  }
  .header nav {
    gap: 16px;
    flex-wrap: wrap;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
  }
  .workspace {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 25px;
  }
  .listing-row {
    grid-template-columns: 100px 1fr;
  }
  .listing-row img {
    width: 100px;
    height: 100px;
  }
  .listing-row .actions {
    grid-column: 2;
    max-width: none;
    justify-content: flex-start;
  }
  .photo-editor {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .header {
    padding: 16px 5vw;
    gap: 15px;
  }
  .header nav {
    gap: 5px 15px;
    width: 100%;
  }
  .header nav > a,
  .header nav > button {
    font-size: 13px;
  }
  .header nav > .button {
    padding: 9px 11px;
  }
  main {
    padding: 25px 5vw 55px;
  }
  .hero {
    padding: 15px 0 25px;
  }
  .hero p {
    font-size: 16px;
  }
  .filters {
    grid-template-columns: 1fr 1fr;
    padding: 18px;
    gap: 16px 12px;
  }
  .filters .search {
    grid-column: 1/-1;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .section-heading {
    align-items: start;
    flex-direction: column;
  }
  .workspace {
    display: block;
  }
  .sidebar {
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 15px;
    flex-direction: row;
    flex-wrap: wrap;
    margin-bottom: 25px;
    gap: 0;
  }
  .sidebar button {
    font-size: 13px;
  }
  .stats {
    gap: 20px;
  }
  .stats strong {
    font-size: 23px;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .wide {
    grid-column: auto;
  }
  .amenities {
    grid-template-columns: 1fr 1fr;
  }
  .photo-editor {
    grid-template-columns: 1fr 1fr;
  }
  .detail-layout {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .detail-layout aside {
    position: static;
    grid-row: 1;
  }
  .gallery-main {
    height: 340px;
  }
  .detail-heading h1 {
    font-size: 30px;
  }
  .facts {
    gap: 10px;
  }
  .sticky-actions .button {
    flex: 1;
  }
  .listing-row {
    grid-template-columns: 80px 1fr;
    gap: 14px;
  }
  .listing-row img {
    width: 80px;
    height: 90px;
  }
  .listing-row .button {
    font-size: 12px;
    padding: 10px;
  }
  .listing-row h2 {
    font-size: 17px;
  }
  footer {
    display: block;
  }
  footer > div {
    margin-top: 18px;
  }
  .auth {
    margin: 10px auto;
  }
  .contact-panel .actions {
    flex-direction: row;
  }
  .contact-panel .button {
    flex: 1;
  }
  .hero h1 {
    font-size: 43px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .card-image img {
    transition: none;
  }
  .card-image:hover img {
    transform: none;
  }
}

[hidden] {
  display: none !important;
}
.agent-avatar {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 50%;
  margin: 18px 0;
}
.photo-editor button {
  min-height: 44px;
  min-width: 44px;
}

/* Search, publication steps, and task recovery share the existing Relox palette. */
.header nav {
  margin-left: auto;
}
.header-account {
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 14px;
}
.workspace > section {
  min-width: 0;
}
.workspace-toggle {
  display: none;
}
.search-panel {
  border: 1px solid var(--line);
  padding: 25px;
  border-radius: var(--radius);
  background: var(--surface);
}
.search-primary {
  display: grid;
  grid-template-columns:
    minmax(240px, 2fr) minmax(110px, 0.8fr) minmax(160px, 1.15fr)
    auto;
  gap: 16px;
  align-items: end;
}
.search-secondary {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.2fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 20px;
}
.search-secondary .button {
  background: transparent;
  border-color: #afbdc6;
}
.search-advanced {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 22px;
}
.search-panel > .help {
  margin: 18px 0 0;
}
.quick-regions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 23px 0 35px;
  font-size: 13px;
  color: var(--muted);
}
.quick-regions button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 24px;
  background: #eef2fa;
  color: var(--brand);
}
.text-button {
  min-height: 44px;
  padding: 10px 6px;
  color: var(--brand);
  font-weight: 600;
  font-size: 14px;
  text-underline-offset: 4px;
}
.text-button:hover {
  text-decoration: underline;
}
.filter-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: -6px 0 24px;
}
.filter-chips button {
  min-height: 44px;
  padding: 10px 14px;
  background: #edf1f8;
  border-radius: 6px;
  color: #284464;
  font-size: 13px;
}
.filter-chips span {
  margin-left: 8px;
  font-size: 18px;
}
.pagination {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-top: 36px;
  justify-content: center;
  flex-wrap: wrap;
}
.pagination span {
  color: var(--muted);
  font-size: 13px;
}
.editor-steps {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--line);
  margin: 24px 0 0;
  scrollbar-color: #b4c1cf #eef1f5;
  scrollbar-width: thin;
}
.editor-steps button {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 9px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
}
.editor-steps button[aria-current="step"] {
  background: #eef2fa;
  color: var(--brand);
  font-weight: 650;
}
.step-number {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid #aebac7;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.editor-steps .complete .step-number {
  border-color: var(--brand);
  color: var(--brand);
  background: #edf1fb;
}
.editor-progress {
  padding: 17px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.form-section legend {
  scroll-margin-top: 24px;
}
.field-error {
  display: block;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
  margin: 8px 0;
}
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
}
.listing-preview > img {
  display: block;
  width: 100%;
  max-height: 330px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface);
}
.preview-description {
  white-space: pre-wrap;
}
.listing-preview .card-price {
  display: block;
}
@media (max-width: 1100px) {
  .search-primary {
    grid-template-columns: 2fr 1fr 1.3fr;
  }
  .search-primary > .button {
    grid-column: 1/-1;
    justify-self: start;
  }
}
@media (max-width: 650px) {
  .header {
    gap: 12px;
  }
  .header > .brand {
    order: 0;
  }
  .header > .header-account {
    order: 1;
    margin-left: auto;
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header nav {
    order: 2;
    margin-left: 0;
    flex-wrap: nowrap;
    overflow: auto;
    width: 100%;
    padding-bottom: 3px;
    gap: 18px;
    scrollbar-width: thin;
  }
  .header nav > * {
    flex-shrink: 0;
  }
  .workspace-toggle {
    display: inline-flex;
    margin-bottom: 18px;
  }
  .workspace .sidebar {
    display: none;
  }
  .workspace .sidebar.mobile-open {
    display: flex;
  }
  .search-panel {
    padding: 18px;
  }
  .search-primary,
  .search-secondary {
    grid-template-columns: 1fr 1fr;
    gap: 16px 12px;
  }
  .search-primary .search {
    grid-column: 1/-1;
  }
  .search-primary > .button {
    width: 100%;
    justify-self: stretch;
  }
  .search-secondary {
    margin-top: 18px;
  }
  .search-advanced {
    grid-template-columns: 1fr 1fr;
  }
  .search-advanced > .button {
    grid-column: 1/-1;
  }
  .quick-regions {
    gap: 8px;
    margin: 18px 0 28px;
  }
  .quick-regions span {
    flex-basis: 100%;
  }
  .editor-steps {
    margin-top: 20px;
    gap: 8px;
  }
  .editor-steps button {
    flex: 0 0 auto;
    padding: 10px 12px;
  }
  .editor-progress {
    font-size: 12px;
  }
  #listing-form .sticky-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 0 !important;
  }
  #listing-form .sticky-actions > * {
    width: 100%;
    min-height: 44px;
    font-size: 12px;
    padding: 10px;
  }
  #listing-form [data-action="editor-previous"] {
    grid-column: 1;
    grid-row: 1;
  }
  #listing-form [data-action="editor-next"],
  #listing-form #save-property {
    grid-column: 2;
    grid-row: 1;
  }
  #listing-form [data-action="save-draft"] {
    grid-column: 1;
    grid-row: 2;
  }
  #listing-form [data-action="preview-listing"] {
    grid-column: 2;
    grid-row: 2;
  }
}

/* Discovery extends the established Relox palette and controls. */
.discovery-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0 28px;
  flex-wrap: wrap;
}
.view-switch {
  display: flex;
  gap: 8px;
}
.catalog-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 1fr);
  gap: 28px;
  align-items: start;
}
.catalog-results {
  min-width: 0;
}
.catalog-results .grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#catalog-map {
  position: sticky;
  top: 18px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.property-map {
  height: 570px;
  isolation: isolate;
  z-index: 0;
}
.map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 18px 0;
}
#map-caption {
  padding: 0 18px 12px;
}
.price-marker span {
  display: block;
  width: max-content;
  max-width: 160px;
  padding: 7px 12px;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  font:
    600 12px/1.3 Inter,
    system-ui,
    sans-serif;
  box-shadow: 0 3px 10px #172f3d26;
  white-space: nowrap;
}
.price-marker:focus-visible span,
.price-marker:hover span {
  background: var(--ink);
  outline: 3px solid #fff;
}
.leaflet-popup-content {
  font:
    14px/1.6 Inter,
    system-ui,
    sans-serif;
  max-height: 260px;
  overflow: auto;
}
.leaflet-popup-content a {
  color: var(--brand);
}
.map-highlight {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
.compare-choice {
  align-self: start;
  margin: 10px 20px 20px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.compare-choice[aria-pressed="true"] {
  color: var(--brand);
  background: #edf1fb;
  border-color: var(--brand);
}
.detail-heading .compare-choice {
  margin: 0;
  padding: 12px 18px;
}
#comparison-tray {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  max-width: 760px;
  width: calc(100% - 32px);
  padding: 14px 22px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: 0 5px 24px #172f3d33;
  z-index: 600;
}
#comparison-tray[hidden] {
  display: none;
}
#comparison-tray .text-button {
  color: #fff;
}
#comparison-tray .button {
  background: #fff;
  color: var(--brand);
}
.has-comparison {
  padding-bottom: 100px;
}
.comparison-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 20px;
}
.comparison table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 650px;
}
.comparison th,
.comparison td {
  text-align: left;
  vertical-align: top;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.comparison thead th {
  background: var(--surface);
  font-size: 16px;
}
.comparison th:first-child {
  width: 150px;
}
.comparison thead th:not(:first-child) {
  min-width: 200px;
}
.comparison thead img {
  width: 100%;
  height: 145px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 12px;
}
.comparison thead button {
  display: block;
  margin-top: 12px;
}
.comparison tbody th {
  font-weight: 600;
  background: var(--surface);
}
.comparison tr:last-child > * {
  border-bottom: 0;
}
.compare-difference {
  margin-top: 24px;
}
.saved-search-page {
  max-width: 1080px;
  margin: auto;
}
.saved-search-row,
.search-alert {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.saved-search-row h3,
.search-alert h3 {
  margin: 0 0 10px;
}
.saved-search-row p,
.search-alert p {
  margin: 8px 0;
}
.saved-search-row > .actions {
  max-width: 350px;
  justify-content: flex-end;
}
.alert-heading {
  margin-top: 52px;
}
.search-alert.unread {
  background: var(--surface);
  padding: 24px 18px;
}
.search-alert .tag {
  margin-bottom: 12px;
}
.danger {
  color: var(--danger);
}
.header nav {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.header nav > * {
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  .catalog-split {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
    gap: 18px;
  }
  .catalog-results .grid {
    grid-template-columns: 1fr;
  }
  .property-map {
    height: 520px;
  }
  .header {
    flex-wrap: wrap;
  }
  .header nav {
    order: 3;
    width: 100%;
  }
  .header-account {
    margin-left: auto;
  }
}
@media (max-width: 650px) {
  .catalog-split {
    display: flex;
    flex-direction: column;
  }
  .catalog-results {
    width: 100%;
  }
  #catalog-map {
    position: static;
    order: -1;
    width: 100%;
  }
  .property-map {
    height: 360px;
  }
  .discovery-tools {
    align-items: stretch;
  }
  .discovery-tools > .actions {
    width: 100%;
    justify-content: space-between;
  }
  .view-switch {
    width: 100%;
  }
  .view-switch button {
    flex: 1;
  }
  #comparison-tray {
    bottom: 8px;
    padding: 12px;
    gap: 10px;
    font-size: 13px;
  }
  .has-comparison {
    padding-bottom: 130px;
  }
  #comparison-tray .actions {
    gap: 8px;
  }
  #comparison-tray .button {
    padding: 10px;
  }
  .comparison th,
  .comparison td {
    padding: 12px;
  }
  .comparison th:first-child {
    width: 120px;
  }
  .saved-search-row,
  .search-alert {
    flex-direction: column;
    gap: 12px;
  }
  .saved-search-row > .actions {
    max-width: none;
    justify-content: flex-start;
  }
}
.review-listing {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.review-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.review-photos img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
}

.map-results-view .hero {
  display: none;
}
.nearby-search {
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
  margin: 18px 0 28px;
}
.nearby-actions {
  display: flex;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
}
.nearby-actions label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
}
.nearby-actions select {
  min-width: 110px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}
.nearby-search .help {
  margin: 12px 0 0;
}
.nearby-distance {
  color: var(--brand);
  font-weight: 600;
}
.photo-count {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  pointer-events: none;
}
@media (max-width: 650px) {
  .nearby-actions {
    gap: 12px;
  }
  .nearby-actions > .button {
    flex: 1;
  }
  .nearby-search {
    margin-top: 12px;
  }
}

/* Keep task forms unobstructed while preserving comparison selections. */
body:has(#auth-form, #contact-form, #reply-form, #listing-form, #password-activation, #terms-form, #buyer-profile, #seller-profile, #followup-form, #save-search-form) #comparison-tray {
  display: none;
}
button {
  min-height: 44px;
}
@media (max-width: 1000px), (pointer: coarse) {
  .leaflet-control-zoom a {
    width: 44px;
    height: 44px;
    line-height: 44px;
  }
}
