:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-soft: #ffffff;
  --ink: #111111;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-dark: #111111;
  --accent-soft: #f3f4f6;
  --shadow: 0 18px 40px rgba(17, 17, 17, 0.06);
  --shadow-soft: 0 10px 26px rgba(17, 17, 17, 0.05);
  --radius: 18px;
}

body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.05), transparent 26%),
    linear-gradient(180deg, #fafafb 0%, #f5f7fa 100%);
  color: var(--ink);
}

.page {
  padding: 18px 12px 52px;
}

body[data-page-kind="public"] .page {
  padding-left: 12px;
  padding-right: 12px;
}

.hero {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.hero::before,
.top-actions {
  display: none;
}

.page-toolbar {
  position: sticky;
  top: 8px;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(229, 231, 235, 0.78);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.05);
}

.toolbar-brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--ink);
  min-width: 0;
}

.toolbar-brand-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  min-height: 44px;
}

.toolbar-brand-link:hover,
.toolbar-brand-link:focus-visible,
.toolbar-brand-link:visited {
  text-decoration: none;
  color: inherit;
}

.toolbar-brand-logo {
  display: block;
  width: clamp(154px, 36vw, 178px);
  height: 46px;
  max-width: 100%;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: left center;
}

.toolbar-brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  font-family: "Manrope", "Aptos", "Segoe UI Variable Text", "Segoe UI", sans-serif;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.toolbar-brand-wordmark-my {
  color: #33446f;
}

.toolbar-brand-wordmark-ge {
  color: #ff7d28;
}

.toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
}

.toolbar-icon-btn,
.favorite-toolbar-btn,
.toolbar-filter-btn,
.toolbar-menu-btn {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
  color: var(--ink);
  box-shadow: none;
}

.favorite-toolbar-btn,
.favorite-toolbar-btn .favorite-toolbar-icon,
.favorite-toolbar-btn .fav-svg {
  color: #e85d75;
}

.toolbar-filter-btn {
  color: #4f46e5;
}

#toolbar_menu_btn,
#toolbar_menu_btn .toolbar-svg {
  color: #2563eb;
}

#settings_menu_btn,
#settings_menu_btn .toolbar-svg {
  color: #475569;
}

.favorite-toolbar-btn:hover,
.favorite-toolbar-btn:focus-visible {
  background: #fff1f2;
}

.toolbar-filter-btn:hover,
.toolbar-filter-btn:focus-visible {
  background: #eef2ff;
}

#toolbar_menu_btn:hover,
#toolbar_menu_btn:focus-visible {
  background: #eff6ff;
}

#settings_menu_btn:hover,
#settings_menu_btn:focus-visible {
  background: #f1f5f9;
}

.toolbar-svg {
  width: 21px;
  height: 21px;
}

.favorite-toolbar-badge,
.toolbar-icon-badge {
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #f97316;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  box-shadow: none;
}

.toolbar-menu-panel {
  top: calc(100% + 8px);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 34px rgba(17, 17, 17, 0.08);
}

