/* عقار بلس — iOS-inspired design system (RTL first, light & dark). */
:root {
  --bg: #f2f2f7;
  --bg-elev: #ffffff;
  --bg-grouped: #ffffff;
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .2);
  --label: #000000;
  --label-2: rgba(60, 60, 67, .62);
  --label-3: rgba(60, 60, 67, .36);
  --sep: rgba(60, 60, 67, .18);
  --tint: #0a6cff;
  --tint-soft: rgba(10, 108, 255, .12);
  --green: #1f9d4c;
  --green-soft: rgba(52, 199, 89, .16);
  --orange: #c26a00;
  --orange-soft: rgba(255, 149, 0, .16);
  --red: #e5281f;
  --red-soft: rgba(255, 59, 48, .12);
  --bar: rgba(249, 249, 249, .82);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .06);
  --radius: 14px;
  --radius-lg: 20px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 52px;
  --tab-h: 58px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --bg-elev: #1c1c1e; --bg-grouped: #1c1c1e;
    --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .36);
    --label: #ffffff; --label-2: rgba(235, 235, 245, .62); --label-3: rgba(235, 235, 245, .32);
    --sep: rgba(84, 84, 88, .55);
    --tint: #3b93ff; --tint-soft: rgba(59, 147, 255, .2);
    --green: #32d74b; --green-soft: rgba(50, 215, 75, .18);
    --orange: #ff9f0a; --orange-soft: rgba(255, 159, 10, .18);
    --red: #ff453a; --red-soft: rgba(255, 69, 58, .18);
    --bar: rgba(22, 22, 24, .82);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--label);
  font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  padding-top: calc(var(--nav-h) + var(--safe-t));
}
body.has-tabs { padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
body.locked { overflow: hidden; }
a { color: var(--tint); text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 12px; top: 12px; z-index: 100; background: var(--bg-elev); padding: 8px 12px; border-radius: 10px; }
[hidden] { display: none !important; }
.ic { width: 22px; height: 22px; flex-shrink: 0; }
.muted { color: var(--label-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

/* ------------------------------------------------------------ navigation bar */
.navbar {
  position: fixed; inset-inline: 0; top: 0; z-index: 30; height: calc(var(--nav-h) + var(--safe-t)); padding-top: var(--safe-t);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-inline: 8px;
  background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--sep);
}
.navbar:empty { display: none; }
body:has(.navbar:empty) { padding-top: var(--safe-t); }
.nav-title { margin: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; text-align: center; }
.nav-side { display: flex; align-items: center; gap: 4px; }
.nav-side.end { justify-content: flex-end; }
.nav-btn { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--tint); font-size: 17px; border-radius: 10px; }
.nav-btn .ic { width: 24px; height: 24px; }
.navbar.large .nav-title { opacity: 0; }
.large-title { font-size: 32px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 12px; }

/* ------------------------------------------------------------ tab bar */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep);
}
.tab { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--label-3); font-size: 10.5px; font-weight: 500; }
.tab.active { color: var(--tint); }
.tab-ic { position: relative; display: grid; place-items: center; }
.tab-ic .ic { width: 26px; height: 26px; }
.tab-add .tab-ic { width: 40px; height: 30px; border-radius: 10px; background: var(--tint); color: #fff; }
.tab-add .tab-ic .ic { width: 22px; height: 22px; stroke-width: 2.4; }
.tab-add.active .tab-ic { box-shadow: 0 0 0 3px var(--tint-soft); }
.badge { position: absolute; top: -4px; inset-inline-start: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.badge.inline { position: static; }

/* ------------------------------------------------------------ layout */
.view { display: block; outline: none; }
.page { max-width: 1080px; margin: 0 auto; padding: 12px 16px 28px; }
.page.narrow { max-width: 560px; }
.section-title { font-size: 13px; font-weight: 500; color: var(--label-2); margin: 22px 4px 8px; text-transform: none; }
.list-head { display: flex; justify-content: space-between; color: var(--label-2); font-size: 13px; margin: 8px 4px; min-height: 20px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.list { display: grid; gap: 12px; }
.block { padding: 4px 4px 0; }
.title { font-size: 22px; font-weight: 700; margin: 4px 0; letter-spacing: -.01em; }

/* ------------------------------------------------------------ cards */
.card { position: relative; background: var(--bg-elev); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.card-link { display: block; color: inherit; }
.prop-card .ph { position: relative; aspect-ratio: 4 / 3; background: var(--fill); }
.prop-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.ph-top { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; gap: 6px; }
.card-body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.price { font-size: 19px; font-weight: 700; color: var(--label); letter-spacing: -.01em; }
.price.lg { font-size: 28px; }
.card-title { font-weight: 600; }
.meta-row { display: flex; flex-wrap: wrap; gap: 12px; color: var(--label-2); font-size: 13.5px; }
.meta-row span { display: inline-flex; align-items: center; gap: 4px; }
.meta-row .ic, .publisher .ic { width: 16px; height: 16px; }
.publisher { display: flex; align-items: center; gap: 6px; color: var(--label-2); font-size: 13px; margin-top: 4px; }
.publisher span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verified { color: var(--tint); }
.fav { position: absolute; top: 10px; inset-inline-end: 10px; width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, .88); color: #3c3c43; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .15s; }
.fav:active { transform: scale(.9); }
.fav.on { color: #ff2d55; }
.fav.on .ic { fill: currentColor; }

.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 600; width: fit-content; }
.chip.sale { background: var(--tint-soft); color: var(--tint); }
.chip.rent { background: var(--green-soft); color: var(--green); }
.chip.sold { background: var(--red-soft); color: var(--red); }
.chip.paused { background: var(--orange-soft); color: var(--orange); }
.ph-top .chip { background: rgba(255, 255, 255, .92); }
@media (prefers-color-scheme: dark) { .ph-top .chip { background: rgba(28, 28, 30, .9); } .fav { background: rgba(28, 28, 30, .85); color: #fff; } }

.skeleton .ph { aspect-ratio: 4 / 3; background: var(--fill); }
.sk-line { height: 14px; margin: 12px 14px; border-radius: 7px; background: var(--fill); }
.sk-line.w60 { width: 60%; } .sk-line.w40 { width: 40%; margin-bottom: 16px; }
.skeleton > * { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* ------------------------------------------------------------ grouped lists (Settings style) */
.group { background: var(--bg-grouped); border-radius: var(--radius); overflow: hidden; margin: 12px 0; }
.row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; width: 100%; border: 0; background: none; text-align: start; color: var(--label); font-size: 16px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; inset-inline-start: 16px; inset-inline-end: 0; border-top: .5px solid var(--sep); }
.row > span:first-child:not(.grow):not(.row-ic):not(.avatar) { color: var(--label-2); flex: 1; }
.row b { font-weight: 500; }
.row small { display: block; color: var(--label-2); font-size: 13px; font-weight: 400; }
.row.link:active { background: var(--fill); }
.row.danger, .row.danger .row-ic { color: var(--red); }
.row-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--tint-soft); color: var(--tint); display: grid; place-items: center; }
.row-ic .ic { width: 18px; height: 18px; }
.chev { color: var(--label-3); width: 18px; height: 18px; }
.info-list .row { align-items: flex-start; }

.avatar { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; background: var(--fill); color: var(--label-2); display: grid; place-items: center; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xl { width: 84px; height: 84px; border-radius: 24px; }
.avatar.xl .ic { width: 38px; height: 38px; }

.profile-head { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 16px 0 6px; }
.profile-head h2 { margin: 6px 0 0; font-size: 22px; display: inline-flex; gap: 6px; align-items: center; }
.profile-head p { margin: 0; }
.stats { display: flex; gap: 28px; margin: 10px 0; }
.stats div, .stats-row div { display: grid; text-align: center; }
.stats b, .stats-row b { font-size: 20px; }
.stats small, .stats-row small { color: var(--label-2); font-size: 12px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg-elev); border-radius: var(--radius); padding: 14px 0; margin-bottom: 14px; }

/* ------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 0; font-weight: 600; font-size: 16px; white-space: nowrap; transition: opacity .15s, transform .1s; text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.98); opacity: .85; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--tint); color: #fff; }
.btn.tinted { background: var(--tint-soft); color: var(--tint); }
.btn.ghost { background: transparent; color: var(--tint); }
.btn.danger { background: var(--red); color: #fff; }
.danger-text { color: var(--red) !important; }
.btn.block { width: 100%; }
.btn.lg { min-height: 52px; font-size: 17px; border-radius: 14px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn .ic { width: 20px; height: 20px; }
.stack-btns { display: grid; gap: 8px; margin-top: 14px; }
.row-btns { grid-auto-flow: column; justify-content: start; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--label-2); display: grid; place-items: center; position: relative; }
.icon-btn .dot { position: absolute; top: 8px; inset-inline-end: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--tint); }
.linklike { border: 0; background: none; padding: 0; color: var(--tint); font: inherit; }

/* ------------------------------------------------------------ search, segmented, chips */
.searchbar { display: flex; align-items: center; gap: 6px; height: 44px; padding-inline: 12px 4px; background: var(--fill); border-radius: 12px; color: var(--label-2); margin-bottom: 12px; }
.searchbar input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; color: var(--label); }
.searchbar input::-webkit-search-cancel-button { display: none; }
.segmented { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; margin-bottom: 12px; }
.seg { flex: 1; min-height: 34px; border: 0; background: none; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--label); }
.seg.on { background: var(--bg-elev); box-shadow: 0 1px 4px rgba(0, 0, 0, .14); font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg.on { background: #636366; } }
.chips-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin: 0 -16px; padding-inline: 16px; }
.chips-row::-webkit-scrollbar { display: none; }
.chip-btn { flex-shrink: 0; min-height: 34px; padding: 0 14px; border-radius: 17px; border: 0; background: var(--bg-elev); color: var(--label); font-size: 14px; box-shadow: var(--shadow); }
.chip-btn.on { background: var(--label); color: var(--bg); }

/* ------------------------------------------------------------ forms */
.form { display: grid; gap: 12px; }
.card-group { background: var(--bg-grouped); border-radius: var(--radius); overflow: hidden; }
.field { display: grid; gap: 2px; padding: 10px 16px; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; inset-inline-start: 16px; inset-inline-end: 0; border-top: .5px solid var(--sep); }
.field > span { font-size: 13px; color: var(--label-2); }
.field input, .field select, .field textarea { width: 100%; border: 0; background: none; outline: none; padding: 4px 0; font-size: 17px; color: var(--label); min-height: 32px; }
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--label-3) 50%), linear-gradient(135deg, var(--label-3) 50%, transparent 50%); background-position: left 6px center, left 0 center; background-size: 6px 6px; background-repeat: no-repeat; }
.field textarea { resize: vertical; min-height: 84px; }
.field input:disabled { color: var(--label-2); }
.field input[aria-invalid="true"] { color: var(--red); }
.input-wrap { display: flex; align-items: center; }
.input-btn { border: 0; background: none; color: var(--label-3); width: 40px; height: 36px; display: grid; place-items: center; }
.err { color: var(--red); font-size: 13px; font-style: normal; }
.hint { color: var(--label-2); font-size: 12.5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--label-2); padding: 0 4px; }
.check input { width: 22px; height: 22px; accent-color: var(--tint); flex-shrink: 0; margin: 0; }
.otp { letter-spacing: .5em; font-size: 22px !important; text-align: center; }
.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--fill-2); position: relative; transition: background .2s; flex-shrink: 0; cursor: pointer; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; inset-inline-end: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: inset-inline-end .2s; }
.switch:checked { background: #34c759; }
.switch:checked::after { inset-inline-end: 22px; }
.toggle-row { display: flex; align-items: center; gap: 12px; background: var(--bg-grouped); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.toggle-row span { flex: 1; }
.toggle-row small { display: block; color: var(--label-2); font-size: 13px; }

.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 10px 0; }
.notice.info { background: var(--tint-soft); color: var(--label); }
.notice.warn { background: var(--orange-soft); color: var(--label); }

/* ------------------------------------------------------------ auth & welcome */
.auth-head { text-align: center; padding: 18px 0 10px; }
.auth-head h2 { margin: 8px 0 4px; font-size: 26px; letter-spacing: -.01em; }
.auth-head p { margin: 0; }
.auth-ic { width: 56px; height: 56px; padding: 12px; border-radius: 18px; background: var(--tint-soft); color: var(--tint); }
.auth-ic.danger { background: var(--red-soft); color: var(--red); }
.welcome { min-height: 100dvh; max-width: 520px; margin: 0 auto; padding: calc(28px + var(--safe-t)) 20px calc(20px + var(--safe-b)); display: flex; flex-direction: column; }
.welcome-hero { text-align: center; padding: 8vh 0 32px; }
.welcome-hero h1 { font-size: 34px; margin: 18px 0 8px; letter-spacing: -.02em; }
.welcome-hero p { color: var(--label-2); margin: 0 auto; max-width: 380px; }
.app-mark { width: 88px; height: 88px; margin: 0 auto; border-radius: 24px; background: linear-gradient(135deg, #0a84ff, #0060df); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 30px rgba(10, 108, 255, .3); }
.app-mark .ic { width: 46px; height: 46px; stroke-width: 2; }
.welcome-actions { display: grid; gap: 12px; }
.choice { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--bg-elev); border-radius: var(--radius-lg); box-shadow: var(--shadow); color: var(--label); }
.choice-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--tint-soft); color: var(--tint); display: grid; place-items: center; flex-shrink: 0; }
.choice-ic.alt { background: var(--green-soft); color: var(--green); }
.choice-txt { flex: 1; display: grid; }
.choice-txt small { color: var(--label-2); font-size: 13.5px; }
.choice-chev { color: var(--label-3); }
.welcome-login { text-align: center; color: var(--label-2); margin: 8px 0 0; }
.legal-links { margin-top: auto; padding-top: 28px; text-align: center; font-size: 13px; color: var(--label-3); }
.legal-links a { color: var(--label-2); }

