/* thinkNXG Estate Marketplace — design system.
   Tokens first, then components. Everything is scoped to .mp-* classes and uses logical
   properties (inline-start / inline-end) so the same CSS serves English and Arabic (RTL). */

:root {
  --mp-navy: #0b1f3a;
  --mp-navy-2: #12305a;
  --mp-navy-3: #1d4277;
  --mp-teal: #0f9d8f;
  --mp-teal-2: #14b8a6;
  --mp-teal-soft: #e6f6f4;
  --mp-gold: #c8963e;
  --mp-gold-soft: #fbf3e4;
  --mp-ink: #172233;
  --mp-ink-2: #3d4a5c;
  --mp-muted: #6b778a;
  --mp-line: #e4e8ee;
  --mp-line-2: #d3d9e2;
  --mp-bg: #ffffff;
  --mp-canvas: #f5f7fa;
  --mp-ok: #0d7a4e;
  --mp-ok-soft: #e3f5ec;
  --mp-warn: #9a5b00;
  --mp-warn-soft: #fff4dc;
  --mp-danger: #b42318;
  --mp-danger-soft: #fdecea;
  --mp-radius: 14px;
  --mp-radius-sm: 9px;
  --mp-radius-lg: 22px;
  --mp-shadow-1: 0 1px 2px rgba(11, 31, 58, .06), 0 1px 1px rgba(11, 31, 58, .04);
  --mp-shadow-2: 0 2px 6px rgba(11, 31, 58, .06), 0 12px 32px rgba(11, 31, 58, .08);
  --mp-shadow-3: 0 18px 50px rgba(11, 31, 58, .18);
  --mp-font: "Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mp-wrap: 1240px;
}

html[dir="rtl"] { --mp-font: "Noto Sans Arabic", "Inter", system-ui, "Segoe UI", Tahoma, sans-serif; }

body.mp-body { margin: 0; background: var(--mp-bg); color: var(--mp-ink); font-family: var(--mp-font);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body.mp-body a { color: inherit; text-decoration: none; }
body.mp-body a:hover { text-decoration: none; }
.mp-body img { max-width: 100%; display: block; }
.mp-body h1, .mp-body h2, .mp-body h3, .mp-body h4 { color: var(--mp-navy); letter-spacing: -.015em; margin: 0; font-weight: 700; }
html[dir="rtl"] .mp-body h1, html[dir="rtl"] .mp-body h2, html[dir="rtl"] .mp-body h3 { letter-spacing: 0; }
.mp-wrap { max-width: var(--mp-wrap); margin-inline: auto; padding-inline: 20px; }
.mp-skip { position: absolute; inset-inline-start: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 99; }
.mp-skip:focus { inset-inline-start: 8px; }
.mp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mp-icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.mp-muted { color: var(--mp-muted); }
:focus-visible { outline: 3px solid rgba(20, 184, 166, .45); outline-offset: 2px; }

/* ---------------------------------------------------------------- buttons */
.mp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px;
  padding-inline: 18px; border-radius: 11px; border: 1px solid transparent; font: 600 14.5px/1 var(--mp-font);
  cursor: pointer; transition: background .15s, box-shadow .15s, transform .05s, border-color .15s; white-space: nowrap; }
