/* App styles, final look (steps 2.1 and 2.4, magazine look). Values come from assets/css/tokens.css (a copy of design/tokens-v2.css).
   CSP forbids inline styles: every look is a class here. Layout: one phone-width column (max 430px) centred on larger screens.
   Yekan Bakh has weights 400, 600, 700 and 800 only. */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { direction: rtl; }
body {
  background: #E4E7E2; color: var(--color-ink); font: var(--text-body);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
img { max-width: 100%; }
.ltr { direction: ltr; unicode-bidi: isolate; }
:focus-visible { outline: 3px solid #7FB3A5; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { position: relative; max-width: 430px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--color-bg); overflow-x: hidden; display: flex; flex-direction: column; }
.view { flex: 1; padding-bottom: 120px; }
.view.no-nav { padding-bottom: 40px; }
.pad { padding-left: max(var(--page-gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--page-gutter), env(safe-area-inset-right, 0px)); }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.row { display: flex; align-items: center; gap: var(--space-2); }
.between { justify-content: space-between; }
.muted { color: var(--color-text-muted); }
.caption { font: var(--text-caption); }
.boot, .noscript { margin: auto; text-align: center; color: var(--color-text-muted); padding: var(--space-6); display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }

/* number separator: a small dot with space, never «·» next to Persian digits */
.sep { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .55; margin: 0 7px; vertical-align: middle; flex: none; }

/* ---------- type ---------- */
.t-hero { margin: 0; font: var(--text-hero); letter-spacing: -.3px; text-wrap: balance; }
.t-page { margin: 0; font: var(--text-page-xl); letter-spacing: -.3px; }
.t-title { margin: 0; font: var(--text-title-1); }
.t-section { margin: 0; font: var(--text-title-2); }

/* ---------- icons ---------- */
.ic { display: inline-flex; align-items: center; justify-content: center; flex: none; line-height: 0; }
.ic svg { display: block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--button-h); padding: 0 var(--space-6); border: 0; border-radius: var(--radius-full);
  font: 800 15px/24px var(--font-family-base); text-decoration: none; background: var(--color-ink); color: #fff;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:active { background: var(--color-primary-pressed); }
.btn-ink { background: var(--color-ink); }
.btn-light { background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-card); }
.btn-ghost { background: transparent; color: var(--color-ink); border: 1.5px solid var(--color-ink); }
.btn-danger { background: var(--color-error); }
.btn-text-danger { background: transparent; color: var(--color-error); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 0; color: var(--color-primary); font: 700 13px/20px var(--font-family-base); min-height: 24px; text-decoration: none; }
.iconbtn {
  width: var(--icon-btn); height: var(--icon-btn); border: 0; border-radius: var(--radius-full); flex: none;
  background: var(--color-surface); box-shadow: 0 6px 18px rgba(23, 43, 38, .07); display: inline-flex; align-items: center; justify-content: center; color: var(--color-ink);
}
.iconbtn.green { background: var(--color-primary); color: #fff; box-shadow: none; position: relative; }
.count-badge {
  position: absolute; top: -3px; left: -3px; min-width: 20px; height: 20px; border-radius: var(--radius-full); padding: 0 4px;
  background: #fff; color: var(--color-primary); font: 800 11px/20px var(--font-family-base); text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

/* ---------- chips ---------- */
.chip {
  height: var(--chip-h); padding: 0 15px; border-radius: var(--radius-full); border: 0; flex: none;
  background: var(--color-surface); font: var(--text-chip); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--color-ink);
}
.chip.on { background: var(--color-ink); color: #fff; }
.chip.tint { background: var(--color-primary-tint); color: var(--color-primary); }
.chips { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.hscroll { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.hscroll::-webkit-scrollbar { display: none; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font: var(--text-label); }
.field .req { color: var(--color-error); }
.input {
  height: var(--field-h); width: 100%; border-radius: var(--radius-field); border: 2px solid transparent;
  background: var(--color-surface); padding: 0 var(--space-4); font: var(--text-input); outline: none;
}
textarea.input { height: auto; min-height: 110px; padding: var(--space-3) var(--space-4); line-height: 26px; resize: vertical; }
.input::placeholder { color: var(--color-placeholder); font-weight: 400; }
.input:focus { border-color: var(--color-focus); }
.field.has-error .input { border-color: var(--color-error); background: var(--color-error-bg); }
.help { font: var(--text-caption); color: var(--color-text-muted); }
.error { font: var(--text-caption); color: var(--color-error); margin: 0; }

/* ---------- cards and notices ---------- */
.card { background: var(--color-surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.notice { border-radius: 20px; padding: var(--space-3) 14px; font: 600 12px/22px var(--font-family-base); display: flex; gap: var(--space-2); align-items: flex-start; }
.notice-error { background: var(--color-error-bg); color: var(--color-error); }
.notice-warn { background: var(--color-warning-bg); color: var(--color-warning-text); }
.notice-info { background: var(--color-primary-soft); color: var(--color-primary); }
.offline { background: var(--color-warning-bg); color: var(--color-warning-text); font: var(--text-caption); padding: var(--space-2) var(--space-4); text-align: center; }

/* ---------- glass, photo scrim and photo headers ---------- */
.glass { background: var(--glass-bg); border: 1px solid var(--glass-border); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); color: #fff; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: var(--glass-fallback); } }
.gbtn { width: var(--icon-btn); height: var(--icon-btn); border-radius: var(--radius-full); display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; }
.gchip { height: 32px; padding: 0 12px; border-radius: var(--radius-full); font: 700 12px/1 var(--font-family-base); display: inline-flex; align-items: center; white-space: nowrap; }
.gchip.dark { background: rgba(23, 43, 38, .45); border: 1px solid rgba(255, 255, 255, .3); color: #fff; }

.hero { position: relative; height: var(--hero-h); border-radius: 0 0 var(--radius-hero) var(--radius-hero); overflow: hidden; color: #fff; background: #2C6B5A; flex: none; }
.hero.sm { height: var(--hero-sm-h); }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .shade { position: absolute; inset: 0; background: var(--hero-shade); }
.hero.no-photo .shade { background: radial-gradient(120% 90% at 85% 0%, rgba(255, 255, 255, .10), transparent 60%), linear-gradient(180deg, #1D6B57, var(--color-primary)); }
.hero .in { position: relative; height: 100%; padding: calc(20px + env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-left, 0px)) 54px; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-4); }
.hero.sm .in { padding-bottom: 26px; }
.hero .bar { display: flex; justify-content: space-between; align-items: center; }
.hero .sub { font: 400 13px/22px var(--font-family-base); color: var(--color-on-photo-muted); margin: 0; }
.hero.sm .t-hero { font: var(--text-hero-sm); }
.brand-pill { height: 46px; padding: 0 14px 0 16px; border-radius: var(--radius-full); display: inline-flex; align-items: center; gap: var(--space-2); }
.brand-pill strong { font: 700 14px/1 var(--font-family-base); }
.brand-pill small { font: var(--text-caption); color: var(--color-on-photo-muted); margin-inline-start: 2px; }

/* search inside the home photo */
.hsearch { height: 56px; border-radius: var(--radius-full); display: flex; align-items: center; gap: 10px; padding: 0 18px 0 6px; }
.hsearch input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; color: #fff; font: 500 16px/24px var(--font-family-base); }
.hsearch input::placeholder { color: #E1EDE8; font-weight: 400; }
.hsearch:focus-within { border-color: #fff; }
.hsearch .go { width: 44px; height: 44px; border-radius: var(--radius-full); border: 0; background: #fff; color: var(--color-primary); display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* floating deal toggle */
.dtoggle {
  position: relative; z-index: 2; margin: -28px auto 0; width: min(300px, calc(100% - 40px)); height: 56px; border-radius: var(--radius-full);
  background: var(--color-surface); box-shadow: 0 14px 34px rgba(23, 43, 38, .14); padding: 5px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dtoggle.wide { margin: 0; width: 100%; box-shadow: var(--shadow-card); }
.dtoggle button { border: 0; border-radius: var(--radius-full); background: transparent; font: 600 14px/1 var(--font-family-base); color: var(--color-ink); }
.dtoggle button[aria-selected="true"] { background: var(--color-primary); color: #fff; font-weight: 800; }

/* sub-page header */
.top { display: flex; align-items: center; gap: var(--space-3); padding-top: calc(18px + env(safe-area-inset-top, 0px)); padding-bottom: 10px; }
.top .tt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top .tt strong { font: 800 20px/30px var(--font-family-base); }
.top .tt span { font: var(--text-caption); color: var(--color-text-muted); }

/* horizontal carousel */
.hcar { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 0 var(--page-gutter) 24px; scroll-padding: 0 var(--page-gutter); }
.hcar::-webkit-scrollbar { display: none; }
.hcar > * { scroll-snap-align: start; }

/* ---------- listing card ---------- */
.lc { display: flex; flex-direction: column; width: 100%; background: var(--color-surface); border-radius: var(--radius-card-lg); padding: var(--space-2); box-shadow: var(--shadow-card-lg); text-align: right; cursor: pointer; color: var(--color-ink); text-decoration: none; border: 0; }
.lc.sm { width: min(304px, 82vw); flex: none; }
.lc .ph { position: relative; height: var(--card-photo-h); border-radius: var(--radius-photo-lg); overflow: hidden; }
.lc.sm .ph { height: var(--card-photo-h-sm); }
.lc .ph > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc .ph .deal { position: absolute; top: 12px; right: 12px; }
.lc .ph .fav { position: absolute; top: 10px; left: 10px; width: 44px; height: 44px; border: 0; border-radius: var(--radius-full); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--color-ink); }
.lc .ph .fav[aria-pressed="true"] { color: var(--color-error); }
.lc .ph .cnt { position: absolute; bottom: 12px; left: 12px; height: 30px; padding: 0 10px; gap: 4px; font: 600 11px/1 var(--font-family-base); }
.lc .ph .nophoto { position: absolute; bottom: 12px; left: 12px; height: 30px; padding: 0 10px; border-radius: var(--radius-full); background: rgba(255, 255, 255, .9); color: var(--color-text-body); font: 700 11px/30px var(--font-family-base); }
.lc .body { padding: 16px 12px 10px; display: flex; flex-direction: column; gap: 10px; }
.lc .title { font: 800 16px/26px var(--font-family-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc .meta { font: var(--text-caption); color: var(--color-text-muted); display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
.lc .meta .ic { margin-inline-end: 3px; }
.price-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.price-big { display: flex; flex-direction: column; }
.price-big small { font: 600 11px/16px var(--font-family-base); color: var(--color-text-muted); }
.price-big strong { font: var(--text-price-xl); color: var(--color-primary); letter-spacing: -.3px; }
.price-big strong em { font: 700 13px/1 var(--font-family-base); font-style: normal; color: var(--color-ink); margin-inline-start: 4px; }
.price-rent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.price-rent > span + span { border-right: 1px solid #E6EBE7; padding-right: 12px; }
.price-rent strong { font: 800 20px/30px var(--font-family-base); }
.per-metre { height: 32px; padding: 0 12px; border-radius: var(--radius-full); background: var(--color-primary-tint); color: var(--color-primary); font: 700 11px/1 var(--font-family-base); display: inline-flex; align-items: center; white-space: nowrap; flex: none; }
.specs { display: flex; border-top: 1px dashed #DCE3DE; padding-top: 12px; }
.specs > span { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; font: 700 12px/1 var(--font-family-base); color: #2E3B36; }
.specs > span + span { border-right: 1px solid var(--color-divider); }

/* fallback image for a listing without photos */
.fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.fb-green { background: var(--fallback-green-bg); color: var(--fallback-green-fg); }
.fb-sand { background: var(--fallback-sand-bg); color: var(--fallback-sand-fg); }
.fb-blue { background: var(--fallback-blue-bg); color: var(--fallback-blue-fg); }
.fb-clay { background: var(--fallback-clay-bg); color: var(--fallback-clay-fg); }

/* publish time line: days first, then the Jalali date */
.pub { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font: var(--text-caption); color: var(--color-text-muted); }
.pub.big { font: 600 12px/20px var(--font-family-base); }

/* ---------- bottom nav: docked white bar, raised post button, sliding indicator ---------- */
.nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(430px, 100%); z-index: 20;
  height: calc(74px + env(safe-area-inset-bottom, 0px)); padding: 0 6px env(safe-area-inset-bottom, 0px);
  background: var(--color-surface); border-radius: 26px 26px 0 0; box-shadow: 0 -8px 24px rgba(23, 43, 38, .08);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
}
.nav .ind { position: absolute; top: 0; right: 6px; width: calc((100% - 12px) / 5); height: 3px; display: flex; justify-content: center; transform: translateX(calc(var(--i, 0) * -100%)); transition: transform .32s cubic-bezier(.3, .7, .2, 1); pointer-events: none; }
.nav .ind::after { content: ""; width: 34px; height: 3px; border-radius: 0 0 4px 4px; background: var(--color-primary); }
.nav button { border: 0; background: none; height: 64px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 700 11px/1 var(--font-family-base); color: #6E7873; transition: color .2s; }
.nav .ic { width: 46px; height: 30px; border-radius: var(--radius-full); transition: background-color .2s; }
.nav button[aria-current="page"] { color: var(--color-primary); }
.nav button[aria-current="page"] .ic { background: #E4F0EB; }
.nav .post { align-self: start; height: auto; margin-top: -22px; gap: 5px; color: var(--color-primary); font-weight: 800; }
.nav .post .ic { width: 58px; height: 58px; background: linear-gradient(160deg, #1D7A63, var(--color-primary)); border: 5px solid var(--color-surface); box-shadow: 0 10px 22px rgba(20, 90, 74, .32); color: #fff; }
.nav .badge { position: absolute; top: 8px; left: calc(50% - 23px); min-width: 18px; height: 18px; border-radius: var(--radius-full); padding: 0 4px; background: var(--color-error); color: #fff; font: 700 11px/18px var(--font-family-base); text-align: center; box-shadow: 0 0 0 2px var(--color-surface); }

/* ---------- floating price bar (detail) ---------- */
.pbar { position: fixed; left: 50%; transform: translateX(-50%); width: min(398px, calc(100% - 32px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); min-height: 78px; border-radius: var(--radius-bar); background: var(--color-primary); box-shadow: var(--shadow-bar); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; color: #fff; z-index: 20; }
.pbar .pl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pbar .pl span { font: 400 11px/16px var(--font-family-base); color: var(--color-on-green-muted); }
.pbar .pl strong { font: 800 19px/28px var(--font-family-base); }
.pbar .call { width: 52px; height: 52px; border: 1px solid rgba(255, 255, 255, .3); border-radius: var(--radius-full); background: rgba(255, 255, 255, .12); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.pbar .chat { height: 56px; padding: 0 20px; border: 0; border-radius: var(--radius-full); background: #fff; color: var(--color-primary); font: 800 14px/1 var(--font-family-base); display: inline-flex; align-items: center; gap: 6px; flex: none; }

/* ---------- empty state and skeleton ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px 10px; }
.empty .ei { width: 72px; height: 72px; border-radius: var(--radius-full); background: var(--color-primary-soft); color: var(--color-primary); display: flex; align-items: center; justify-content: center; }
.empty strong { font: var(--text-title-3); }
.empty p { margin: 0; font: 400 13px/22px var(--font-family-base); color: var(--color-text-muted); }
.skel { background: linear-gradient(90deg, #E8EBE6 0%, #F2F4F0 50%, #E8EBE6 100%); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; border-radius: 14px; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.lc.skeleton { cursor: default; }
.lc.skeleton .ph { background: none; }
.skel.line { height: 14px; }
.skel.w60 { width: 60%; } .skel.w40 { width: 40%; } .skel.w80 { width: 80%; } .skel.full { height: 100%; }

/* ---------- sheet, dialog, toast ---------- */
.scrim { position: fixed; inset: 0; background: var(--color-scrim); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 430px; max-height: 88%; overflow: auto; background: var(--color-bg); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; padding: 10px max(20px, env(safe-area-inset-left, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: var(--space-4); }
.sheet .grab { width: 44px; height: 5px; border-radius: var(--radius-full); background: #CDD3CC; align-self: center; }
.sheet .head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.sheet .head h2 { margin: 0; font: var(--text-title-2); }
.sheet-content h3 { font: var(--text-title-3); margin: var(--space-5) 0 var(--space-2); }
.sheet-content p, .sheet-content li { font: var(--text-body); }
.dialog { position: fixed; inset: 0; background: rgba(23, 43, 38, .45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: var(--space-6); }
.dialog .box { background: var(--color-surface); border-radius: 28px; padding: 22px; max-width: 360px; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.dialog .box h2 { margin: 0; font: var(--text-title-2); }
.dialog .box p { margin: 0; font: 400 14px/24px var(--font-family-base); color: var(--color-text-body); }
.toast { position: fixed; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--color-ink); color: #fff; padding: 12px 18px; border-radius: var(--radius-full); font: 700 13px/20px var(--font-family-base); z-index: 60; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 10px; }
.toast.low { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.toast button { border: 0; background: none; color: #9FD9C2; font: 800 13px/20px var(--font-family-base); padding: 0; }

@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: sheet-up var(--motion-sheet); }
  .toast, .dialog { animation: fade-in var(--motion-fade); }
}
@media (prefers-reduced-motion: reduce) {
  .nav .ind { transition: none; }
  .skel { animation: none; }
  .btn .spin { animation: none; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }


/* ---------- browse screens (step 3.2) ---------- */
.small { font: 400 13px/22px var(--font-family-base); }
.stack.tight { gap: 4px; }
.row.end { justify-content: flex-end; }
.top-align { align-items: flex-start; }
.center { justify-content: center; text-align: center; }
.full { width: 100%; flex: none; }
.sentinel { display: block; width: 1px; height: 1px; flex: none; }
.sec-head { padding-top: 24px; padding-bottom: 14px; }
.res-head { padding-top: calc(20px + env(safe-area-inset-top, 0px)); padding-bottom: 4px; gap: 14px; }
.list { padding-top: 4px; }
.sellcard { width: 100%; border: 0; text-align: right; background: var(--color-surface); border-radius: 28px; padding: 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-card); color: var(--color-ink); }
.sellcard .si { width: 48px; height: 48px; border-radius: 16px; background: var(--color-primary-tint); color: var(--color-primary); display: flex; align-items: center; justify-content: center; flex: none; }
.sellcard .txt { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sellcard b { font: var(--text-title-3); }
.sellcard .txt span { font: var(--text-caption); color: var(--color-text-muted); }
.option { width: 100%; height: 56px; border: 0; border-radius: 18px; background: var(--color-surface); padding: 0 16px; display: flex; align-items: center; justify-content: space-between; font: 700 14px/1 var(--font-family-base); color: var(--color-ink); }
.option.on { color: var(--color-primary); background: var(--color-primary-soft); }
.fgroup { display: flex; flex-direction: column; gap: 10px; }
.fgroup h3 { margin: 0; font: var(--text-title-3); }
.rowbtn { width: 100%; min-height: 52px; border: 0; border-radius: 18px; background: var(--color-surface); padding: 0 14px; display: flex; align-items: center; gap: 10px; text-align: right; color: var(--color-ink); font: 600 14px/22px var(--font-family-base); }
.rowbtn > span:not(.ic) { flex: 1; }
.range-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.range .input { direction: ltr; text-align: right; }
.help.pw { color: var(--color-primary); font-weight: 600; }
.sheet-foot { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom, 0px)); padding: 10px 0 calc(4px + env(safe-area-inset-bottom, 0px)); background: var(--color-bg); }
.checklist { display: flex; flex-direction: column; gap: 8px; }
.check { min-height: 52px; border-radius: 18px; border: 1.5px solid var(--color-border); background: var(--color-surface); display: flex; align-items: center; gap: 10px; padding: 0 14px; font: 700 13px/1 var(--font-family-base); text-align: right; color: var(--color-ink); }
.check .bx { width: 22px; height: 22px; border-radius: 7px; background: #DFE3DD; color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.check.on { border-color: var(--color-primary); background: var(--color-primary-soft); }
.check.on .bx { background: var(--color-primary); }

/* listing page */
.view.with-bar { padding-bottom: 120px; }
.hero.detail { height: var(--detail-photo-h); }
.hero.detail.skel { border-radius: 0 0 var(--radius-hero) var(--radius-hero); }
.hero.detail .in { padding-bottom: 30px; }
.hero.detail .t-hero { font: 800 27px/40px var(--font-family-base); }
.hero.detail .fallback.cover { position: absolute; inset: 0; }
.scrim-photo { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(8, 28, 22, .45) 0%, rgba(8, 28, 22, 0) 25%, rgba(8, 28, 22, 0) 48%, rgba(8, 28, 22, .9) 100%); }
.hero .loc { display: flex; align-items: center; gap: 4px; font: 400 13px/22px var(--font-family-base); color: var(--color-on-photo-muted); }
.hero .row .gbtn + .gbtn { margin-inline-start: 0; }
.thumbs { position: absolute; z-index: 1; left: max(18px, env(safe-area-inset-left, 0px)); top: calc(150px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 8px; }
.thumbs > span { width: 60px; height: 60px; border-radius: 18px; overflow: hidden; display: flex; align-items: center; justify-content: center; font: 800 13px/1 var(--font-family-base); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .cur { border: 2px solid #fff; }
.detail-body { padding-top: 24px; gap: 24px; }
.bignums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--color-surface); border-radius: 28px; padding: 18px 4px; box-shadow: var(--shadow-card); }
.bignums.n1 { grid-template-columns: 1fr; } .bignums.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bignums.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bignums > span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bignums > span + span { border-right: 1px solid var(--color-divider); }
.bignums strong { font: var(--text-num-xl); color: var(--color-primary); }
.bignums small { font: var(--text-caption); color: var(--color-text-muted); }
.desc { margin: 0; font: 400 14px/28px var(--font-family-base); color: var(--color-text-body); white-space: pre-line; }
.spec-rows { padding: 6px 18px; border-radius: 28px; }
.srow { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; font: 400 13px/20px var(--font-family-base); }
.srow + .srow { border-top: 1px solid var(--color-divider); }
.srow strong { font-weight: 700; text-align: left; }
.manager { gap: 12px; }
.manager .mav { width: 52px; height: 52px; border-radius: var(--radius-full); background: var(--color-primary); display: flex; align-items: center; justify-content: center; flex: none; }
.manager strong { font: 700 15px/24px var(--font-family-base); }


/* ---------- posting (step 3.3) ---------- */
.steps { display: flex; gap: 6px; padding-bottom: 14px; }
.steps span { flex: 1; height: 6px; border-radius: var(--radius-full); background: #DFE3DD; }
.steps span.on { background: var(--color-primary); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ctile { position: relative; height: 150px; border-radius: 28px; border: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 16px; text-align: right; box-shadow: var(--shadow-card); }
.ctile .ic { position: absolute; top: 16px; left: 16px; }
.ctile b { font: 800 16px/24px var(--font-family-base); }
.ctile span:not(.ic) { font: 600 11px/18px var(--font-family-base); opacity: .8; }
.sec { background: var(--color-surface); border-radius: var(--radius-section); padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-card); }
.sec h3 { margin: 0; font: var(--text-title-3); }
.sec .input { background: var(--color-bg); }
.inp-unit { position: relative; display: flex; align-items: center; }
.inp-unit .input { padding-left: 52px; }
.inp-unit .unit { position: absolute; left: 14px; font: var(--text-caption); color: var(--color-text-muted); pointer-events: none; }
.inp-unit .input[dir="ltr"] { text-align: right; }
select.input { appearance: none; -webkit-appearance: none; padding-left: 36px; }
.step-row .label { font: var(--text-label); }
.stepper { display: flex; align-items: center; gap: 12px; background: var(--color-bg); border-radius: var(--radius-full); padding: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: var(--radius-full); border: 0; background: var(--color-surface); font: 700 18px/1 var(--font-family-base); color: var(--color-ink); }
.stepper strong { min-width: 24px; text-align: center; font: 800 15px/1 var(--font-family-base); }
.postbar { position: fixed; left: 50%; transform: translateX(-50%); width: min(398px, calc(100% - 32px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 20; }
.postbar .btn { height: 62px; box-shadow: 0 14px 36px rgba(23, 43, 38, .25); }
.slots .slot { position: relative; aspect-ratio: 1 / 1; border-radius: 22px; border: 2px dashed #C9D0C8; background: var(--color-surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; text-align: center; overflow: hidden; color: var(--color-primary); }
.slots .slot b { font: 700 12px/18px var(--font-family-base); color: var(--color-ink); }
.slots .slot.filled { border: 0; }
.slots .slot.failed { border: 2px solid var(--color-error); background: var(--color-error-bg); }
.slots .slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slots .slot .lab { position: absolute; bottom: 8px; right: 8px; left: 8px; background: rgba(23, 43, 38, .72); color: #fff; border-radius: var(--radius-full); font: 600 11px/1.6 var(--font-family-base); padding: 4px 8px; }
.slots .slot .prog { position: absolute; inset: 0; background: rgba(255, 255, 255, .72); display: flex; align-items: center; justify-content: center; font: 800 12px/1 var(--font-family-base); color: var(--color-ink); }
.slots .slot .rm { position: absolute; top: 8px; left: 8px; width: 32px; height: 32px; border-radius: var(--radius-full); border: 0; background: rgba(255, 255, 255, .94); color: var(--color-ink); display: flex; align-items: center; justify-content: center; }
.status { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: var(--radius-full); font: 800 11px/1 var(--font-family-base); align-self: center; }
.st-pending { background: var(--status-pending-bg); color: var(--status-pending-text); }
.done-check { background: #fff; color: var(--color-primary); }
.done { padding-top: 20px; }

/* ---------- auth screens (kept until step 3.1 rebuilds them on these pieces) ---------- */
.auth { width: 100%; padding: 24px var(--page-gutter) var(--space-6); display: flex; flex-direction: column; gap: var(--space-5); flex: 1; }
.auth-head { display: flex; flex-direction: column; gap: var(--space-2); }
.auth-head h1 { margin: 0; font: var(--text-title-1); }
.auth-head p { margin: 0; color: var(--color-text-muted); font: 400 13px/22px var(--font-family-base); }
.auth-foot { margin-top: auto; text-align: center; font: var(--text-caption); color: var(--color-text-muted); }
.auth-foot .link { font: inherit; text-decoration: underline; }
.input.phone { direction: ltr; text-align: right; letter-spacing: 1px; font-weight: 600; font-size: 18px; }
.otp { position: relative; direction: ltr; display: flex; justify-content: center; gap: 10px; }
.otp .box { width: 54px; height: 62px; border-radius: 18px; border: 2px solid transparent; background: var(--color-surface); display: flex; align-items: center; justify-content: center; font: 800 24px/1 var(--font-family-base); }
.otp .box.active { border-color: var(--color-primary); }
.otp.has-error .box { border-color: var(--color-error); background: var(--color-error-bg); }
.otp input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 16px; caret-color: transparent; color: transparent; background: transparent; }
.otp-row { display: flex; justify-content: space-between; align-items: center; font: var(--text-caption); color: var(--color-text-muted); }
.choices { display: flex; flex-direction: column; gap: var(--space-3); }
.choice { display: flex; align-items: center; gap: var(--space-3); text-align: right; padding: 18px; border-radius: 24px; border: 2px solid transparent; background: var(--color-surface); box-shadow: var(--shadow-card); }
.choice[aria-pressed="true"], .choice[aria-checked="true"] { border-color: var(--color-primary); background: var(--color-primary-soft); }
.choice .txt { flex: 1; }
.choice .rd { width: 24px; height: 24px; border-radius: var(--radius-full); border: 2px solid #C9D0C8; flex: none; display: flex; align-items: center; justify-content: center; }
.choice[aria-checked="true"] .rd { border-color: var(--color-primary); }
.choice[aria-checked="true"] .rd::after { content: ""; width: 12px; height: 12px; border-radius: var(--radius-full); background: var(--color-primary); }
.choice .ico { color: var(--color-primary); }
.choice .ico { width: 44px; height: 44px; border-radius: 16px; background: var(--color-primary-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.choice .txt { display: flex; flex-direction: column; gap: 2px; }
.choice strong { font: var(--text-title-3); }
.choice span { font: var(--text-caption); color: var(--color-text-muted); }
.welcome { padding: var(--space-6) var(--page-gutter); display: flex; flex-direction: column; gap: var(--space-4); }
.welcome .acc { padding: 14px 16px; border-radius: 28px; display: flex; align-items: center; gap: var(--space-3); box-shadow: 0 14px 34px rgba(23, 43, 38, .10); }
.welcome .acc .av { width: 52px; height: 52px; border-radius: var(--radius-full); background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.welcome .acc .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.welcome .acc strong { font: var(--text-title-3); }
.welcome .acc span, .welcome .acc bdi { font: var(--text-caption); color: var(--color-text-muted); }
.error.center { text-align: center; }
.notice .ic { margin-top: 2px; }

/* ---------- component sheet (development only, #kit) ---------- */
.kit { padding-bottom: 140px; }
.kit h2 { font: var(--text-title-2); margin: 28px var(--page-gutter) 12px; }
.kit .demo { padding: 0 var(--page-gutter); display: flex; flex-direction: column; gap: var(--space-3); }

/* ---------- my account (P15 to P23, step 3.5) ---------- */
.st-published { background: var(--status-published-bg); color: var(--status-published-text); }
.st-edit { background: var(--status-needs-edit-bg); color: var(--status-needs-edit-text); }
.st-deleted { background: var(--status-deleted-bg); color: var(--status-deleted-text); }
.acc-list { padding-top: var(--space-4); padding-bottom: calc(var(--space-6) + 90px); gap: var(--space-3); }
.acc-list .acc { padding: 14px 16px; border-radius: 28px; display: flex; align-items: center; gap: var(--space-3); }
.acc-list .acc .av { width: 52px; height: 52px; border-radius: var(--radius-full); background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.acc-list .acc .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-list .acc strong { font: var(--text-title-3); }
.acc-list .acc span, .acc-list .acc bdi { font: var(--text-caption); color: var(--color-text-muted); }
.acc-row { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 64px; padding: 10px 14px; border: 0; text-align: start; color: var(--color-ink); font: inherit; cursor: pointer; border-radius: 22px; }
.acc-row .ri { width: 40px; height: 40px; border-radius: 14px; background: var(--color-primary-soft); color: var(--color-primary); display: flex; align-items: center; justify-content: center; flex: none; }
.acc-row .txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-row b { font: 800 14px/22px var(--font-family-base); }
.acc-row .txt span { font: var(--text-caption); color: var(--color-text-muted); }
.acc-row > .ic:last-child { color: var(--color-text-muted); transform: scaleX(-1); }
.acc-row.danger { color: var(--color-error); }
.acc-row.danger .ri { background: var(--color-error-bg); color: var(--color-error); }
.badge-n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-full); background: var(--color-error); color: #fff; font: 800 11px/22px var(--font-family-base); text-align: center; }
.skel.rowsk { height: 64px; border-radius: 22px; }

.mlist { padding-bottom: var(--space-6); }
.mini { display: flex; gap: var(--space-3); align-items: center; width: 100%; padding: 10px; border: 0; border-radius: 24px; background: var(--color-surface); box-shadow: var(--shadow-card); text-align: start; font: inherit; color: var(--color-ink); cursor: pointer; position: relative; }
.mini.dim { opacity: .62; }
.mini .th { width: 84px; height: 84px; border-radius: 18px; overflow: hidden; flex: none; display: flex; }
.mini .th img { width: 100%; height: 100%; object-fit: cover; }
.mini .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mini .meta { font: var(--text-caption); color: var(--color-text-muted); display: flex; align-items: center; flex-wrap: wrap; }
.mini .meta .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-primary); margin-inline-end: 5px; }
.mini .meta .dot.rent { background: var(--color-rent); }
.mini strong { font: 800 14px/22px var(--font-family-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .line { font: 700 12px/20px var(--font-family-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .line.price { color: var(--color-primary); }
.mini .line.err { color: var(--color-error); }
.mini .line.note { color: var(--color-text-muted); font-weight: 600; }
.mini .badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mini .badges .status, .mini > .status { height: 22px; padding: 0 8px; font-size: 11px; }
.mini > .status { position: absolute; top: 10px; left: 10px; }
.mini:has(.badges) .txt, .mini:has(> .status) .txt { padding-left: 80px; }
.fav-row { position: relative; }
.unfav { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); width: 40px; height: 40px; border-radius: var(--radius-full); border: 0; background: var(--color-error-bg); color: var(--color-error); display: flex; align-items: center; justify-content: center; }
.unfav svg { fill: currentColor; }
.fav-row .mini .txt { padding-left: 48px; }
.input.readonly { display: flex; align-items: center; color: var(--color-text-muted); justify-content: flex-end; }
.terms { padding-top: var(--space-4); padding-bottom: var(--space-8, 40px); color: var(--color-text-body); }
.terms p, .terms li { margin: 0; font: var(--text-body); }
.terms ul { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- chat (P20, P21, step 3.6) ---------- */
.chat-row { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: 10px; border: 0; border-radius: 22px; text-align: start; font: inherit; color: var(--color-ink); cursor: pointer; }
.chat-row .th, .chat-card .th { width: 56px; height: 56px; border-radius: 16px; overflow: hidden; flex: none; display: flex; align-items: center; justify-content: center; background: var(--color-primary-soft); color: var(--color-primary); }
.chat-row .th img, .chat-card .th img { width: 100%; height: 100%; object-fit: cover; }
.chat-row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.chat-row .row { gap: var(--space-2); }
.chat-row b { font: 800 14px/22px var(--font-family-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-row time { font: var(--text-caption); color: var(--color-text-muted); flex: none; }
.chat-row .last { font: var(--text-caption); color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-row.unread .last { color: var(--color-ink); font-weight: 700; }
.chat-row.unread time { color: var(--color-primary); font-weight: 700; }

.view.chat { padding-bottom: 150px; }
.chat-scroll { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-2); }
.chat-card { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: 10px; border: 0; border-radius: 22px; background: var(--color-surface); box-shadow: var(--shadow-card); text-align: start; font: inherit; color: var(--color-ink); cursor: pointer; }
.chat-card .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-card b { font: 800 14px/22px var(--font-family-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-card .err { color: var(--color-error); }
.sys { align-self: center; max-width: 92%; margin: var(--space-2) 0; padding: 8px 14px; border-radius: 16px; background: var(--color-warning-bg); color: var(--color-warning-text); font: 600 12px/20px var(--font-family-base); text-align: center; }
.day { align-self: center; margin: var(--space-2) 0 0; }
.day span { display: inline-block; padding: 2px 12px; border-radius: var(--radius-full); background: var(--color-neutral-bg); color: var(--color-text-muted); font: 700 11px/20px var(--font-family-base); }
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg.me { align-self: flex-start; align-items: flex-start; }
.msg.them { align-self: flex-end; align-items: flex-end; }
.msg.system { align-self: center; }
.bub { padding: 9px 13px 6px; border-radius: 20px; display: flex; flex-direction: column; gap: 6px; }
.msg.me .bub { background: var(--color-primary); color: #fff; border-start-start-radius: 6px; }
.msg.them .bub { background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-card); border-start-end-radius: 6px; }
.bub p { margin: 0; font: 500 14px/24px var(--font-family-base); white-space: pre-wrap; overflow-wrap: anywhere; }
.bub time { font: 600 11px/16px var(--font-family-base); opacity: .72; align-self: flex-end; }
.bub .att { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; width: 200px; max-width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: rgba(0, 0, 0, .12); color: inherit; text-decoration: none; font: 700 12px/1 var(--font-family-base); }
.bub .att img { width: 100%; height: 100%; object-fit: cover; }
.bub .att .prog { position: absolute; inset: auto 8px 8px auto; padding: 2px 8px; border-radius: var(--radius-full); background: rgba(23, 43, 38, .72); color: #fff; font: 700 11px/18px var(--font-family-base); }
.msg .st { font: 600 11px/18px var(--font-family-base); color: var(--color-text-muted); margin-top: 2px; }
.msg .st.failed { color: var(--color-error); }
.msg .st .link { font-size: 11px; min-height: 0; }
.newmsg { position: fixed; bottom: calc(110px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 21; background: var(--color-ink); color: #fff; box-shadow: 0 8px 22px rgba(23, 43, 38, .25); }
.chat-bar { position: fixed; left: 50%; transform: translateX(-50%); width: min(430px, 100%); bottom: 0; z-index: 20; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--color-surface); box-shadow: 0 -8px 24px rgba(23, 43, 38, .08); border-radius: 26px 26px 0 0; }
.chat-bar .row { align-items: flex-end; gap: 8px; }
textarea.input.chat-input { flex: 1; min-height: 46px; height: 46px; max-height: 118px; resize: none; padding-top: 11px; padding-bottom: 11px; line-height: 24px; border-radius: 23px; }
.chat-bar .iconbtn { width: 46px; height: 46px; box-shadow: none; background: var(--color-bg); }
.chat-bar .iconbtn.ink { background: var(--color-ink); color: #fff; }
.chat-bar .send svg { transform: scaleX(-1); }
.chat-offline { margin: 0 0 8px; font: 600 12px/20px var(--font-family-base); color: var(--color-warning-text); text-align: center; }
.chat-closed { position: fixed; left: 50%; transform: translateX(-50%); width: min(398px, calc(100% - 32px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 20; }

/* admin's category picture for a listing without photos (A10), always with its note */
.fallback.photo { position: relative; background: var(--color-neutral-bg); }
.fallback.photo img { width: 100%; height: 100%; object-fit: cover; }
.fallback.photo .fbnote { position: absolute; bottom: 10px; right: 10px; padding: 0 10px; border-radius: var(--radius-full); background: rgba(23, 43, 38, .72); color: #fff; font: 700 11px/22px var(--font-family-base); }
.hero.detail .fallback.photo .fbnote { bottom: 56px; }

/* ---------- install and first load (P01, P25, step 3.8) ---------- */
.boot img { display: block; }
.boot .dots { display: inline-block; animation: dots 1.4s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; width: 1.1em; text-align: start; }
@keyframes dots { 0% { width: 0; } 100% { width: 1.1em; } }
@media (prefers-reduced-motion: reduce) { .boot .dots { animation: none; } }
.gbtn.install { width: auto; padding: 0 14px 0 12px; gap: 6px; font: 800 13px/1 var(--font-family-base); color: #fff; }
.install-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.install-steps li { display: flex; align-items: center; gap: var(--space-3); font: var(--text-body); }
.install-steps .n { width: 32px; height: 32px; flex: none; border-radius: var(--radius-full); background: var(--color-primary-soft); color: var(--color-primary); display: flex; align-items: center; justify-content: center; font: 800 14px/1 var(--font-family-base); }