/* ------------------------------------------------------------ details */
.details { padding-top: 0; }
.gallery { position: relative; margin: 0 -16px 14px; background: var(--fill); }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 3; max-height: 62vh; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.dots { position: absolute; bottom: 10px; inset-inline: 0; display: flex; justify-content: center; gap: 6px; }
.dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .5); }
.dots span.on { background: #fff; }
.details .muted { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 14px; }
.details .muted .ic { width: 16px; height: 16px; }
.cta-bar { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 8px); display: flex; gap: 10px; padding: 10px; margin-top: 18px; background: var(--bar); border-radius: 18px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--shadow); }
.cta-bar .btn { min-height: 50px; }
@media (min-width: 900px) { .gallery { margin: 0 0 14px; border-radius: var(--radius-lg); overflow: hidden; } .details { max-width: 820px; } }

/* ------------------------------------------------------------ wizard */
.wizard { display: flex; flex-direction: column; min-height: calc(100dvh - var(--nav-h) - var(--tab-h) - 40px); }
.progress { height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--tint); border-radius: 2px; transition: width .3s; }
.step-count { color: var(--label-2); font-size: 13px; margin: 8px 0 0; }
.step-title { font-size: 26px; margin: 6px 0 14px; letter-spacing: -.01em; }
.options { display: grid; gap: 10px; }
.options.grid2 { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.option { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 54px; padding: 12px 16px; border: 1.5px solid transparent; border-radius: 14px; background: var(--bg-elev); text-align: start; box-shadow: var(--shadow); }
.option span { display: grid; }
.option small { color: var(--label-2); font-size: 13px; }
.option.on { border-color: var(--tint); background: var(--tint-soft); }
.opt-check { color: var(--tint); }
.wizard-nav { margin-top: auto; padding-top: 20px; display: flex; justify-content: space-between; gap: 10px; }
.wizard-nav .btn { min-width: 120px; }
.summary-card { background: var(--bg-elev); border-radius: var(--radius-lg); padding: 16px; }
.summary-card p { margin: 4px 0 0; }

/* ------------------------------------------------------------ chat */
.chat-row .chat-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-row time { color: var(--label-3); font-size: 12px; flex-shrink: 0; }
.chat-row .chat-ctx { color: var(--tint) !important; font-size: 12.5px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .chat-last { display: block; color: var(--label-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.unread b, .chat-row.unread .chat-last { color: var(--label); font-weight: 600; }
.chat-room { display: flex; flex-direction: column; height: calc(100dvh - var(--nav-h) - var(--safe-t)); max-width: 760px; margin: 0 auto; }
.chat-ctx-bar { padding: 8px 12px 0; }
.chat-ctx-bar:empty { display: none; }
.chat-card { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--bg-elev); border-radius: 14px; color: var(--label); }
.chat-card small { display: block; color: var(--label-2); font-size: 12.5px; }
.chat-card b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb { width: 42px; height: 42px; border-radius: 10px; overflow: hidden; background: var(--fill); display: grid; place-items: center; color: var(--label-2); flex-shrink: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.lg { width: 92px; height: 80px; border-radius: 14px; }
.messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.msg { max-width: 78%; align-self: flex-end; background: var(--bg-elev); padding: 8px 12px 6px; border-radius: 18px; border-end-end-radius: 6px; box-shadow: var(--shadow); }
.msg.mine { align-self: flex-start; background: var(--tint); color: #fff; border-end-end-radius: 18px; border-end-start-radius: 6px; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { display: flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: 11px; opacity: .7; margin-top: 2px; }
.msg-meta .ic { width: 15px; height: 15px; }
.msg-meta .read { opacity: 1; }
.msg.pending { opacity: .6; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px calc(8px + var(--safe-b)); background: var(--bar); border-top: .5px solid var(--sep); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.composer textarea { flex: 1; resize: none; min-height: 38px; max-height: 140px; padding: 8px 14px; border-radius: 19px; border: .5px solid var(--sep); background: var(--bg-elev); outline: none; font-size: 16px; line-height: 1.35; }
.send { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--tint); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.send:disabled { opacity: .5; }
.send .ic { width: 20px; height: 20px; transform: scaleX(-1); }
.chat-closed { margin: 8px 12px calc(8px + var(--safe-b)); }

/* ------------------------------------------------------------ owner */
.own-card { padding: 12px; }
.own-main { display: flex; gap: 12px; color: var(--label); }
.own-main .grow { display: grid; gap: 2px; align-content: start; }
.own-main small { color: var(--label-2); font-size: 13px; }
.own-main .price { font-size: 17px; }
.own-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.req-card { padding: 14px; display: grid; gap: 4px; }
.req-card.ignored { opacity: .6; }
.req-top { display: flex; align-items: center; gap: 8px; }
.req-top b { flex: 1; }
.req-sum { margin: 0; font-weight: 500; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--fill); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.add { display: grid; place-items: center; align-content: center; gap: 4px; color: var(--tint); background: var(--tint-soft); cursor: pointer; border: 1.5px dashed var(--tint); }
.photo.add small { font-size: 12px; }
.photo-btn { position: absolute; top: 6px; inset-inline-end: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; }
.photo-btn .ic { width: 16px; height: 16px; }
.photo-btn.star { inset-inline-end: auto; inset-inline-start: 6px; font-size: 14px; }
.cover { position: absolute; bottom: 6px; inset-inline-start: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 8px; }
.avatar-edit { display: grid; justify-items: center; gap: 10px; padding: 8px 0; }
.avatar-edit label { cursor: pointer; }

/* ------------------------------------------------------------ states */
.state { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 56px 24px; color: var(--label-2); }
.state h3 { margin: 4px 0 0; color: var(--label); font-size: 19px; }
.state p { margin: 0; max-width: 340px; }
.state-ic { width: 52px; height: 52px; color: var(--label-3); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--fill-2); border-top-color: var(--tint); animation: spin .8s linear infinite; display: inline-block; }
.spinner.sm { width: 18px; height: 18px; border-width: 2.5px; border-color: rgba(255, 255, 255, .4); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ sheet, scrim, toast, offline */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .35); opacity: 0; transition: opacity .2s; }
.scrim.on { opacity: 1; }
.sheet { position: fixed; z-index: 41; inset-inline: 0; bottom: 0; max-height: 88dvh; display: flex; flex-direction: column; background: var(--bg); border-radius: 16px 16px 0 0; transform: translateY(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); padding-bottom: var(--safe-b); }
.sheet.on { transform: none; }
@media (min-width: 700px) { .sheet { inset-inline: 50% auto; width: 480px; margin-inline-start: -240px; bottom: auto; top: 50%; border-radius: 18px; transform: translateY(-40%) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; } .sheet.on { transform: translateY(-50%); opacity: 1; } }
.sheet-grab { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 4px 16px; }
.sheet-head h2 { margin: 0; font-size: 17px; }
.sheet-body { overflow-y: auto; padding: 8px 16px 20px; }
.dialog-msg { margin: 4px 0 8px; color: var(--label-2); }
.toast { position: fixed; z-index: 60; inset-inline: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); margin: 0 auto; max-width: 420px; padding: 12px 16px; border-radius: 14px; background: rgba(30, 30, 32, .94); color: #fff; font-size: 14.5px; text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: none; }
.toast.bad { background: #c9241b; }
.toast.ok { background: #1a7f3c; }
.offline { position: fixed; z-index: 50; top: calc(var(--nav-h) + var(--safe-t)); inset-inline: 0; background: var(--orange); color: #fff; text-align: center; font-size: 13px; padding: 6px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 700px) { .page { padding-inline: 24px; } .chips-row { margin: 0; padding-inline: 0; } }

/* ------------------------------------------------------------ v7: verification, deletion, safety */
.role-help { color: var(--label-2); font-size: 14px; margin: -4px 4px 12px; }
.check-strong { background: var(--bg-grouped); border-radius: var(--radius); padding: 14px 16px; color: var(--label); font-size: 15px; }
.check-strong input { width: 24px; height: 24px; }
.radio-opt input { width: 22px; height: 22px; accent-color: var(--red); margin: 0; flex-shrink: 0; }
a.notice { display: block; color: var(--label); }
.btn.sm.danger-text { color: var(--red); }

/* primary action of long forms stays visible at the bottom of the screen while scrolling */
.sticky-actions { position: sticky; bottom: 0; z-index: 5; margin: 0 -16px; padding: 10px 16px calc(10px + var(--safe-b)); background: var(--bar); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: .5px solid var(--sep); }
body.has-tabs .sticky-actions { bottom: calc(var(--tab-h) + var(--safe-b)); padding-bottom: 10px; }

/* listing without photos */
.ph-empty { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--label-3); background: linear-gradient(135deg, var(--fill), var(--fill-2)); }
.ph-empty .ic { width: 40px; height: 40px; }
.ph-empty small { font-size: 12.5px; }
.thumb .ph-empty .ic { width: 26px; height: 26px; }
.thumb .ph-empty small { display: none; }
.gallery-track > .ph-empty { flex: 0 0 100%; }

/* account-type selection (login / register): the selected type decides the interface */
.role-pick { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.role-pick legend { font-size: 13px; font-weight: 600; color: var(--label-2); margin: 0 4px 8px; padding: 0; }
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card { display: grid; justify-items: center; gap: 4px; padding: 14px 10px; border-radius: 14px; border: 2px solid var(--sep); background: var(--bg-elev); color: var(--label); font: inherit; text-align: center; cursor: pointer; min-height: 112px; }
.role-card svg { width: 28px; height: 28px; color: var(--tint); }
.role-card b { font-size: 15px; }
.role-card small { font-size: 12px; color: var(--label-2); line-height: 1.4; }
.role-card.on { border-color: var(--tint); background: var(--tint-soft); }
.role-card:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; }
.role-pick .err:not([hidden]) { display: block; margin: 6px 4px 0; }
.role-chip { margin: 0 auto 12px; display: flex; gap: 6px; height: 28px; }
.role-chip svg { width: 16px; height: 16px; }

/* phone verification (WhatsApp user-initiated / code sent) */
.field .cc { font-weight: 500; color: var(--label-2); margin-inline-start: 6px; font-size: 12px; }
.wa-box { background: var(--bg-elev); border-radius: var(--radius-lg); padding: 14px; margin: 0 0 12px; box-shadow: var(--shadow); }
.wa-lead { margin: 0 0 8px; }
.wa-steps { margin: 0 0 12px; padding-inline-start: 20px; color: var(--label-2); font-size: 14px; line-height: 1.7; }
.btn.wa { background: #1f8f4e; color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn.wa .ic { width: 22px; height: 22px; }
.wa-manual { margin: 10px 0; font-size: 14px; }
.wa-manual summary { cursor: pointer; color: var(--tint); }
.wa-msg { white-space: pre-wrap; background: var(--fill); border-radius: 10px; padding: 10px; font: inherit; font-size: 13px; margin: 8px 0; }