.mp-btn:active { transform: translateY(1px); }
.mp-btn[disabled] { opacity: .55; cursor: not-allowed; }
.mp-btn-primary { background: var(--mp-teal); color: #fff !important; }
.mp-btn-primary:hover { background: #0c8a7e; box-shadow: 0 6px 18px rgba(15, 157, 143, .28); }
.mp-btn-navy { background: var(--mp-navy); color: #fff !important; }
.mp-btn-navy:hover { background: var(--mp-navy-2); }
.mp-btn-gold { background: var(--mp-gold); color: #fff !important; }
.mp-btn-ghost { background: #fff; color: var(--mp-navy) !important; border-color: var(--mp-line-2); }
.mp-btn-ghost:hover { border-color: var(--mp-navy); }
.mp-btn-wa { background: #1fa855; color: #fff !important; }
.mp-btn-sm { height: 36px; padding-inline: 12px; font-size: 13.5px; border-radius: 9px; }
.mp-btn-block { width: 100%; }
.mp-iconbtn { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center;
  background: rgba(255, 255, 255, .94); border: 1px solid var(--mp-line); color: var(--mp-navy); cursor: pointer; }
.mp-iconbtn.is-on { color: #e0245e; }
.mp-iconbtn.is-on .mp-icon { fill: #e0245e; stroke: #e0245e; }

/* ---------------------------------------------------------------- header */
.mp-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--mp-line); }
.mp-header .mp-wrap { display: flex; align-items: center; gap: 22px; height: 68px; }
.mp-brand { flex: none; margin-inline-end: 8px; white-space: nowrap; display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--mp-navy); font-size: 17px; }
.mp-brand img { width: 34px; height: 34px; }
.mp-brand small { display: block; font-size: 11px; font-weight: 600; color: var(--mp-teal); letter-spacing: .08em;
  text-transform: uppercase; }
.mp-nav { display: flex; gap: 4px; align-items: center; flex: 1; }
.mp-nav a { white-space: nowrap; padding: 8px 9px; border-radius: 8px; font-weight: 550; color: var(--mp-ink-2); font-size: 14.5px; }
.mp-nav a:hover, .mp-nav a.is-active { color: var(--mp-navy); background: var(--mp-canvas); }
.mp-header-end { display: flex; align-items: center; gap: 10px; }
.mp-lang { border: 1px solid var(--mp-line-2); background: #fff; border-radius: 9px; height: 36px; padding-inline: 10px;
  font: 600 13px var(--mp-font); color: var(--mp-navy); cursor: pointer; }
.mp-burger { display: none; }
@media (max-width: 1320px) {
  .mp-nav { display: none; position: absolute; inset-inline: 0; top: 68px; background: #fff; flex-direction: column;
    align-items: stretch; padding: 12px 20px 20px; border-bottom: 1px solid var(--mp-line); box-shadow: var(--mp-shadow-2); }
  .mp-nav.is-open { display: flex; }
  .mp-nav a { padding: 12px; font-size: 16px; }
  .mp-burger { display: inline-grid; }
  .mp-header-end .mp-hide-sm { display: none; }
}

/* ---------------------------------------------------------------- hero and search */
.mp-hero { position: relative; color: #fff; background: radial-gradient(1200px 500px at 85% -10%, rgba(20, 184, 166, .35), transparent 60%),
  radial-gradient(900px 400px at 0% 110%, rgba(200, 150, 62, .28), transparent 60%),
  linear-gradient(160deg, var(--mp-navy) 0%, var(--mp-navy-2) 60%, var(--mp-navy-3) 100%); overflow: hidden; }
.mp-hero::after { content: ""; position: absolute; inset: 0; background-image: var(--mp-hero-img, none);
  background-size: cover; background-position: center; opacity: .18; mix-blend-mode: luminosity; pointer-events: none; }
.mp-hero .mp-wrap { position: relative; z-index: 1; padding-block: 72px 88px; }
.mp-hero h1 { color: #fff; font-size: clamp(30px, 4.6vw, 54px); line-height: 1.08; max-width: 780px; }
.mp-hero p.lead { color: rgba(255, 255, 255, .82); font-size: clamp(16px, 1.6vw, 19px); max-width: 640px; margin: 16px 0 30px; }
.mp-eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--mp-teal-2); }
.mp-hero .mp-eyebrow { color: #7fe7da; }
.mp-searchbox { background: #fff; border-radius: var(--mp-radius-lg); box-shadow: var(--mp-shadow-3); max-width: 980px; color: var(--mp-ink); }
.mp-tabs { display: flex; gap: 4px; padding: 10px 12px 0; }
.mp-tab { border: 0; background: transparent; padding: 10px 16px; border-radius: 10px 10px 0 0; font: 650 14.5px var(--mp-font);
  color: var(--mp-muted); cursor: pointer; border-bottom: 3px solid transparent; }
.mp-tab.is-active { color: var(--mp-navy); border-bottom-color: var(--mp-teal); }
.mp-searchrow { display: grid; grid-template-columns: 2.2fr 1.2fr 1fr 1.1fr auto; gap: 10px; padding: 14px; border-top: 1px solid var(--mp-line); }
.mp-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mp-field label { font-size: 11.5px; font-weight: 700; color: var(--mp-muted); text-transform: uppercase; letter-spacing: .06em; }
.mp-input, .mp-select, .mp-textarea { width: 100%; height: 44px; border: 1px solid var(--mp-line-2); border-radius: 10px;
  padding-inline: 12px; font: 500 14.5px var(--mp-font); color: var(--mp-ink); background: #fff; box-sizing: border-box; }
.mp-textarea { height: auto; min-height: 96px; padding-block: 10px; resize: vertical; }
.mp-input:focus, .mp-select:focus, .mp-textarea:focus { border-color: var(--mp-teal); outline: 0; box-shadow: 0 0 0 3px rgba(20, 184, 166, .18); }
.mp-ac { position: relative; }
.mp-ac-list { position: absolute; inset-inline: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--mp-line);
  border-radius: 12px; box-shadow: var(--mp-shadow-2); z-index: 30; max-height: 320px; overflow: auto; display: none; }
.mp-ac-list.is-open { display: block; }
.mp-ac-item { padding: 10px 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.mp-ac-item:hover, .mp-ac-item.is-active { background: var(--mp-canvas); }
.mp-ac-item small { color: var(--mp-muted); }
@media (max-width: 860px) { .mp-searchrow { grid-template-columns: 1fr 1fr; } .mp-searchrow .mp-field:first-child { grid-column: 1 / -1; }
  .mp-searchrow .mp-btn { grid-column: 1 / -1; } }
.mp-hero-stats { display: flex; gap: 36px; margin-top: 34px; flex-wrap: wrap; }
.mp-hero-stats b { display: block; font-size: 26px; color: #fff; }
.mp-hero-stats span { color: rgba(255, 255, 255, .7); font-size: 13.5px; }

/* ---------------------------------------------------------------- sections */
.mp-section { padding-block: 64px; }
.mp-section.alt { background: var(--mp-canvas); }
.mp-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.mp-section-head h2 { font-size: clamp(22px, 2.6vw, 31px); }
.mp-section-head p { margin: 6px 0 0; color: var(--mp-muted); max-width: 640px; }
.mp-link { color: var(--mp-teal) !important; font-weight: 650; display: inline-flex; gap: 6px; align-items: center; }
.mp-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.mp-grid-4 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---------------------------------------------------------------- property card */
.mp-card { position: relative; background: #fff; border: 1px solid var(--mp-line); border-radius: var(--mp-radius);
  overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s, border-color .2s; }
.mp-card:hover { box-shadow: var(--mp-shadow-2); transform: translateY(-2px); border-color: transparent; }
.mp-card-media { position: relative; aspect-ratio: 4 / 3; background: var(--mp-canvas); overflow: hidden; }
.mp-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.mp-card:hover .mp-card-media img { transform: scale(1.04); }
.mp-card-badges { position: absolute; top: 12px; inset-inline-start: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.mp-card-actions { position: absolute; top: 10px; inset-inline-end: 10px; display: flex; gap: 6px; }
.mp-card-count { position: absolute; bottom: 10px; inset-inline-end: 10px; background: rgba(11, 31, 58, .72); color: #fff;
  font-size: 12px; padding: 3px 8px; border-radius: 6px; display: inline-flex; gap: 4px; align-items: center; }
.mp-card-body { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mp-price { font-size: 20px; font-weight: 800; color: var(--mp-navy); font-variant-numeric: tabular-nums; }
.mp-price small { font-size: 13px; color: var(--mp-muted); font-weight: 600; }
.mp-card-title { font-size: 15.5px; font-weight: 650; color: var(--mp-ink); line-height: 1.35; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mp-card-loc { color: var(--mp-muted); font-size: 13.5px; display: flex; gap: 5px; align-items: center; }
.mp-facts { display: flex; gap: 14px; color: var(--mp-ink-2); font-size: 13.5px; flex-wrap: wrap; }
.mp-facts span { display: inline-flex; gap: 5px; align-items: center; }
.mp-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 16px;
  border-top: 1px solid var(--mp-line); font-size: 13px; color: var(--mp-muted); }
.mp-publisher { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mp-publisher img, .mp-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--mp-canvas);
  display: grid; place-items: center; font-weight: 700; color: var(--mp-navy); font-size: 11px; flex: none; }
.mp-publisher span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-card.is-featured { border-color: rgba(200, 150, 62, .55); }
.mp-card.is-spotlight { border: 2px solid var(--mp-gold); }
.mp-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.mp-card-actions, .mp-card-foot a { position: relative; z-index: 2; }

.mp-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 4px 8px;
  border-radius: 7px; background: #fff; color: var(--mp-navy); box-shadow: var(--mp-shadow-1); letter-spacing: .02em; }
.mp-badge.gold { background: var(--mp-gold); color: #fff; }
.mp-badge.teal { background: var(--mp-teal); color: #fff; }
.mp-badge.navy { background: var(--mp-navy); color: #fff; }
.mp-badge.ok { background: var(--mp-ok-soft); color: var(--mp-ok); box-shadow: none; }
.mp-badge.warn { background: var(--mp-warn-soft); color: var(--mp-warn); box-shadow: none; }
.mp-badge.danger { background: var(--mp-danger-soft); color: var(--mp-danger); box-shadow: none; }
.mp-badge.soft { background: var(--mp-canvas); box-shadow: none; color: var(--mp-ink-2); }
.mp-verified { color: var(--mp-teal); display: inline-flex; gap: 4px; align-items: center; font-weight: 650; }

/* list view of cards */
.mp-results.is-list .mp-grid { grid-template-columns: 1fr; }
.mp-results.is-list .mp-card { flex-direction: row; }
.mp-results.is-list .mp-card-media { width: 340px; aspect-ratio: auto; min-height: 220px; flex: none; }
@media (max-width: 720px) { .mp-results.is-list .mp-card { flex-direction: column; }
  .mp-results.is-list .mp-card-media { width: 100%; aspect-ratio: 4 / 3; min-height: 0; } }

/* ---------------------------------------------------------------- tiles */
.mp-tile { position: relative; border-radius: var(--mp-radius); overflow: hidden; min-height: 170px; display: flex;
  align-items: flex-end; padding: 18px; color: #fff; background: linear-gradient(160deg, var(--mp-navy-2), var(--mp-navy)); }
.mp-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: transform .4s; }
.mp-tile:hover img { transform: scale(1.05); }
.mp-tile div { position: relative; }
.mp-body .mp-tile, .mp-body .mp-tile b, .mp-body .mp-tile span { color: #fff; }
.mp-tile b { display: block; font-size: 18px; }
.mp-tile:nth-child(3n+2) { background: linear-gradient(160deg, #0f6f68, var(--mp-navy)); }
.mp-tile:nth-child(3n) { background: linear-gradient(160deg, #6b4c18, var(--mp-navy)); }
.mp-tile::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(240px 120px at 85% 10%, rgba(255,255,255,.14), transparent 70%),
  repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 28px); }
.mp-tile span { font-size: 13px; opacity: .85; }
.mp-chip-row { display: flex; gap: 10px; flex-wrap: wrap; }
.mp-chip { display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px; border: 1px solid var(--mp-line-2);
  border-radius: 999px; background: #fff; font-weight: 600; font-size: 14px; color: var(--mp-ink-2); cursor: pointer; }
.mp-chip:hover, .mp-chip.is-on { border-color: var(--mp-teal); color: var(--mp-teal); background: var(--mp-teal-soft); }
.mp-catcard { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--mp-line); border-radius: var(--mp-radius);
  background: #fff; transition: box-shadow .2s, border-color .2s; }
.mp-catcard:hover { border-color: var(--mp-teal); box-shadow: var(--mp-shadow-2); }
.mp-catcard .mp-icon { width: 28px; height: 28px; color: var(--mp-teal); }
.mp-catcard b { color: var(--mp-navy); }
.mp-profilecard { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius); background: #fff; }
.mp-profilecard img, .mp-profilecard .mp-avatar { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; font-size: 18px; }
.mp-profilecard b { color: var(--mp-navy); display: block; }

/* ---------------------------------------------------------------- search page */
.mp-searchbar { position: sticky; top: 68px; z-index: 30; background: #fff; border-bottom: 1px solid var(--mp-line); }
.mp-searchbar .mp-wrap { display: flex; gap: 10px; padding-block: 12px; align-items: center; flex-wrap: wrap; }
.mp-searchbar .mp-ac { flex: 1 1 260px; }
.mp-searchbar .mp-select { width: auto; min-width: 128px; }
.mp-layout { display: grid; grid-template-columns: 290px 1fr; gap: 28px; padding-block: 26px 60px; }
.mp-filters { position: sticky; top: 140px; align-self: start; max-height: calc(100vh - 160px); overflow: auto;
  border: 1px solid var(--mp-line); border-radius: var(--mp-radius); padding: 18px; background: #fff; }
.mp-filters h3 { font-size: 16px; margin-bottom: 12px; }
.mp-fgroup { padding-block: 14px; border-top: 1px solid var(--mp-line); }
.mp-fgroup:first-of-type { border-top: 0; padding-top: 0; }
.mp-fgroup > b { display: block; font-size: 13px; color: var(--mp-navy); margin-bottom: 10px; }
.mp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mp-checks { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.mp-checks label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.mp-checks input { width: 16px; height: 16px; accent-color: var(--mp-teal); }
.mp-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-seg button { border: 1px solid var(--mp-line-2); background: #fff; height: 34px; min-width: 40px; padding-inline: 10px;
  border-radius: 9px; font: 600 13px var(--mp-font); color: var(--mp-ink-2); cursor: pointer; }
.mp-seg button.is-on { background: var(--mp-navy); color: #fff; border-color: var(--mp-navy); }
.mp-results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.mp-results-head h1 { font-size: clamp(20px, 2.2vw, 27px); }
.mp-results-head .mp-muted { font-size: 14px; }
.mp-toolbar { display: flex; gap: 8px; align-items: center; }
.mp-view { display: inline-flex; border: 1px solid var(--mp-line-2); border-radius: 10px; overflow: hidden; }
.mp-view button { border: 0; background: #fff; height: 38px; width: 42px; display: grid; place-items: center; cursor: pointer; color: var(--mp-muted); }
.mp-view button.is-on { background: var(--mp-navy); color: #fff; }
.mp-map { height: calc(100vh - 220px); min-height: 460px; border-radius: var(--mp-radius); overflow: hidden; border: 1px solid var(--mp-line); }
.mp-pin { background: var(--mp-navy); color: #fff; font: 700 12px var(--mp-font); padding: 4px 8px; border-radius: 8px;
  box-shadow: var(--mp-shadow-2); white-space: nowrap; border: 2px solid #fff; }
.mp-pin.is-featured { background: var(--mp-gold); }
.mp-filter-toggle { display: none; }
@media (max-width: 980px) {
  .mp-layout { grid-template-columns: 1fr; }
  .mp-filters { display: none; position: fixed; inset: 0; top: 0; z-index: 60; max-height: none; border-radius: 0; padding-bottom: 90px; }
  .mp-filters.is-open { display: block; }
  .mp-filter-toggle { display: inline-flex; }
  .mp-filters-close { display: flex !important; }
}
.mp-filters-close { display: none; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mp-filters-apply { position: sticky; bottom: -18px; background: #fff; padding-block: 12px; display: none; }
@media (max-width: 980px) { .mp-filters-apply { display: block; } }
.mp-empty { text-align: center; padding: 60px 20px; border: 1px dashed var(--mp-line-2); border-radius: var(--mp-radius); color: var(--mp-muted); }
.mp-empty h3 { margin-bottom: 8px; }
.mp-pager { display: flex; gap: 6px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.mp-pager a, .mp-pager span { min-width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--mp-line-2);
  border-radius: 10px; font-weight: 650; color: var(--mp-ink-2); padding-inline: 10px; }
.mp-pager .is-on { background: var(--mp-navy); color: #fff; border-color: var(--mp-navy); }
.mp-crumbs { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--mp-muted); margin-bottom: 10px; }
.mp-crumbs a:hover { color: var(--mp-teal); }
.mp-ad { display: block; border-radius: var(--mp-radius); overflow: hidden; margin-bottom: 18px; }

/* ---------------------------------------------------------------- listing detail */
.mp-gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 220px 220px; gap: 8px; border-radius: var(--mp-radius-lg); overflow: hidden; }
.mp-gallery a { position: relative; background: var(--mp-canvas); overflow: hidden; }
.mp-gallery a:first-child { grid-row: 1 / 3; }
.mp-gallery[data-count="1"] { grid-template-columns: 1fr; }
.mp-gallery[data-count="2"] { grid-template-columns: 2fr 1fr; }
.mp-gallery[data-count="2"] a:nth-child(2) { grid-row: 1 / 3; }
.mp-gallery[data-count="3"] { grid-template-columns: 2fr 1fr; }
.mp-gallery[data-count="4"] a:nth-child(4) { grid-column: 3; grid-row: 1 / 3; }
.mp-gallery img { width: 100%; height: 100%; object-fit: cover; }
.mp-gallery-more { position: absolute; inset: 0; background: rgba(11, 31, 58, .55); color: #fff; display: grid; place-items: center; font-weight: 700; }
@media (max-width: 760px) { .mp-gallery { grid-template-columns: 1fr; grid-template-rows: 280px; }
  .mp-gallery a:not(:first-child) { display: none; } .mp-gallery a:first-child { grid-row: auto; } }
.mp-detail { display: grid; grid-template-columns: 1fr 370px; gap: 34px; padding-block: 26px 60px; }
@media (max-width: 1000px) { .mp-detail { grid-template-columns: 1fr; } }
.mp-detail-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-top: 22px; }
.mp-detail-head h1 { font-size: clamp(22px, 2.6vw, 32px); line-height: 1.2; }
.mp-detail-price { font-size: clamp(24px, 2.8vw, 34px); font-weight: 800; color: var(--mp-navy); }
.mp-keyfacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-block: 22px; }
.mp-keyfact { border: 1px solid var(--mp-line); border-radius: 12px; padding: 12px 14px; }
.mp-keyfact span { display: block; font-size: 12px; color: var(--mp-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.mp-keyfact b { color: var(--mp-navy); font-size: 16px; }
.mp-block { padding-block: 24px; border-top: 1px solid var(--mp-line); }
.mp-block h2 { font-size: 19px; margin-bottom: 14px; }
.mp-prose { color: var(--mp-ink-2); line-height: 1.75; }
.mp-prose p { margin: 0 0 12px; }
.mp-amen { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }
.mp-amen span { display: flex; gap: 8px; align-items: center; color: var(--mp-ink-2); }
.mp-amen .mp-icon { color: var(--mp-teal); }
.mp-specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 28px; }
.mp-specs div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--mp-line); gap: 12px; }
.mp-specs span { color: var(--mp-muted); }
.mp-specs b { color: var(--mp-ink); font-weight: 600; text-align: end; }
.mp-contact { position: sticky; top: 92px; border: 1px solid var(--mp-line); border-radius: var(--mp-radius-lg);
  padding: 20px; box-shadow: var(--mp-shadow-2); background: #fff; display: flex; flex-direction: column; gap: 14px; }
.mp-contact-agent { display: flex; gap: 12px; align-items: center; }
.mp-contact-agent img, .mp-contact-agent .mp-avatar { width: 54px; height: 54px; border-radius: 50%; font-size: 18px; }
.mp-contact-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mp-form { display: flex; flex-direction: column; gap: 10px; }
.mp-form .mp-hp { position: absolute; inset-inline-start: -5000px; }
.mp-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--mp-muted); }
.mp-consent input { margin-top: 3px; accent-color: var(--mp-teal); }
.mp-mobilebar { display: none; }
@media (max-width: 1000px) {
  .mp-contact { position: static; }
  .mp-mobilebar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: fixed; inset-inline: 0; bottom: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--mp-line); z-index: 50; }
  body.has-mobilebar { padding-bottom: 72px; }
}
.mp-mapbox { height: 320px; border-radius: var(--mp-radius); overflow: hidden; border: 1px solid var(--mp-line); }
.mp-video { aspect-ratio: 16 / 9; border-radius: var(--mp-radius); overflow: hidden; background: #000; }
.mp-video iframe { width: 100%; height: 100%; border: 0; }
.mp-lightbox { position: fixed; inset: 0; background: rgba(6, 14, 28, .94); z-index: 100; display: none; align-items: center; justify-content: center; }
.mp-lightbox.is-open { display: flex; }
.mp-lightbox img { max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: 8px; }
.mp-lightbox button { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; width: 48px; height: 48px;
  border-radius: 50%; cursor: pointer; font-size: 22px; }
.mp-lightbox .prev { inset-inline-start: 18px; } .mp-lightbox .next { inset-inline-end: 18px; }
.mp-lightbox .close { top: 18px; inset-inline-end: 18px; }
.mp-lightbox .count { position: absolute; bottom: 20px; color: #fff; font-size: 14px; }
html[dir="rtl"] .mp-flip { transform: scaleX(-1); }

/* ---------------------------------------------------------------- compare tray */
.mp-tray { position: fixed; bottom: 16px; inset-inline: 0; margin-inline: auto; width: min(680px, calc(100% - 24px)); background: var(--mp-navy);
  color: #fff; border-radius: 16px; padding: 12px 14px; display: none; align-items: center; gap: 12px; z-index: 55; box-shadow: var(--mp-shadow-3); }
.mp-tray.is-open { display: flex; }
.mp-tray-items { display: flex; gap: 8px; flex: 1; overflow: auto; }
.mp-tray-items img { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; }
.mp-compare-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.mp-compare-table th, .mp-compare-table td { padding: 12px 14px; border-bottom: 1px solid var(--mp-line); text-align: start; vertical-align: top; }
.mp-compare-table th { color: var(--mp-muted); font-weight: 650; width: 180px; background: var(--mp-canvas); }
.mp-compare-table td img { border-radius: 10px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.mp-tablewrap { overflow: auto; border: 1px solid var(--mp-line); border-radius: var(--mp-radius); }

/* ---------------------------------------------------------------- pricing */
.mp-billing-toggle { display: inline-flex; border: 1px solid var(--mp-line-2); border-radius: 12px; padding: 4px; gap: 4px; background: #fff; }
.mp-billing-toggle button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font: 650 14px var(--mp-font); cursor: pointer; color: var(--mp-muted); }
.mp-billing-toggle button.is-on { background: var(--mp-navy); color: #fff; }
.mp-plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: stretch; }
.mp-plan { position: relative; border: 1px solid var(--mp-line); border-radius: var(--mp-radius-lg); padding: 24px; background: #fff;
  display: flex; flex-direction: column; gap: 14px; }
.mp-plan.is-highlight { border: 2px solid var(--mp-teal); box-shadow: var(--mp-shadow-2); }
.mp-plan-flag { position: absolute; top: -12px; inset-inline-start: 22px; }
.mp-plan h3 { font-size: 20px; }
.mp-plan-price { font-size: 34px; font-weight: 800; color: var(--mp-navy); }
.mp-plan-price small { font-size: 14px; color: var(--mp-muted); font-weight: 600; }
.mp-plan ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.mp-plan li { display: flex; gap: 8px; color: var(--mp-ink-2); font-size: 14px; }
.mp-plan li .mp-icon { color: var(--mp-teal); margin-top: 2px; }

/* ---------------------------------------------------------------- generic content */
.mp-pagehead { background: linear-gradient(160deg, var(--mp-navy), var(--mp-navy-2)); color: #fff; padding-block: 48px; }
.mp-pagehead h1 { color: #fff; font-size: clamp(26px, 3.2vw, 40px); }
.mp-pagehead p { color: rgba(255, 255, 255, .8); max-width: 680px; margin-top: 10px; }
.mp-panel { border: 1px solid var(--mp-line); border-radius: var(--mp-radius); padding: 22px; background: #fff; }
.mp-steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: s; }
.mp-step { padding: 22px; border-radius: var(--mp-radius); background: #fff; border: 1px solid var(--mp-line); }
.mp-step::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; background: var(--mp-teal-soft); color: var(--mp-teal); font-weight: 800; margin-bottom: 12px; }
.mp-step b { color: var(--mp-navy); display: block; margin-bottom: 6px; }
.mp-trust { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.mp-trust div { display: flex; gap: 12px; }
.mp-trust .mp-icon { width: 30px; height: 30px; color: var(--mp-gold); }
.mp-cta { border-radius: var(--mp-radius-lg); padding: 36px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center;
  background: linear-gradient(120deg, var(--mp-navy), var(--mp-navy-3)); color: #fff; }
.mp-cta h2 { color: #fff; font-size: clamp(22px, 2.6vw, 30px); }
.mp-cta p { color: rgba(255, 255, 255, .8); }
.mp-cta.gold { background: linear-gradient(120deg, #2b2111, #6b4c18); }
@media (max-width: 800px) { .mp-cta { grid-template-columns: 1fr; padding: 26px; } }
.mp-alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.mp-alert.ok { background: var(--mp-ok-soft); color: var(--mp-ok); }
.mp-alert.warn { background: var(--mp-warn-soft); color: var(--mp-warn); }
.mp-alert.danger { background: var(--mp-danger-soft); color: var(--mp-danger); }
.mp-toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%) translateY(20px); background: var(--mp-navy);
  color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--mp-shadow-3); opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 120; font-weight: 600; max-width: calc(100% - 32px); }
html[dir="rtl"] .mp-toast { transform: translateX(50%) translateY(20px); }
.mp-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
html[dir="rtl"] .mp-toast.is-on { transform: translateX(50%) translateY(0); }
.mp-modal { position: fixed; inset: 0; background: rgba(6, 14, 28, .55); z-index: 90; display: none; align-items: center; justify-content: center; padding: 16px; }
.mp-modal.is-open { display: flex; }
.mp-modal-card { background: #fff; border-radius: var(--mp-radius-lg); width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 24px; box-shadow: var(--mp-shadow-3); }
.mp-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

/* ---------------------------------------------------------------- footer */
.mp-footer { background: var(--mp-navy); color: rgba(255, 255, 255, .75); padding-block: 56px 28px; margin-top: 0; }
.mp-footer a:hover { color: #fff; }
.mp-footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 28px; }
.mp-footer h4 { color: #fff; font-size: 14px; margin-bottom: 14px; letter-spacing: .04em; }
.mp-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.mp-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 38px; padding-top: 20px; display: flex;
  justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.mp-footer .mp-brand { color: #fff; }
@media (max-width: 900px) { .mp-footer-grid { grid-template-columns: 1fr 1fr; } .mp-footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------------------------------------------------------------- portal */
.mp-portal { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 68px); background: var(--mp-canvas); }
.mp-side { background: #fff; border-inline-end: 1px solid var(--mp-line); padding: 18px 12px; position: sticky; top: 68px; height: calc(100vh - 68px); overflow: auto; }
.mp-side a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--mp-ink-2); font-weight: 550; font-size: 14.5px; }
.mp-side a:hover { background: var(--mp-canvas); }
.mp-side a.is-on { background: var(--mp-teal-soft); color: var(--mp-teal); }
.mp-side h5 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--mp-muted); margin: 16px 12px 6px; }
.mp-side .count { margin-inline-start: auto; background: var(--mp-gold); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.mp-main { padding: 26px; min-width: 0; }
.mp-main h1 { font-size: 24px; margin-bottom: 4px; }
.mp-kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-block: 18px; }
.mp-kpi { background: #fff; border: 1px solid var(--mp-line); border-radius: var(--mp-radius); padding: 16px; }
.mp-kpi span { display: block; color: var(--mp-muted); font-size: 12.5px; font-weight: 650; }
.mp-kpi b { font-size: 26px; color: var(--mp-navy); font-variant-numeric: tabular-nums; }
.mp-kpi small { color: var(--mp-muted); }
.mp-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.mp-table th { text-align: start; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--mp-muted); padding: 12px 14px;
  border-bottom: 1px solid var(--mp-line); background: #fbfcfd; white-space: nowrap; }
.mp-table td { padding: 12px 14px; border-bottom: 1px solid var(--mp-line); vertical-align: middle; }
.mp-table tr:last-child td { border-bottom: 0; }
.mp-table .num { text-align: end; font-variant-numeric: tabular-nums; }
.mp-thumb { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--mp-canvas); }
.mp-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mp-spacer { flex: 1; }
.mp-formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.mp-formgrid .wide { grid-column: 1 / -1; }
.mp-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mp-photo { position: relative; border-radius: 10px; overflow: hidden; border: 2px solid transparent; aspect-ratio: 4 / 3; background: var(--mp-canvas); }
.mp-photo.is-cover { border-color: var(--mp-gold); }
.mp-photo img { width: 100%; height: 100%; object-fit: cover; }
.mp-photo .tools { position: absolute; inset-inline: 6px; bottom: 6px; display: flex; gap: 4px; justify-content: flex-end; }
.mp-photo .tools button { border: 0; border-radius: 7px; background: rgba(255, 255, 255, .92); padding: 4px 7px; font-size: 12px; cursor: pointer; }
.mp-drop { border: 2px dashed var(--mp-line-2); border-radius: 12px; padding: 22px; text-align: center; color: var(--mp-muted); cursor: pointer; }
.mp-drop.is-over { border-color: var(--mp-teal); background: var(--mp-teal-soft); }
.mp-bars { display: flex; gap: 4px; align-items: flex-end; height: 140px; padding-top: 10px; }
.mp-bars div { flex: 1; background: var(--mp-teal); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.mp-bars div:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; inset-inline-start: 50%; transform: translateX(-50%);
  background: var(--mp-navy); color: #fff; font-size: 11px; padding: 3px 6px; border-radius: 5px; white-space: nowrap; }
.mp-secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--mp-canvas); padding: 10px 12px; border-radius: 9px;
  word-break: break-all; font-size: 13px; }
@media (max-width: 900px) {
  .mp-portal { grid-template-columns: 1fr; }
  .mp-side { position: static; height: auto; display: flex; gap: 6px; overflow-x: auto; padding: 10px; border-inline-end: 0; border-bottom: 1px solid var(--mp-line); }
  .mp-side h5 { display: none; }
  .mp-side a { white-space: nowrap; }
  .mp-main { padding: 18px 14px; }
  .mp-table { display: block; overflow-x: auto; }
}

/* leaflet tweaks */
.leaflet-container { font-family: var(--mp-font); }
.mp-mapcard { width: 220px; }
.mp-mapcard img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .mp-header, .mp-footer, .mp-contact, .mp-mobilebar, .mp-tray { display: none !important; } }
