@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --top: 56px;
  --bg: #f4f2ec;
  --card: #ffffff;
  --ink: #1d2623;
  --muted: #68736f;
  --line: #e3e0d6;
  --brand: #0f5c4d;
  --brand-dark: #0a4539;
  --brand-soft: #e3f0ec;
  --accent: #e0672b;
  --accent-dark: #c4541e;
  --danger: #b3261e;
  --warn-bg: #fff4d9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 6px 20px rgba(20, 30, 25, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--bg);
  padding-bottom: 76px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.35rem; margin: 0 0 .5rem; line-height: 1.6; }
h2 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; }
h3 { font-size: 1rem; margin: 0; }
p { margin: 0 0 .7rem; }
img, video { max-width: 100%; display: block; }
.wrap { width: min(1120px, 100% - 24px); margin-inline: auto; }
.main { padding-block: 14px 28px; min-height: 60vh; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.narrow { max-width: 440px; margin-inline: auto; }
.inline { display: inline; }
.ltr { direction: ltr; text-align: left; }
.ltr-inline { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.warn { color: #8a5a00; }

/* ---------- header ---------- */
.top { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20; }
.top__in { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 800; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; fill: #ffd9a8; }
.top__nav { display: none; align-items: center; gap: 4px; }
.navlink { color: #dcebe6; padding: 6px 12px; border-radius: 8px; font: inherit; background: none; border: 0; cursor: pointer; position: relative; }
.navlink:hover, .navlink.is-active { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.dot { background: var(--accent); color: #fff; border-radius: 99px; font-size: .7rem; padding: 0 6px; margin-inline-start: 6px; font-weight: 700; display: inline-block; line-height: 1.6; }

/* ---------- mobile tab bar ---------- */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 7px 2px 5px; color: var(--muted); font-size: .7rem; position: relative; }
.tab:hover { text-decoration: none; }
.tab svg { width: 22px; height: 22px; fill: currentColor; }
.tab.is-active { color: var(--brand); font-weight: 700; }
.tab--main svg { background: var(--accent); fill: #fff; border-radius: 50%; padding: 5px; width: 34px; height: 34px; margin-top: -14px; box-shadow: 0 3px 8px rgba(224, 103, 43, .4); }
.tab--main { color: var(--accent-dark); font-weight: 700; }
.tab .dot { position: absolute; top: 3px; inset-inline-start: calc(50% + 4px); margin: 0; }

.foot { color: var(--muted); font-size: .85rem; padding: 18px 0 26px; }
.foot__in { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }

/* ---------- basics ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; border: 1px solid transparent; border-radius: 10px;
  padding: 8px 18px; font: inherit; font-weight: 600; cursor: pointer; line-height: 1.7; white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn--accent { background: var(--accent); }
.btn--accent:hover { background: var(--accent-dark); }
.btn--ghost { background: #fff; color: var(--brand); border-color: var(--line); }
.btn--ghost:hover { background: var(--brand-soft); }
.btn--danger { background: #fff; color: var(--danger); border-color: #efc7c4; }
.btn--danger:hover { background: #fdecea; }
.btn--sm { padding: 4px 12px; font-size: .85rem; }
.btn--lg { padding: 12px 24px; font-size: 1.05rem; }
.btn--block { display: flex; width: 100%; margin-top: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; }

.flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; border: 1px solid; }
.flash--ok { background: #e6f4ea; border-color: #b9dcc4; color: #1e5a31; }
.flash--error { background: #fdecea; border-color: #f2c1bd; color: #8c1d18; }
.flash--warn { background: var(--warn-bg); border-color: #f0d68a; color: #6b4a00; }

.field { display: block; margin-bottom: 14px; }
.field > span, legend { display: block; font-weight: 600; margin-bottom: 4px; font-size: .92rem; }
input[type=text], input[type=tel], input[type=search], select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff;
  border: 1px solid #cfcbbf; border-radius: 10px; padding: 9px 12px; min-height: 44px;
}
textarea { resize: vertical; line-height: 1.8; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, summary:focus-visible { outline: 3px solid rgba(15, 92, 77, .25); border-color: var(--brand); }
.big { font-size: 1.3rem; letter-spacing: 2px; text-align: center; }
.code { letter-spacing: 12px; }
.hint { display: block; color: var(--muted); font-size: .8rem; min-height: 1.2em; }
.error { display: block; color: var(--danger); font-size: .85rem; font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.row2, .row3 { display: grid; gap: 0 12px; }
.resend { display: flex; justify-content: space-between; margin-top: 14px; font-size: .9rem; }
.check { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; cursor: pointer; }
.check input { margin-top: 8px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.check--box { background: var(--brand-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }

.pills, .checks { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: block; padding: 5px 16px; border-radius: 99px; border: 1px solid #cfcbbf; background: #fff; font-weight: 600; font-size: .9rem; }
.pill input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.pill input:focus-visible + span { outline: 3px solid rgba(15, 92, 77, .3); }
.pills--big .pill { flex: 1; text-align: center; }
.pills--big .pill span { padding: 10px; border-radius: 10px; font-size: 1rem; }

/* ---------- home ---------- */
.hero { background: linear-gradient(135deg, var(--brand), #17806b); color: #fff; border-radius: var(--radius); padding: 22px 18px; margin-bottom: 14px; }
.hero h1 { font-size: 1.45rem; font-weight: 800; }
.hero p { color: #d6ebe5; max-width: 60ch; }
.hero__points { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero__points li { background: rgba(255, 255, 255, .14); border-radius: 99px; padding: 2px 14px; font-size: .85rem; }
.filters .pills { margin-bottom: 12px; }

.more { margin-top: 10px; }
.more summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.listhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 2px 10px; }
.listhead h1, .listhead h2 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lcard { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: inherit; display: flex; flex-direction: column; transition: transform .15s; }
.lcard:hover { text-decoration: none; transform: translateY(-2px); }
.lcard__img { position: relative; aspect-ratio: 4 / 3; background: #dedbd0; }
.lcard__img img { width: 100%; height: 100%; object-fit: cover; }
.lcard__body { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.lcard__body p { margin: 0; }
.lcard h3 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lcard__price { font-weight: 800; color: var(--brand); }
.lcard__meta { color: var(--muted); font-size: .85rem; }
.lcard__foot { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .78rem; margin-top: auto !important; padding-top: 6px; border-top: 1px solid var(--line); }
.badge { position: absolute; top: 10px; inset-inline-start: 10px; background: var(--brand); color: #fff; border-radius: 8px; padding: 0 10px; font-size: .78rem; font-weight: 700; }
.badge--rent { background: #2456a6; }
.badge--rahn { background: #7a3e9d; }
.badge--video { inset-inline-start: auto; inset-inline-end: 10px; background: rgba(0, 0, 0, .65); }
.badge--static { position: static; display: inline-block; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.empty { padding: 34px 16px; }

/* ---------- listing detail ---------- */
.detail { display: grid; gap: 0 16px; }
.detail__title { margin-top: 8px; }
.gallery { padding: 0; overflow: hidden; }
.gallery__stage { position: relative; background: #1b1f1e; aspect-ratio: 4 / 3; }
.gallery__stage img { width: 100%; height: 100%; object-fit: contain; }
.gallery__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .85); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.gallery__nav--prev { inset-inline-start: 10px; }
.gallery__nav--next { inset-inline-end: 10px; }
.gallery__count { position: absolute; bottom: 10px; inset-inline-start: 10px; background: rgba(0, 0, 0, .6); color: #fff; border-radius: 99px; padding: 0 12px; font-size: .8rem; }
.gallery__thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; }
.gallery__thumbs button { flex: none; width: 72px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.gallery__thumbs button.is-active { border-color: var(--accent); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery__empty { aspect-ratio: 4 / 3; display: grid; place-items: center; color: var(--muted); background: #dedbd0; }
.video { width: 100%; max-height: 70vh; border-radius: 10px; background: #000; }
.prices { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.prices div { background: var(--brand-soft); border-radius: 10px; padding: 8px 14px; flex: 1; min-width: 150px; }
.prices span { display: block; font-size: .8rem; color: var(--muted); }
.prices b { font-size: 1.1rem; color: var(--brand-dark); }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 0 0 12px; }
.specs div { border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; }
.specs dt { font-size: .78rem; color: var(--muted); }
.specs dd { margin: 0; font-weight: 700; }
.chips { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: #f0eee6; border-radius: 99px; padding: 0 12px; font-size: .85rem; }
.desc { white-space: normal; overflow-wrap: anywhere; }
.owner { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.owner small { display: block; font-size: .78rem; line-height: 1.6; }
.owner__avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; }
.tips h2, .contact h2 { margin-top: 0; }
.tips ul, .prose ul { padding-inline-start: 20px; margin: 0 0 8px; }
.tips li { font-size: .88rem; margin-bottom: 4px; }
.tips { background: var(--warn-bg); box-shadow: none; border: 1px solid #f0d68a; }
.report summary { cursor: pointer; color: var(--danger); font-size: .9rem; }
.report form { margin-top: 10px; }
.report { box-shadow: none; background: transparent; border: 1px dashed var(--line); }

/* ---------- forms: listing + media ---------- */
.form-card { max-width: 720px; margin-inline: auto; }
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 14px; font-size: .8rem; }
.steps li { flex: 1; text-align: center; padding: 4px; border-radius: 8px; background: #f0eee6; color: var(--muted); }
.steps .is-active { background: var(--brand); color: #fff; font-weight: 700; }
.steps .is-done { background: var(--brand-soft); color: var(--brand); }
[hidden] { display: none !important; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; border: 2px dashed #b9c9c4; border-radius: var(--radius); padding: 26px 16px; cursor: pointer; background: var(--brand-soft); color: var(--brand-dark); margin-bottom: 8px; }
.dropzone:hover, .dropzone.is-drag { border-color: var(--brand); background: #d5e9e3; }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone svg { width: 40px; height: 40px; fill: var(--brand); }
.dropzone b { font-size: 1.1rem; }
.dropzone span { font-size: .85rem; color: var(--muted); }
.queue { list-style: none; padding: 0; margin: 0 0 10px; }
.queue li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: .85rem; padding: 6px 0; border-bottom: 1px solid var(--line); }
.queue .bar { grid-column: 1 / -1; height: 6px; background: #e7e4da; border-radius: 99px; overflow: hidden; }
.queue .bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.queue .is-error { color: var(--danger); }
.queue .is-error .bar i { background: var(--danger); }
.queue .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 14px; }
.mitem { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #dedbd0; }
.mitem img, .mitem video { width: 100%; height: 100%; object-fit: cover; }
.mitem:first-child::after { content: "عکس اصلی"; position: absolute; bottom: 0; inset-inline: 0; background: rgba(15, 92, 77, .85); color: #fff; font-size: .72rem; text-align: center; }
.mitem__del { position: absolute; top: 6px; inset-inline-end: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions--end { justify-content: space-between; margin-top: 8px; }

/* ---------- my listings ---------- */
.myitem { display: grid; grid-template-columns: 96px 1fr; gap: 12px; }
.myitem__img { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #dedbd0; display: block; }
.myitem__img img { width: 100%; height: 100%; object-fit: cover; }
.myitem h2 { margin: 0; font-size: 1rem; }
.myitem p { margin: 0 0 6px; }
.status { border-radius: 6px; padding: 0 8px; font-size: .78rem; font-weight: 700; background: #eee; display: inline-block; }
.status--active { background: #e6f4ea; color: #1e5a31; }
.status--draft { background: var(--warn-bg); color: #6b4a00; }
.status--hidden { background: #fdecea; color: #8c1d18; }

/* ---------- chat ---------- */
.convs { display: grid; gap: 8px; }
.conv { display: flex; gap: 12px; align-items: center; color: inherit; margin: 0; padding: 12px 14px; }
.conv:hover { text-decoration: none; background: #fbfaf6; }
.conv p { margin: 0; }
.conv__body { flex: 1; min-width: 0; }
.conv__last { color: var(--muted); font-size: .88rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conv.is-unread { border-inline-start: 4px solid var(--accent); }
.conv.is-unread .conv__last { color: var(--ink); font-weight: 700; }
.conv__time { flex: none; font-size: .75rem; }
.chat { max-width: 760px; margin-inline: auto; padding: 0; display: flex; flex-direction: column; height: calc(100dvh - var(--top) - 76px - 30px); min-height: 380px; }
.chat__head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chat__who { flex: 1; min-width: 0; line-height: 1.5; }
.chat__who small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.back { font-size: 1.6rem; line-height: 1; padding: 0 4px; color: var(--muted); }
.back:hover { text-decoration: none; }
.chat__tip { background: var(--warn-bg); font-size: .78rem; padding: 4px 14px; color: #6b4a00; }
.chat__list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #f7f5ef; }
.msg { max-width: 82%; padding: 6px 12px 2px; border-radius: 14px; background: #fff; align-self: flex-end; box-shadow: 0 1px 1px rgba(0, 0, 0, .05); overflow-wrap: anywhere; }
.msg p { margin: 0; }
.msg time { display: block; font-size: .68rem; color: var(--muted); text-align: end; }
.msg--me { align-self: flex-start; background: #d9efe8; }
.msg--system { align-self: center; background: #fff4d9; font-size: .85rem; text-align: center; }
.chat__form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat__form textarea { flex: 1; max-height: 120px; }
.chat__closed { padding: 14px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; font-size: 1.4rem; padding: 0 10px; border-radius: 8px; }
.menu summary::-webkit-details-marker { display: none; }
.menu__box { position: absolute; inset-inline-end: 0; top: 100%; background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .18); padding: 6px; min-width: 240px; z-index: 5; }
.menu__item { display: block; width: 100%; text-align: start; background: none; border: 0; font: inherit; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.menu__item:hover { background: #f3f1ea; }
.menu__item--danger { color: var(--danger); }

/* ---------- admin / prose ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 4px; }
.stat { text-align: center; margin: 0 0 10px; }
.stat b { display: block; font-size: 1.5rem; color: var(--brand); }
.stat span { font-size: .82rem; color: var(--muted); }
.arow { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.arow p { margin: 0; }
.prose { max-width: 760px; margin-inline: auto; }
.prose li { margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.mitem .badge--video { top: auto; bottom: 6px; inset-inline-end: 6px; }

/* ---------- maps ---------- */
.map { width: 100%; height: 320px; border-radius: 12px; background: #dfe6e2; z-index: 0; font-family: inherit; }
.map--picker { height: 300px; cursor: crosshair; }
.map--detail { height: 300px; margin-bottom: 8px; }
.picker__bar { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; padding: 6px 2px 0; }
.picker__bar .is-set { color: var(--brand); font-weight: 700; }
.h2-first { margin-top: 0; }
.leaflet-container { font-family: "Vazirmatn", Tahoma, sans-serif; }
.leaflet-container a { color: var(--brand); }
.pin { background: var(--brand); color: #fff; border-radius: 99px; padding: 1px 10px; font-size: .78rem; font-weight: 700; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35); border: 2px solid #fff; display: inline-block; transform: translate(-50%, -50%); line-height: 1.7; }
.pin--rent { background: #2456a6; }
.pin--rahn { background: #7a3e9d; }
.pin.is-hover, .pin:hover { background: var(--accent); z-index: 999; }
.pin-wrap { background: none; border: 0; width: 0 !important; height: 0 !important; overflow: visible; }
.pick-wrap { background: none; border: 0; }
.pick-dot { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.pop { display: block; width: 210px; color: inherit; }
.pop:hover { text-decoration: none; }
.pop img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.pop b { display: block; line-height: 1.6; }
.pop span { display: block; font-size: .82rem; color: var(--muted); line-height: 1.7; }
.pop .pop__price { color: var(--brand); font-weight: 800; font-size: .92rem; }
.leaflet-popup-content { margin: 10px; direction: rtl; text-align: right; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.seg { display: inline-flex; border: 1px solid #cfcbbf; border-radius: 10px; overflow: hidden; }
.seg a { display: flex; align-items: center; gap: 6px; padding: 5px 16px; color: var(--ink); font-weight: 600; font-size: .9rem; }
.seg a:hover { text-decoration: none; background: var(--brand-soft); }
.seg a.is-active { background: var(--brand); color: #fff; }
.seg svg { width: 18px; height: 18px; fill: currentColor; }
.sort { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.sort select { min-height: 36px; padding: 3px 10px; width: auto; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; }
.more__actions { margin-top: 12px; }
.more summary .dot { margin-inline-start: 4px; }
.mapsearch { display: grid; gap: 14px; }
.mapsearch__map { position: relative; }
.mapsearch__map .map { height: 62vh; min-height: 340px; box-shadow: var(--shadow); }
.mapbtn { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 5; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.mapbtn svg { width: 16px; height: 16px; fill: currentColor; }
.mapsearch__status { font-weight: 700; margin: 0 2px 10px; }
.grid--map { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 12px; }
.lcard.is-hover { outline: 3px solid var(--accent); }
}
.leaflet-container { direction: ltr; }
.pin, .pop { direction: rtl; }

/* ---------- extras: favorites, saved searches, visits, converter ---------- */
.badge--drop { top: auto; bottom: 10px; background: #c62828; }
.badge--drop.badge--static { margin-inline-start: 6px; }
.savebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--brand-soft); border-radius: 12px; padding: 8px 14px; margin-bottom: 14px; font-size: .9rem; }
.savebar svg, .quick svg { width: 16px; height: 16px; fill: currentColor; }
.quick { display: flex; gap: 8px; margin-bottom: 10px; }
.quick form { display: contents; }
.quick .btn { flex: 1; }
.btn.is-on { background: var(--brand); color: #fff; border-color: var(--brand); }
.compare { border-radius: 10px; padding: 8px 14px; margin-bottom: 12px; border: 1px solid var(--line); }
.compare b { display: block; }
.compare span { font-size: .8rem; color: var(--muted); display: block; line-height: 1.7; }
.compare--low { background: #e6f4ea; border-color: #b9dcc4; } .compare--low b { color: #1e5a31; }
.compare--high { background: #fff4d9; border-color: #f0d68a; } .compare--high b { color: #6b4a00; }
.converter { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.converter input[type=range] { width: 100%; accent-color: var(--brand); margin: 8px 0 2px; direction: ltr; }
.converter__out { display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: space-between; }
.converter__out b { color: var(--brand-dark); }
.chipsbar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; font-weight: 400 !important; }
.chipsbar button { flex: none; border: 1px solid #cfcbbf; background: #fff; border-radius: 99px; padding: 1px 12px; font: inherit; font-size: .8rem; cursor: pointer; color: var(--brand-dark); }
.chipsbar button:hover { background: var(--brand-soft); }
.chat__tools { padding: 8px 10px 0; border-top: 1px solid var(--line); }
.visitform summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .85rem; }
.visitform form { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 0; }
.visitform select { width: auto; flex: 1; min-height: 36px; padding: 3px 8px; }
.chat__tools + .chat__form { border-top: 0; }
.visit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 14px; font-size: .88rem; background: #e8f0fb; color: #1b3f7a; }
.visit--accepted { background: #e6f4ea; color: #1e5a31; }
.visit__btns { display: flex; gap: 6px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; margin-bottom: 8px; }
.srow__main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.srow .linkbtn { text-align: start; }
.srow .dot { margin: 0; padding: 1px 10px; }
.lcard.is-gone { opacity: .55; }
.plinks { display: grid; margin-top: 16px; border-top: 1px solid var(--line); }
.plinks a { padding: 10px 2px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.toast { position: fixed; bottom: 90px; inset-inline: 0; margin-inline: auto; width: max-content; max-width: 90vw; background: #1d2623; color: #fff; padding: 6px 18px; border-radius: 99px; font-size: .88rem; z-index: 50; }
.setform { max-width: 520px; }


/* =====================================================================
   Responsive layout. Base rules above + this block = phone first.
   phone < 600 | large phone / small tablet 600+ | tablet 768+ | desktop 1024+
   ===================================================================== */
input[type=text], input[type=tel], input[type=search], select, textarea { font-size: 16px; } /* stops iOS zoom-on-focus */
.btn { min-height: 44px; }
.btn--sm { min-height: 36px; }
.foot { display: none; }
.main { padding-block: 10px 20px; }
.wrap { width: min(1120px, 100% - 20px); }
body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

/* ----- search + filter sheet ----- */
.filters { padding: 12px; }
.filters__top { display: flex; gap: 8px; margin-bottom: 10px; }
.filters__top input { flex: 1; min-width: 0; }
.filterbtn { flex: none; gap: 6px; padding-inline: 12px; }
.filterbtn svg { width: 18px; height: 18px; fill: currentColor; }
.filterbtn .dot { margin: 0; }
.searchbtn { display: none; }
.filters .pills { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 0; padding: 0 12px 2px; scrollbar-width: none; }
.filters .pills::-webkit-scrollbar, .chipsbar::-webkit-scrollbar { display: none; }
.filters .pill { flex: none; }
.sheet { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: none; flex-direction: column; }
.sheet.is-open { display: flex; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 1.05rem; }
.sheet__close { border: 0; background: #f0eee6; width: 40px; height: 40px; border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.sheet__body { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.sheet__foot { display: flex; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.sheet__foot .btn { flex: 1; }
.sheet__row { display: grid; gap: 0 12px; }
.sheet .more summary { display: none; }
.sheet .more { margin: 0; }
.sheet .more__actions { display: none; }
.sheet .checks .pill span { padding: 8px 16px; }
body.has-sheet { overflow: hidden; }
.toolbar { margin-top: 10px; padding-top: 10px; }
.seg a { padding: 7px 16px; }

/* ----- cards: compact horizontal rows on phones ----- */
.grid { grid-template-columns: 1fr; gap: 10px; }
.lcard { flex-direction: row; }
.lcard__img { flex: none; width: 124px; aspect-ratio: auto; min-height: 118px; }
.lcard__body { padding: 8px 12px; min-width: 0; }
.lcard h3 { font-size: .95rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.6; }
.lcard__price { font-size: .95rem; }
.lcard .badge { top: 6px; inset-inline-start: 6px; font-size: .7rem; padding: 0 8px; }
.lcard .badge--video { top: auto; bottom: 6px; inset-inline-start: 6px; inset-inline-end: auto; }
.lcard .badge--drop { bottom: 6px; inset-inline-start: auto; inset-inline-end: 6px; }
.lcard__foot { border-top: 0; padding-top: 0; }
.hero { padding: 16px; margin-bottom: 10px; }
.hero h1 { font-size: 1.2rem; margin-bottom: 2px; }
.hero p { font-size: .88rem; margin: 0; }
.hero__points { display: none; }
.savebar { font-size: .82rem; padding: 8px 10px; margin-bottom: 10px; }
.listhead { margin-bottom: 8px; }

/* ----- map search on phones: tall map, cards as a swipeable strip over it ----- */
.mapsearch { position: relative; display: block; }
.mapsearch__map .map { height: calc(100dvh - var(--top) - 64px - 190px - env(safe-area-inset-bottom)); min-height: 360px; border-radius: 12px; }
.mapsearch__list { position: absolute; inset-inline: 0; bottom: 10px; z-index: 6; pointer-events: none; }
.mapsearch__list > .small { display: none; }
.mapsearch__status { position: absolute; bottom: 100%; inset-inline: 0; margin: 0 auto 8px; width: max-content; max-width: 92%; background: rgba(29, 38, 35, .88); color: #fff; font-size: .78rem; font-weight: 600; padding: 2px 14px; border-radius: 99px; }
.grid--map { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 10px 2px; margin: 0; pointer-events: auto; scrollbar-width: none; }
.grid--map::-webkit-scrollbar { display: none; }
.grid--map .lcard { flex: 0 0 86%; scroll-snap-align: center; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); }
.grid--map .lcard__img { width: 104px; min-height: 100px; }
.grid--map:empty { display: none; }
.mapbtn { top: 10px; }

/* ----- listing page ----- */
.gallery { margin-inline: -10px; border-radius: 0; }
.gallery__nav { width: 44px; height: 44px; }
.gallery__thumbs button { width: 64px; height: 48px; }
.detail__title { font-size: 1.2rem; }
.prices div { min-width: 130px; }
.specs { grid-template-columns: repeat(2, 1fr); }
.map--detail { height: 240px; }
.quick .btn { min-height: 40px; }
.ctabar { position: fixed; inset-inline: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fff; border-top: 1px solid var(--line); padding: 8px 12px; box-shadow: 0 -4px 14px rgba(0, 0, 0, .06); }
.ctabar b { color: var(--brand-dark); font-size: .92rem; line-height: 1.5; }
.ctabar small { display: block; color: var(--muted); font-size: .72rem; font-weight: 400; }
.ctabar .btn { flex: none; }
.has-cta .main { padding-bottom: 80px; }

/* ----- forms ----- */
.form-card { padding: 14px; }
.pills--big .pill span { padding: 12px 6px; }
.checks .pill span { padding: 7px 14px; }
.map--picker { height: 280px; }
.mgrid { grid-template-columns: repeat(3, 1fr); }
.mitem__del { width: 34px; height: 34px; }
.actions--end .btn { flex: 1; }
.actions--end form { flex: 1; display: flex; }
.myitem { grid-template-columns: 84px 1fr; }

/* ----- chat fills the phone screen ----- */
.page-chat .tabbar { display: none; }
.page-chat { padding-bottom: 0; }
.page-chat .main { padding: 0; width: 100%; }
.page-chat .chat { height: calc(100dvh - var(--top)); border-radius: 0; margin: 0; box-shadow: none; min-height: 0; }
.page-chat .chat__form { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.msg { max-width: 86%; }
.menu__box { min-width: 260px; }
.menu__item { padding: 12px; }

/* ----- map view is one fixed screen: filters on top, map fills the rest ----- */
.page-map .main { display: flex; flex-direction: column; height: calc(100dvh - var(--top) - 64px - env(safe-area-inset-bottom)); min-height: 430px; padding-block: 8px 0; }
.page-map .filters { flex: none; margin-bottom: 8px; padding: 10px 12px; }
.page-map .flash, .page-map .savebar { flex: none; }
.page-map .savebar, .page-map .sort { display: none; }
.page-map .toolbar { margin-top: 8px; padding-top: 8px; }
.page-map .mapsearch { flex: 1; min-height: 0; }
.page-map .mapsearch__map { height: 100%; }
.page-map .mapsearch__map .map { height: 100%; min-height: 0; border-radius: 12px 12px 0 0; }
.sort span { display: none; }
.sort select { max-width: 150px; }
.grid--map .lcard { height: 100px; }
.grid--map .lcard h3 { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid--map .lcard p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid--map .lcard__foot span:last-child { display: none; }

/* ===== 600+ : large phones in landscape, small tablets ===== */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .lcard { flex-direction: column; }
  .lcard__img { width: auto; aspect-ratio: 4 / 3; min-height: 0; }
  .lcard__body { padding: 10px 14px 12px; }
  .lcard h3 { font-size: 1rem; white-space: nowrap; display: block; }
  .lcard__foot { border-top: 1px solid var(--line); padding-top: 6px; }
  .lcard .badge { top: 10px; inset-inline-start: 10px; font-size: .78rem; }
  .lcard .badge--video { top: 10px; bottom: auto; inset-inline-start: auto; inset-inline-end: 10px; }
  .lcard .badge--drop { top: auto; bottom: 10px; inset-inline-start: 10px; inset-inline-end: auto; }
  .row2, .sheet__row { grid-template-columns: 1fr 1fr; }
  .row3 { grid-template-columns: 1fr 1fr 1fr; }
  .sort span { display: inline; }
  .hero { padding: 24px; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 1rem; }
  .hero__points { display: flex; }
  .card { padding: 20px; }
  .filters { padding: 16px; }
  .gallery, .chat { padding: 0; }
  .gallery { margin-inline: 0; border-radius: var(--radius); }
  .specs { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .mgrid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .actions--end .btn, .actions--end form { flex: none; }
  .wrap { width: min(1120px, 100% - 32px); }
  .gallery__thumbs button { width: 80px; height: 60px; }
}

/* ===== 768+ : tablets (iPad portrait and up). Filters inline, two-column pages ===== */
@media (min-width: 768px) {
  .filterbtn { display: none; }
  .searchbtn { display: inline-flex; }
  /* one compact filter bar: deal pills, then search + city + type + button in a single row */
  .filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
  .filters__top, .sheet, .sheet__body, .sheet__row { display: contents; }
  .sheet__head, .sheet__foot { display: none; }
  .filters .pills { order: -1; flex: 1 1 100%; flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .filters__top input { order: 0; flex: 2 1 220px; }
  .sheet__row .field { order: 1; flex: 1 1 150px; margin: 0; }
  .sheet__row .field > span { display: none; }
  .searchbtn { order: 2; }
  .sheet .more { order: 3; flex: 1 1 200px; margin: 0; }
  .sheet .more summary { display: list-item; margin-bottom: 0; }
  .sheet .more[open] { flex-basis: 100%; }
  .sheet .more[open] summary { margin-bottom: 10px; }
  .sheet .more__actions { display: flex; }
  .sheet .field { margin-bottom: 10px; }
  .toolbar { order: 4; flex: none; margin: 0; padding: 0; border: 0; margin-inline-start: auto; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .detail { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .detail__side { position: sticky; top: 70px; }
  .ctabar { display: none; }
  .has-cta .main { padding-bottom: 20px; }
  .map--picker { height: 380px; }
  .map--detail { height: 320px; }
  /* map search: map and list side by side */
  .mapsearch { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
  .mapsearch__map { position: sticky; top: 66px; }
  .mapsearch__list { position: static; pointer-events: auto; }
  .mapsearch__list > .small { display: block; }
  .mapsearch__status { position: static; width: auto; max-width: none; background: none; color: inherit; font-size: 1rem; font-weight: 700; padding: 0; margin: 0 2px 10px; border-radius: 0; }
  .grid--map { display: grid; grid-template-columns: 1fr; overflow: visible; padding: 0; margin-bottom: 12px; gap: 10px; }
  .grid--map .lcard { flex-direction: row; box-shadow: var(--shadow); }
  .grid--map .lcard__img { width: 130px; aspect-ratio: auto; min-height: 110px; flex: none; }
  .grid--map .lcard h3 { white-space: normal; }
  .grid--map .lcard__foot { border-top: 0; }
  .page-map .savebar { display: flex; margin-bottom: 8px; padding-block: 4px; }
  .page-map .toolbar { margin: 0; padding: 0; }
  .page-map .sort { display: flex; }
  .page-map .mapsearch { display: grid; }
  .page-map .mapsearch__map { position: static; }
  .page-map .mapsearch__map .map { border-radius: 12px; }
  .page-map .mapsearch__list { height: 100%; overflow-y: auto; padding: 2px 2px 12px; -webkit-overflow-scrolling: touch; }
  .page-map .main { padding-bottom: 8px; }
  .grid--map .lcard { height: auto; }
  .grid--map .lcard p { white-space: normal; }
  .grid--map .lcard__foot span:last-child { display: inline; }
  /* chat as a centred panel again */
  .page-chat .tabbar { display: grid; }
  .page-chat { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .page-chat .main { padding-block: 14px; width: min(1120px, 100% - 32px); }
  .page-chat .chat { height: calc(100dvh - var(--top) - 64px - 30px); border-radius: var(--radius); margin-inline: auto; box-shadow: var(--shadow); }
  .tabbar { padding-inline: max(0px, calc(50% - 300px)); }
  .tab { font-size: .78rem; padding-block: 9px 7px; }
}

/* ===== 1024+ : desktop and iPad landscape. Top navigation replaces the tab bar ===== */
@media (min-width: 1024px) {
  body, .page-chat { padding-bottom: 0; font-size: 15.5px; }
  .tabbar, .page-chat .tabbar { display: none; }
  .top__nav { display: flex; }
  .foot { display: block; }
  .main { padding-block: 14px 28px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .detail { grid-template-columns: minmax(0, 1fr) 340px; }
  .filters__all { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .page-chat .chat { height: calc(100dvh - 100px); }
  .page-map .main { height: calc(100dvh - var(--top)); }
  .page-map .foot { display: none; }
  .mapsearch { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .grid--map { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .grid--map .lcard { flex-direction: column; }
  .grid--map .lcard__img { width: auto; aspect-ratio: 4 / 3; min-height: 0; }
  .btn { min-height: 0; }
  .btn--sm { min-height: 0; }
}
/* phones in landscape: keep the map usable */
@media (max-width: 767px) and (orientation: landscape) {
  .page-map .main { height: auto; }
  .page-map .mapsearch__map .map { height: 82dvh; }
  .page-chat .chat { height: 100dvh; }
}

/* ---------- demo mode ---------- */
.is-demo { --top: 86px; }
.demobar { background: #1d2623; color: #f4e7c8; text-align: center; font-size: .76rem; padding: 0 10px; height: 30px; line-height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demobar a { color: #ffd9a8; font-weight: 700; margin-inline-start: 8px; text-decoration: underline; }
.demo-roles .btn { flex-direction: column; gap: 0; white-space: normal; padding-block: 12px; }
.demo-roles .btn small { font-weight: 400; font-size: .78rem; opacity: .9; }