.toolbar-menu-option,
.toolbar-menu-action {
  border-color: var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

.toolbar-menu-option.is-active,
.lang-switch-btn.is-active,
.currency-switch-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.settings-menu-panel {
  width: min(286px, calc(100vw - 24px));
}

.ads-settings-section {
  gap: 10px;
}

.ads-settings-copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.app-about-section {
  gap: 8px;
}

.app-version-text {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.ads-disable-btn {
  width: 100%;
  min-height: 42px;
  justify-content: center;
  background: linear-gradient(180deg, #e97832 0%, #d96524 100%);
  border: 0;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(217, 101, 36, 0.18);
}

.ads-disable-btn:disabled,
.ads-disable-btn.is-disabled {
  background: #f1f5f9;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

.ad-slot {
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.ad-slot-label {
  padding: 9px 12px 0;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ad-slot-feed {
  min-height: 120px;
}

.ad-slot-detail {
  margin-top: 14px;
  min-height: 110px;
}

.modal-actions .modal-ad-slot:empty {
  display: none;
}

.modal-actions .ad-slot-detail {
  margin-top: 0;
  min-height: 104px;
}

.modal-action-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.ad-slot-test {
  background:
    linear-gradient(135deg, rgba(233, 120, 50, 0.08), rgba(37, 99, 235, 0.08)),
    #ffffff;
}

.ad-test-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 18px;
}

.ad-test-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: #111827;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ad-test-title {
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.ad-test-copy {
  margin-top: 3px;
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.35;
}

.gallery-ad-slide,
.fullscreen-ad-slide {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
  z-index: 1;
}

.gallery-frame[data-ad-slide="true"] .gallery-ad-slide,
.fullscreen-ad-slide[data-ad-slide="true"] {
  display: grid;
}

.ad-slot-gallery {
  width: min(420px, 88%);
  min-height: 150px;
}

.ad-slot-fullscreen-gallery {
  width: min(520px, 86vw);
  min-height: 190px;
}

.gallery-ad-thumb {
  display: grid;
  place-items: center;
  border: 2px solid transparent;
  background: linear-gradient(135deg, rgba(233, 120, 50, 0.12), rgba(37, 99, 235, 0.12)), #fff;
  color: #111827;
  font-weight: 800;
  letter-spacing: 0.04em;
}

body.ads-disabled .ad-slot {
  display: none !important;
}

.control-shell-summary {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.filter-summary-bar {
  display: grid;
  gap: 16px;
  margin-top: 0;
  padding: 20px;
  border: 0;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.filter-summary-meta {
  gap: 12px;
}

.filter-summary-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-summary-chip {
  min-height: 32px;
  padding: 7px 13px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

.filter-summary-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  width: 100%;
}

.filter-summary-actions .filter-summary-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: none;
}

.ghost-btn.filter-summary-btn {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #334155;
}

.ghost-btn.filter-summary-btn:hover,
.ghost-btn.filter-summary-btn:focus-visible {
  background: #f8fafc;
}

.search-submit.filter-summary-btn {
  border: 0;
  background: linear-gradient(180deg, #e97832 0%, #d96524 100%);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(233, 120, 50, 0.18);
}

.search-submit.filter-summary-btn:hover,
.search-submit.filter-summary-btn:focus-visible {
  background: #c9551b;
}

.table-wrap {
  margin-top: 26px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.results-head {
  display: grid;
  gap: 8px;
  padding: 2px 2px 10px;
  border: 0;
  background: transparent;
}

.results-head .section-kicker {
  display: block;
  padding-left: 6px;
  margin-left: 0;
  color: #111827;
  overflow: visible;
}

.results-title {
  margin-top: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.results-subtitle,
.results-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.results-note {
  padding: 0 2px 10px;
}

.results-sort-tools {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.results-sort-field {
  display: grid;
  gap: 4px;
  min-width: min(100%, 220px);
}

.results-sort-field span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.results-sort-select,
.page-size-select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background-color: #ffffff;
  color: var(--ink);
  box-shadow: none;
}

.results-sort-direction-btn,
.page-button {
  border: 0;
  border-radius: 12px;
  background: #ffffff;
  color: var(--muted);
  box-shadow: none;
}

.results-sort-direction-btn.is-active,
.page-button.is-active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

table {
  min-width: 1680px;
  background: #ffffff;
  border-radius: 24px;
}

th,
td {
  border-bottom: 1px solid rgba(229, 231, 235, 0.6);
  color: var(--ink);
}

th {
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.filter-row th,
tbody tr:nth-child(even),
tbody tr:hover {
  background: #ffffff;
}

tbody tr[data-index] {
  cursor: pointer;
}

.column-filter,
.column-select {
  border: 1px solid var(--line);
  background: #f9fafb;
  color: var(--ink);
}

.source-chip,
.data-chip {
  border: 0;
  background: #f3f4f6;
  color: var(--muted);
  font-weight: 600;
}

.price-main,
.mobile-card-price {
  color: #111111;
  font-weight: 800;
}

.title-main,
.mobile-card-title {
  color: #111111;
  font-weight: 600;
}

.address-secondary,
.updated-secondary,
.price-secondary,
.price-secondary-per-m2,
.mobile-card-location,
.mobile-card-address,
.mobile-card-updated,
.mobile-card-meta {
  color: var(--muted);
}

.mobile-results {
  display: none;
  padding: 6px 0 18px;
  gap: 16px;
}

.mobile-card {
  border: 0;
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(17, 17, 17, 0.06);
  overflow: hidden;
}

.mobile-card-gallery {
  padding: 0;
  background: transparent;
}

.mobile-card-gallery-frame {
  aspect-ratio: 1.14 / 1;
  border-radius: 0;
  overflow: hidden;
}

.mobile-card-gallery-frame.is-empty {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.mobile-card-hero {
  object-fit: cover;
}

.mobile-card-no-photo {
  width: 100%;
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  color: #64748b;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.92) 0 26%, transparent 27%),
    linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.mobile-card-no-photo svg {
  width: min(38vw, 148px);
  max-width: 62%;
  height: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.74;
}

.mobile-card-no-photo span {
  color: #475569;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mobile-card-gallery-counter {
  top: 14px;
  right: 14px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.56);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.mobile-card-gallery-dots {
  bottom: 14px;
}

.mobile-card-gallery-dot {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.46);
}

.mobile-card-gallery-dot.is-active {
  background: #ffffff;
}

.mobile-card-body {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}

.mobile-card-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 10px;
}

.mobile-card-price {
  min-width: 0;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.mobile-card-price-secondary {
  align-self: end;
  white-space: nowrap;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.favorite-btn,
.favorite-btn-card,
.favorite-btn-modal {
  border: 0;
  background: #fff1f2;
  color: #ef4444;
  box-shadow: none;
}

.favorite-btn-card {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 14px;
}

.mobile-card-title {
  font-size: 16px;
  line-height: 1.28;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mobile-card-title,
.mobile-card-meta,
.mobile-card-location {
  font-size: 16px;
  line-height: 1.28;
}

.mobile-card-meta,
.mobile-card-location {
  font-weight: 600;
}

.mobile-card-meta span + span::before {
  color: #c7ccd4;
  margin: 0 6px;
}

.mobile-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 0;
  flex-wrap: nowrap;
}

.mobile-card-source {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.mobile-card-location {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #111827;
}

.mobile-card-updated {
  font-size: 13px;
  line-height: 1.35;
  color: #6b7280;
  white-space: nowrap;
  margin-left: auto;
  text-align: right;
  flex: 0 0 auto;
}

.favorite-toolbar-btn.is-active,
.favorite-btn.is-favorite {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.favorite-toolbar-btn.is-active .fav-svg,
.favorite-btn.is-favorite .fav-svg,
.favorite-toolbar-btn.is-active .favorite-toolbar-icon {
  color: #dc2626;
}

.pagination-head {
  color: var(--muted);
  font-size: 12px;
}

.table-pagination {
  padding: 8px 2px 0;
}

.empty,
.results-loading-inline {
  color: var(--muted);
}

.modal-head-title,
#modal_title {
  font-size: 19px;
  font-weight: 700;
  color: #111827;
}

#modal_price {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

#modal_price_secondary {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
}

#modal_description,
.modal-copy .sub {
  font-size: 15px;
  line-height: 1.5;
  color: #475569;
}

.badge,
.modal-badges .badge {
  font-size: 13px;
  padding: 7px 11px;
}

.metric {
  padding: 14px;
  border-color: #e5e7eb;
}

.metric-label {
  color: #94a3b8;
  font-size: 12px;
}

.metric-value {
  font-size: 16px;
  color: #111827;
}

@media (max-width: 760px) {
  .page {
    padding: 16px 10px 44px;
  }

  .table-wrap table {
    display: none;
  }

  .mobile-results {
    display: grid;
  }

  body[data-page-kind="public"] .page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .page-toolbar {
    top: 8px;
    padding: 12px 14px;
    border-radius: 22px;
  }

  .toolbar-brand {
    font-size: 18px;
  }

  .toolbar-brand-logo {
    height: 44px;
    width: clamp(148px, 38vw, 168px);
    max-width: 100%;
  }

  .toolbar-brand-wordmark {
    font-size: 26px;
  }

  .filter-summary-bar {
    padding: 18px;
    border-radius: 22px;
  }

  .toolbar-actions {
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .page-toolbar {
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
  }

  .toolbar-brand-logo {
    height: 44px;
    width: clamp(142px, 40vw, 162px);
    max-width: 100%;
  }

  .toolbar-actions {
    gap: 8px;
  }

  .toolbar-icon-btn,
  .favorite-toolbar-btn,
  .toolbar-filter-btn,
  .toolbar-menu-btn {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
  }

  .filter-summary-actions {
    grid-template-columns: 1fr 1.15fr;
  }

  .filter-summary-actions .filter-summary-btn {
    min-height: 48px;
  }

  .results-head {
    padding: 0 2px 8px;
  }

  .results-head .section-kicker {
    padding-left: 8px;
  }

  .mobile-card {
    border-radius: 24px;
  }

  .mobile-card-body {
    padding: 14px 14px 16px;
  }

  .mobile-card-price-row {
    gap: 8px;
  }

  .mobile-card-price {
    font-size: 21px;
  }

  .mobile-card-price-secondary {
    font-size: 13px;
  }
}

/* Force single-line footer on mobile cards */
.mobile-card-footer {
  display: flex;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between;
  width: 100%;
}

.mobile-card-source {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap !important;
  white-space: nowrap;
  min-width: 0;
  flex: 0 1 auto;
}

.mobile-card-source .source-chip,
.mobile-card-source .data-chip,
.mobile-card-source .tooltip-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex: 0 0 auto;
}

.mobile-card-updated {
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: right;
}

/* Restore premium listing price treatment after compact card overrides. */
.price-main,
.mobile-card-price {
  font-family: var(--myge-font-serif, "Fraunces", Georgia, serif);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.price-main {
  font-size: 22px;
  line-height: 1.02;
}

.mobile-card-price {
  font-size: clamp(30px, 8vw, 38px);
  line-height: 0.96;
}

@media (max-width: 640px) {
  .mobile-card-price {
    font-size: 30px;
  }
}

/* Keep listing-row descriptions compact; full text remains available in the detail view. */
.title-stack .updated-secondary {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile listing cards: keep location concise and move street to its own line. */
.mobile-card-address {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
