:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --fb-blue: #1877f2;
  --fb-blue-hover: #166fe5;
  --navy: #1c1e21;
  --navy-2: #3a3b3c;
  --gold: #b88a2b;
  --text: #050505;
  --muted: #65676b;
  --border: #dadde1;
  --success: #31a24c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 2px 12px rgba(0, 0, 0, 0.12);
  color: var(--text);
  background: var(--bg);
  font-family: "Cairo", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
}

body.sheet-open {
  overflow: hidden;
}

.network-notice {
  position: fixed;
  top: 8px;
  right: 50%;
  z-index: 120;
  width: min(560px, calc(100% - 24px));
  padding: 9px 14px;
  border: 1px solid #ccd0d5;
  border-radius: 8px;
  color: #1c1e21;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  transform: translateX(50%);
}

.network-notice[hidden] {
  display: none;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(24, 119, 242, 0.38);
  outline-offset: 2px;
}

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

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--navy);
  text-decoration: none;
}

.brand > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.brand b {
  font-size: 0.98rem;
  white-space: nowrap;
}

.brand small {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.brand-icon,
.brand-mark {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: var(--fb-blue);
  box-shadow: none;
  font-weight: 800;
}

.vvip-badge {
  padding: 2px 6px;
  border: 1px solid #d6b45f;
  border-radius: 999px;
  color: #6f5208;
  background: #fff4cc;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.button:hover {
  filter: brightness(0.98);
}

.button--gold {
  color: #ffffff;
  background: var(--fb-blue);
}

.button--primary {
  color: #ffffff;
  background: var(--fb-blue);
}

.button--primary:hover {
  background: var(--fb-blue-hover);
}

.button--quiet {
  color: #1c1e21;
  border-color: var(--border);
  background: #f5f6f7;
}

.button--quiet:hover {
  border-color: #ccd0d5;
  background: #e4e6eb;
  box-shadow: none;
}

.button.is-interested {
  color: var(--success);
  border-color: #b9ddca;
  background: #edf8f2;
}

.hero {
  padding: 24px 16px 12px;
  text-align: center;
  background: var(--bg);
}

.eyebrow {
  display: inline-block;
  color: var(--fb-blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero h1 {
  max-width: 760px;
  margin: 6px auto;
  color: var(--text);
  font-size: clamp(1.55rem, 5vw, 2.35rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.hero p {
  max-width: 650px;
  margin: 0 auto 14px;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.6;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(680px, 100%);
  margin: auto;
  padding: 4px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: var(--fb-blue);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
}

.search-box > span[aria-hidden] {
  color: var(--fb-blue);
  font-size: 1.7rem;
  line-height: 1;
}

.search-box input {
  width: 100%;
  height: 46px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-box input::placeholder {
  color: #8792a3;
}

.marketplace {
  width: min(1180px, 100%);
  margin: auto;
  padding: 12px 16px 56px;
  scroll-margin-top: 68px;
}

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

.section-heading h2 {
  margin: 4px 0;
  color: var(--text);
  font-size: 1.55rem;
}

.section-heading p {
  margin: 0 0 5px;
  color: var(--muted);
  font-weight: 700;
}

.sector-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 2px 20px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.sector-filters::-webkit-scrollbar {
  display: none;
}

.filter {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: #ffffff;
  cursor: pointer;
  font-weight: 700;
  scroll-snap-align: start;
}

.filter:hover {
  color: var(--text);
  border-color: #ccd0d5;
}

.filter.is-active {
  color: #ffffff;
  border-color: var(--fb-blue);
  background: var(--fb-blue);
  box-shadow: none;
}

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

.listing-skeleton {
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(#e4e6eb 0 0) top / 100% 58% no-repeat,
    linear-gradient(#e4e6eb 0 0) 16px 66% / 62% 14px no-repeat,
    linear-gradient(#f0f2f5 0 0) 16px 74% / 38% 12px no-repeat,
    linear-gradient(#f0f2f5 0 0) 16px 84% / calc(100% - 32px) 46px no-repeat,
    #ffffff;
  box-shadow: var(--shadow-sm);
}

.listing-card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 140ms ease, border-color 140ms ease;
}

.listing-card:hover {
  border-color: #ccd0d5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.listing-visual {
  position: relative;
  display: grid;
  place-items: end start;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 16px;
  overflow: hidden;
  border: 0;
  color: var(--navy);
  background: linear-gradient(145deg, #dce5ef, #90a3b9);
}

button.listing-visual {
  cursor: pointer;
}

.listing-visual::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.38), transparent 31%),
    linear-gradient(180deg, transparent 48%, rgba(8, 20, 37, 0.24));
}

.listing-visual::after {
  position: absolute;
  top: 50%;
  left: 50%;
  color: rgba(255, 255, 255, 0.7);
  content: "✦";
  font-size: clamp(3.6rem, 12vw, 6.5rem);
  line-height: 1;
  text-shadow: 0 8px 24px rgba(8, 20, 37, 0.18);
  transform: translate(-50%, -52%);
}

.listing-visual span {
  position: relative;
  z-index: 1;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(15, 31, 55, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
}

.visual--engine,
.visual--brakes,
.visual--detail {
  background: linear-gradient(140deg, #173a60, #7897b7);
}

.visual--engine::after,
.visual--brakes::after,
.visual--detail::after {
  content: "⚙";
}

.visual--marble,
.visual--lighting,
.visual--tools {
  background: linear-gradient(140deg, #cdb88f, #80694f);
}

.visual--marble::after,
.visual--lighting::after,
.visual--tools::after {
  content: "◆";
}

.visual--villa,
.visual--office,
.visual--land {
  background: linear-gradient(140deg, #4f7468, #9cb7a8);
}

.visual--villa::after,
.visual--office::after,
.visual--land::after {
  content: "⌂";
}

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

.listing-location {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.listing-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.14rem;
  line-height: 1.5;
}

.listing-price {
  display: block;
  margin: 8px 0 5px;
  color: var(--text);
  font-size: 1.18rem;
  font-weight: 800;
}

.listing-summary,
.sheet-summary {
  color: var(--muted);
  line-height: 1.75;
}

.listing-summary {
  margin: 5px 0 0;
  font-size: 0.86rem;
}

.spec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 13px 0;
}

.spec-chips span {
  padding: 5px 9px;
  border: 1px solid #e6eaf0;
  border-radius: 6px;
  color: #526075;
  background: #f0f2f5;
  font-size: 0.72rem;
  font-weight: 700;
}

.card-actions,
.sheet-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}

.card-actions .button,
.sheet-actions .button {
  width: 100%;
  min-width: 0;
  padding-inline: 8px;
  font-size: 0.8rem;
}

.empty-state {
  margin-top: 8px;
  padding: 54px 20px;
  border: 1px dashed #c8d1dd;
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.62);
}

.empty-state .button {
  margin-top: 10px;
}

.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(8, 20, 37, 0.58);
  backdrop-filter: blur(3px);
}

.detail-sheet {
  position: absolute;
  inset: auto 0 0;
  max-height: 92vh;
  padding: 16px 18px 28px;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  outline: 0;
  background: #ffffff;
  box-shadow: 0 -20px 52px rgba(8, 20, 37, 0.24);
}

.sheet-close {
  position: sticky;
  top: 0;
  z-index: 3;
  float: left;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--navy);
  background: #ffffff;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.sheet-visual {
  margin-top: 4px;
  border-radius: 17px;
}

.detail-sheet h2 {
  margin: 5px 0;
  color: var(--navy);
  font-size: 1.6rem;
  line-height: 1.45;
}

.disclaimer {
  padding: 12px 14px;
  border: 1px solid #eadbb9;
  border-radius: 12px;
  color: #65522e;
  background: #fbf7ed;
  font-size: 0.8rem;
  line-height: 1.75;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 20px;
  left: 16px;
  z-index: 80;
  width: min(480px, calc(100% - 32px));
  margin: auto;
  padding: 13px 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  color: #ffffff;
  background: #1c1e21;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.auth-gate {
  display: grid;
  align-items: center;
  gap: 28px;
  min-height: 100vh;
  padding: 28px 18px;
  background: var(--bg);
}

.auth-gate[hidden],
.app-shell[hidden],
.sheet-layer[hidden],
.toast[hidden] {
  display: none;
}

.auth-gate__brand {
  max-width: 520px;
  margin: auto;
  text-align: center;
}

.auth-gate__brand h1 {
  margin: 16px 0 4px;
  color: var(--navy);
  font-size: 2.5rem;
}

.auth-gate__brand p,
.auth-gate__card p {
  color: var(--muted);
  line-height: 1.75;
}

.auth-gate__card {
  width: 100%;
  max-width: 460px;
  margin: auto;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow-lg);
}

.auth-gate__card h2 {
  margin: 8px 0;
  color: var(--navy);
}

.cl-rootBox {
  width: 100%;
}

@media (max-width: 430px) {
  .app-header {
    padding-inline: 12px;
  }

  .brand small {
    display: none;
  }

  .brand-icon,
  .brand-mark {
    min-width: 38px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .button {
    min-height: 42px;
    padding-inline: 10px;
    font-size: 0.78rem;
  }
}

@media (min-width: 680px) {
  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-sheet {
    right: 50%;
    left: auto;
    width: min(620px, 92vw);
    transform: translateX(50%);
  }

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

  .auth-gate__brand {
    text-align: right;
  }
}

@media (min-width: 1020px) {
  .app-header {
    padding-inline: max(24px, calc((100vw - 1240px) / 2));
  }

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

  .detail-sheet {
    bottom: 24px;
    max-height: calc(100vh - 48px);
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
