/* SherikTop Web v3 — single customer-facing stylesheet.
   Performance budget: one cascade, no backdrop filters, no !important. */

:root {
  color-scheme: light;
  --brand-900: #32164f;
  --brand-800: #47206f;
  --brand-700: #55278a;
  --brand-600: #6432a8;
  --brand-500: #7849b8;
  --brand-200: #d8c6e8;
  --brand-100: #e8dcf2;
  --brand-50: #f2ecf8;
  --ink: #1c1b20;
  --ink-soft: #403d45;
  --muted: #625e68;
  --muted-soft: #7a7680;
  --bg: #f8f7fa;
  --surface: #fff;
  --surface-soft: #f3f2f5;
  --line: #e5e2e8;
  --line-strong: #d5d0d9;
  --success: #137a5b;
  --success-soft: #e7f5ef;
  --danger: #b9384a;
  --danger-soft: #fdecef;
  --shadow-sm: 0 4px 14px rgba(28,27,32,.06);
  --shadow-md: 0 12px 30px rgba(28,27,32,.10);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 22px;
  --tg-top-inset: 0px;
  --tg-bottom-inset: 0px;
  --tg-left-inset: 0px;
  --tg-right-inset: 0px;
  --bottom-nav-height: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { min-width: 320px; background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none; }
[hidden][hidden] { display: none; }
::selection { background: var(--brand-100); color: var(--brand-900); }
:where(a,button,input,select,textarea):focus-visible { outline: 3px solid rgba(100,50,168,.22); outline-offset: 2px; }
.sr-only,.detail-sr-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; }

.app-shell { width: min(100%,560px); min-height: 100dvh; margin: 0 auto; background: var(--bg); }
.content { padding: 14px 14px calc(26px + env(safe-area-inset-bottom,0px)); }
.with-bottom-nav { padding-bottom: calc(94px + env(safe-area-inset-bottom,0px)); }

/* Header */
.app-header {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) 44px;
  min-height: 64px;
  align-items: center;
  gap: 10px;
  padding: max(10px,env(safe-area-inset-top,0px)) 14px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.app-header h1 { margin: 0; overflow: hidden; font-size: 16px; font-weight: 850; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.app-header p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.app-header > div { min-width: 0; text-align: center; }
.header-action,.detail-icon-btn {
  display: grid; width: 42px; height: 42px; place-items: center;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--brand-700);
}
.header-action svg,.detail-icon-btn svg { width: 22px; height: 22px; }

/* Home header */
.market-header { grid-template-columns: 42px minmax(0,1fr) auto; min-height: 68px; }
.market-alert { position: relative; display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--brand-50); color: var(--brand-600); }
.market-alert svg { width: 19px; height: 19px; }
.market-alert i { position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--danger); }
.market-brand { display: flex; align-items: center; justify-content: center; }
.brand-logo { display: inline-flex; height: 42px; align-items: center; justify-content: center; }
.market-logo-mark { width: 88px; height: 40px; object-fit: contain; }
.market-location { display: flex; min-height: 40px; align-items: center; gap: 5px; padding: 0 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.market-location svg { width: 15px; height: 15px; color: var(--brand-600); }
.market-location .market-chevron { width: 12px; color: var(--muted); }

/* Search and discovery */
.home-page .content { padding-top: 8px; }
.search-card { margin-bottom: 10px; padding: 6px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-sm); }
.search-row { display: grid; grid-template-columns: 24px minmax(0,1fr) 40px; min-height: 46px; align-items: center; gap: 4px; padding: 0 4px 0 10px; border-radius: 13px; background: var(--surface-soft); }
.search-leading-icon { display: grid; place-items: center; color: var(--brand-600); }
.search-leading-icon svg { width: 19px; height: 19px; }
.search-row input { min-width: 0; height: 44px; padding: 0; border: 0; outline: 0; background: transparent; font-size: 14px; font-weight: 550; }
.search-row input::placeholder { color: var(--muted-soft); opacity: 1; }
.search-submit-inline { display: none; }
#filter-open { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: var(--brand-600); color: #fff; }
#filter-open svg { width: 19px; height: 19px; }
.popular-searches-panel { margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-md); }
.popular-search-title { margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 750; }
.popular-search-row,.chip-scroll,.quick-filters,.related-chip-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.popular-search-row::-webkit-scrollbar,.chip-scroll::-webkit-scrollbar,.quick-filters::-webkit-scrollbar,.related-chip-row::-webkit-scrollbar { display: none; }
.popular-search-chip { flex: 0 0 auto; min-height: 31px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.popular-search-chip small { margin-left: 4px; color: var(--muted); }
.filter-summary { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.chip-scroll { flex: 1; }
.filter-chip { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: var(--brand-50); color: var(--brand-800); font-size: 9px; font-weight: 700; }
.chip-clear { flex: 0 0 auto; padding: 6px 8px; background: transparent; color: var(--danger); font-size: 9px; font-weight: 750; }
.quick-filters { margin: 0 0 10px; padding: 0 0 2px; }
.quick-filter { flex: 0 0 auto; min-height: 34px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 700; }
.quick-filter.is-active { border-color: var(--brand-200); background: var(--brand-50); color: var(--brand-800); }

.market-stat-card { position: relative; min-height: 112px; margin-bottom: 9px; overflow: hidden; padding: 15px 16px; border-radius: 18px; background: linear-gradient(135deg,var(--brand-800),var(--brand-600)); color: #fff; box-shadow: 0 9px 22px rgba(71,32,111,.16); }
.market-stat-copy { position: relative; z-index: 2; }
.market-stat-copy p { margin: 0 0 2px; color: rgba(255,255,255,.72); font-size: 10px; }
.market-stat-copy h2 { margin: 0; font-size: 18px; font-weight: 800; }
.market-stat-copy button { display: inline-flex; min-height: 38px; align-items: center; gap: 8px; margin-top: 9px; padding: 0 12px; border-radius: 11px; background: rgba(255,255,255,.14); color: #fff; font-size: 10px; font-weight: 750; }
.market-stat-copy button svg { width: 15px; height: 15px; }
.market-stat-art { position: absolute; right: -8px; bottom: -24px; width: 126px; height: 126px; opacity: .09; stroke-width: 8; }
.market-post-card { display: grid; grid-template-columns: minmax(0,1fr) auto; min-height: 62px; align-items: center; gap: 8px; margin-bottom: 14px; padding: 9px 10px 9px 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.market-post-card strong { display: block; font-size: 11px; }
.market-post-card span { color: var(--muted); font-size: 9px; }
.market-post-card a { display: inline-flex; min-height: 40px; align-items: center; gap: 6px; padding: 0 11px; border-radius: 11px; background: var(--brand-600); color: #fff; font-size: 10px; font-weight: 750; }
.market-post-card svg { width: 15px; height: 15px; }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin: 0 3px 9px; }
.results-heading strong { display: block; font-size: 15px; font-weight: 850; }
.results-heading div span { color: var(--muted); font-size: 9.5px; }
.live-indicator { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-size: 9px; font-weight: 700; white-space: nowrap; }
.live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* Listing list — compact DOM and paint containment. */
.cards { display: grid; gap: 10px; }
.card { contain: layout paint; content-visibility: auto; contain-intrinsic-size: 286px; overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); box-shadow: var(--shadow-sm); }
.card-detail-link { display: block; }
.card-main { display: grid; grid-template-columns: 124px minmax(0,1fr); gap: 11px; padding: 10px; }
.image-wrap { position: relative; overflow: hidden; background: var(--surface-soft); }
.compact-image { height: 170px; border-radius: 14px; }
.listing-thumb { width: 100%; height: 100%; object-fit: cover; }
.tag.audience { position: absolute; top: 8px; left: 8px; max-width: calc(100% - 16px); overflow: hidden; padding: 5px 8px; border-radius: 999px; background: rgba(28,27,32,.86); color: #fff; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.photo-count { position: absolute; bottom: 7px; left: 7px; display: inline-flex; min-height: 25px; align-items: center; gap: 4px; padding: 0 7px; border-radius: 999px; background: rgba(28,27,32,.72); color: #fff; font-size: 9px; font-weight: 750; }
.photo-count svg { width: 13px; height: 13px; }
.card-body { min-width: 0; padding-top: 2px; }
.card-price-title { margin: 0 0 7px; overflow: hidden; color: var(--ink); font-size: 16px; font-weight: 850; line-height: 1.15; text-overflow: ellipsis; }
.location-row { display: flex; min-width: 0; align-items: center; gap: 5px; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 650; }
.location-row svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--brand-600); }
.location-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.info-chips span { display: inline-flex; max-width: 100%; min-height: 25px; align-items: center; overflow: hidden; padding: 0 7px; border-radius: 999px; background: var(--surface-soft); color: var(--ink-soft); font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.cta-row { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 7px; padding: 0 10px 10px; }
.save-btn,.card-cta { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: 7px; border-radius: 12px; font-size: 12px; font-weight: 800; }
.save-btn { border: 1px solid var(--line); background: var(--surface); color: var(--brand-600); }
.save-btn .save-label { display: none; }
.save-btn svg,.card-cta svg { width: 20px; height: 20px; }
.save-btn.is-saved { border-color: var(--brand-200); background: var(--brand-50); }
.card-cta { background: var(--brand-600); color: #fff; }
.cards.is-loading { opacity: .72; }

.skeleton-card { min-height: 230px; padding: 10px; }
.skeleton-card .skeleton-block { height: 150px; border-radius: 14px; background: var(--surface-soft); }
.skeleton-line { height: 10px; margin-top: 10px; border-radius: 999px; background: var(--surface-soft); }
.skeleton-line.wide { width: 74%; }
.skeleton-grid { display: flex; gap: 5px; margin-top: 10px; }
.skeleton-grid span { width: 52px; height: 22px; border-radius: 999px; background: var(--surface-soft); }
.skeleton-actions { display: none; }

.state { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--muted); text-align: center; }
.state h2 { margin: 0 0 5px; color: var(--ink); font-size: 15px; }
.state p { margin: 0 0 10px; font-size: 11px; }
.primary-btn { min-height: 42px; padding: 0 14px; border-radius: 12px; background: var(--brand-600); color: #fff; font-size: 11px; font-weight: 750; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 14px; }
.pagination-page,.pagination-arrow { min-width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink-soft); font-size: 11px; font-weight: 750; }
.pagination-page.is-current { border-color: var(--brand-600); background: var(--brand-600); color: #fff; }
.load-more { width: 100%; min-height: 44px; margin-top: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--brand-700); font-weight: 750; }

/* Filter sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(28,27,32,.34); }
.filter-sheet { position: fixed; z-index: 80; right: max(10px,env(safe-area-inset-right,0px)); bottom: calc(var(--bottom-nav-height) + 18px + var(--tg-bottom-inset)); left: max(10px,env(safe-area-inset-left,0px)); max-width: 520px; max-height: calc(100dvh - 105px - var(--tg-top-inset) - var(--tg-bottom-inset)); margin: 0 auto; overflow-y: auto; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-md); }
.sheet-header { display: grid; grid-template-columns: minmax(0,1fr) 38px; align-items: center; gap: 10px; margin-bottom: 12px; }
.sheet-header strong { display: block; font-size: 15px; }
.sheet-header span { color: var(--muted); font-size: 10px; }
.sheet-header button { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: var(--surface-soft); color: var(--ink-soft); }
.sheet-header svg { width: 18px; height: 18px; }
.filter-sheet label { display: grid; gap: 5px; margin-top: 10px; color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.filter-sheet input,.filter-sheet select,.filter-sheet textarea { width: 100%; min-height: 44px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 12px; outline: 0; background: var(--surface); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 14px; }
.sheet-actions button { min-height: 42px; border-radius: 12px; font-size: 11px; font-weight: 750; }
.ghost-btn,.plain-btn { border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink-soft); }
.plain-btn { grid-column: 1/-1; min-height: 36px; background: transparent; }

/* Shared bottom navigation */
.bottom-nav { position: fixed; z-index: 60; right: 12px; bottom: max(7px,env(safe-area-inset-bottom,0px),var(--tg-bottom-inset)); left: 12px; display: grid; grid-template-columns: repeat(3,1fr); width: min(calc(100% - 24px),516px); height: 64px; margin: 0 auto; padding: 5px 8px; border: 1px solid rgba(28,27,32,.09); border-radius: 20px; background: var(--surface); box-shadow: 0 7px 22px rgba(28,27,32,.10); }
.bottom-nav-item { display: flex; min-width: 0; min-height: 52px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 3px; border-radius: 14px; color: var(--muted); font-size: 9.5px; font-weight: 700; }
.bottom-nav-icon { display: grid; width: 34px; height: 29px; place-items: center; border-radius: 10px; }
.bottom-nav-icon svg { width: 20px; height: 20px; }
.bottom-nav-item.is-active { color: var(--brand-800); }
.bottom-nav-item.is-active .bottom-nav-icon { background: var(--brand-50); color: var(--brand-600); }
.bottom-nav-create .bottom-nav-icon { width: 37px; height: 37px; margin-top: -6px; border-radius: 12px; background: var(--brand-600); color: #fff; }
.bottom-nav-create .bottom-nav-icon svg { width: 22px; height: 22px; }

/* Post and profile */
.product-eyebrow { margin: 0 0 5px; color: var(--brand-600); font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.post-page .content,.profile-page .content { display: grid; gap: 11px; }
.post-hero,.post-flow,.post-cta-panel,.profile-hero,.profile-login-note,.profile-action,.profile-saved { border: 1px solid var(--line); border-radius: 19px; background: var(--surface); box-shadow: var(--shadow-sm); }
.post-hero { position: relative; overflow: hidden; padding: 20px 17px; }
.post-hero::after { content: ""; position: absolute; top: -48px; right: -48px; width: 130px; height: 130px; border-radius: 50%; background: var(--brand-50); }
.post-hero-icon,.step-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); }
.post-hero-icon { position: relative; z-index: 1; margin-bottom: 12px; }
.post-hero-icon svg,.step-icon svg { width: 21px; height: 21px; }
.post-hero h2,.profile-page-intro h2 { margin: 0; color: var(--ink); font-size: 24px; font-weight: 900; letter-spacing: -.03em; line-height: 1.08; }
.post-hero > p:not(.product-eyebrow) { max-width: 340px; margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.post-trust-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
.post-trust-row span { display: inline-flex; min-height: 28px; align-items: center; gap: 4px; padding: 0 8px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 9.5px; font-weight: 750; }
.post-trust-row svg { width: 12px; height: 12px; }
.post-flow { padding: 17px 15px 5px; }
.section-heading h2 { margin: 0; font-size: 17px; }
.post-steps { display: grid; margin: 8px 0 0; padding: 0; list-style: none; }
.post-steps li { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 11px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.post-steps li:last-child { border: 0; }
.post-steps strong { display: block; margin-bottom: 3px; font-size: 12px; }
.post-steps span:not(.step-icon) { display: block; color: var(--muted); font-size: 10.5px; }
.post-cta-panel { display: grid; gap: 12px; padding: 15px; }
.post-cta-panel strong { display: block; font-size: 14px; }
.post-cta-panel div span { color: var(--muted); font-size: 10.5px; }
.primary-link { display: flex; min-height: 48px; align-items: center; justify-content: space-between; padding: 0 14px; border-radius: 13px; background: var(--brand-600); color: #fff; font-size: 12px; font-weight: 800; }
.primary-link svg { width: 18px; height: 18px; }

.profile-page-intro { padding: 2px 3px 3px; }
.profile-loading { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; min-height: 86px; }
.loading-avatar { width: 54px; height: 54px; border-radius: 16px; background: var(--surface-soft); }
.loading-lines { display: grid; gap: 8px; }
.loading-lines i { width: 58%; height: 9px; border-radius: 999px; background: var(--surface-soft); }
.loading-lines i:last-child { width: 38%; }
.profile-card { padding: 0; border: 0; background: transparent; box-shadow: none; }
.profile-card .loading-avatar,.profile-card .loading-lines { display: none; }
.profile-hero { display: grid; grid-template-columns: 56px minmax(0,1fr); gap: 12px; align-items: center; padding: 14px; }
.profile-avatar { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; }
.profile-avatar-fallback { display: grid; place-items: center; background: var(--brand-600); color: #fff; font-size: 17px; font-weight: 800; }
.profile-hero h2 { margin: 0; font-size: 17px; }
.profile-hero p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.profile-login-note { margin-top: 10px; padding: 14px; border-color: var(--brand-200); background: var(--brand-50); }
.profile-login-note strong { font-size: 13px; }
.profile-login-note p { margin: 4px 0 10px; color: var(--muted); font-size: 10.5px; }
.profile-login-note a { display: inline-flex; min-height: 38px; align-items: center; padding: 0 12px; border-radius: 11px; background: var(--brand-600); color: #fff; font-size: 10.5px; font-weight: 750; }
.profile-action-grid { display: grid; gap: 7px; margin-top: 10px; }
.profile-action { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; min-height: 58px; align-items: center; padding: 8px 10px; }
.profile-action .icon { color: var(--brand-600); }
.profile-action span { font-size: 11.5px; font-weight: 750; }
.profile-action strong { padding: 4px 7px; border-radius: 999px; background: var(--brand-50); color: var(--brand-800); font-size: 9px; }
.profile-saved { margin-top: 10px; padding: 13px; }
.profile-saved h3 { margin: 0 0 9px; font-size: 14px; }
.profile-saved-list { color: var(--muted); font-size: 11px; }

/* Detail */
.detail-topbar { position: sticky; top: 0; grid-template-columns: 44px minmax(0,1fr) 44px; }
.detail-topbar-title h1 { margin: 0; font-size: 14px; }
.detail-content { max-width: 680px; padding-top: 10px; }
.detail-card { background: transparent; }
.detail-hero { position: relative; height: clamp(255px,51vh,390px); overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-soft); box-shadow: var(--shadow-sm); }
.detail-hero .slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; }
.detail-hero .slide.is-active { opacity: 1; pointer-events: auto; }
.carousel-btn { position: absolute; z-index: 3; top: 50%; display: grid; width: 40px; height: 40px; place-items: center; transform: translateY(-50%); border-radius: 50%; background: rgba(255,255,255,.94); color: var(--ink); font-size: 25px; box-shadow: var(--shadow-sm); }
.carousel-btn.left { left: 12px; }
.carousel-btn.right { right: 12px; }
.listing-badge { right: 12px; left: auto; max-width: calc(100% - 24px); }
.detail-gallery-open { position: absolute; z-index: 3; right: 10px; bottom: 10px; display: inline-flex; min-height: 34px; align-items: center; gap: 5px; padding: 0 10px; border-radius: 999px; background: rgba(255,255,255,.94); color: var(--ink); font-size: 10px; font-weight: 800; }
.detail-gallery-open .icon { width: 15px; height: 15px; }
.dots { position: absolute; z-index: 3; bottom: 15px; left: 50%; display: flex; gap: 5px; transform: translateX(-50%); }
.dot { width: 7px; height: 7px; border-radius: 999px; background: rgba(255,255,255,.6); }
.dot.is-active { width: 16px; background: #fff; }
.detail-heading-block { padding: 13px 2px 0; }
.detail-heading-block h2 { margin: 0 0 8px; font-size: 22px; font-weight: 900; letter-spacing: -.03em; line-height: 1.1; }
.detail-summary-line { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; }
.detail-summary-price { color: var(--brand-800); font-size: 17px; font-weight: 900; }
.detail-summary-location { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10.5px; }
.detail-summary-location .icon { width: 14px; color: var(--brand-600); }
.detail-facts,.detail-amenities,.related-searches { margin-top: 18px; }
.detail-facts > h3,.detail-amenities h3,.related-searches h3 { margin: 0 0 9px; font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.detail-info-card { display: grid; grid-template-columns: 34px minmax(0,1fr); min-height: 68px; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.detail-info-card.detail-info-wide { grid-column: 1/-1; }
.detail-info-card > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--brand-50); color: var(--brand-600); }
.detail-info-card .icon { width: 18px; height: 18px; }
.detail-info-card small { display: block; overflow: hidden; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.detail-info-card strong { display: block; overflow-wrap: anywhere; font-size: 11px; line-height: 1.2; }
.detail-amenity-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.detail-amenity-chips li { display: inline-flex; min-height: 32px; align-items: center; gap: 5px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-soft); font-size: 10px; font-weight: 650; }
.detail-amenity-chips li span { color: var(--success); font-weight: 900; }
.locked-phone { display: grid; gap: 12px; margin-top: 18px; padding: 17px; border-radius: 19px; background: var(--brand-900); color: #fff; }
.locked-phone strong { font-size: 16px; }
.locked-phone p { margin: 4px 0 0; color: rgba(255,255,255,.72); font-size: 11px; }
.locked-phone .call-btn { display: flex; min-height: 46px; align-items: center; justify-content: center; gap: 7px; border-radius: 13px; background: #fff; color: var(--brand-800); font-size: 12px; font-weight: 800; }
.phone-result { color: #fff; text-align: center; }
.related-chip-row a { flex: 0 0 auto; min-height: 32px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--brand-700); font-size: 9px; font-weight: 700; }

/* Gallery */
.gallery-open { overflow: hidden; }
.gallery-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: #111; color: #fff; }
.gallery-toolbar { position: absolute; z-index: 2; top: 0; right: 0; left: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top,0px)) 14px 12px; }
.gallery-close,.gallery-nav { display: grid; place-items: center; background: rgba(255,255,255,.14); color: #fff; }
.gallery-close { width: 42px; height: 42px; border-radius: 50%; font-size: 24px; }
.gallery-nav { position: absolute; z-index: 2; top: 50%; width: 42px; height: 54px; transform: translateY(-50%); border-radius: 13px; font-size: 28px; }
.gallery-prev { left: 10px; }.gallery-next { right: 10px; }
.gallery-image { max-width: 100%; max-height: 100%; object-fit: contain; }

/* My listings and subscribe */
.mini-card { display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.mini-card img { width: 76px; height: 76px; border-radius: 11px; object-fit: cover; }
.mini-card strong,.mini-card span { display: block; }
.mini-card span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.mini-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.mini-actions a,.mini-actions button { min-height: 30px; padding: 0 8px; border-radius: 9px; background: var(--brand-50); color: var(--brand-800); font-size: 9px; font-weight: 700; }
.subscribe-hero { padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--brand-900); color: #fff; }
.subscribe-hero h2 { margin: 0; font-size: 22px; }
.subscribe-hero p { color: rgba(255,255,255,.72); font-size: 11px; }
.subscribe-hero ul { display: grid; gap: 7px; margin: 14px 0 0; padding-left: 18px; font-size: 11px; }
.plans { display: grid; gap: 10px; margin-top: 12px; }
.plan { position: relative; display: block; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.plan.featured { border-color: var(--brand-200); background: var(--brand-50); }
.plan .badge { position: absolute; top: 12px; right: 12px; padding: 5px 8px; border-radius: 999px; background: var(--brand-600); color: #fff; font-size: 8px; font-weight: 800; }
.plan h3 { margin: 0 0 5px; font-size: 15px; }
.plan strong { color: var(--brand-800); font-size: 20px; }
.plan p { margin: 5px 0 0; color: var(--muted); font-size: 10.5px; }

/* Telegram surface owns only safe areas. */
html.is-bot-surface body { overscroll-behavior-y: none; }
html.is-bot-surface.is-telegram-webapp.is-tg-fullscreen body { padding-right: var(--tg-right-inset); padding-left: var(--tg-left-inset); }
html.is-bot-surface.is-telegram-webapp.is-tg-fullscreen .app-header { padding-top: calc(var(--tg-top-inset) + 10px); }
html.is-bot-surface.is-telegram-webapp .with-bottom-nav { padding-bottom: calc(94px + var(--tg-bottom-inset)); }
html.is-bot-surface.is-telegram-webapp .bottom-nav { bottom: calc(7px + var(--tg-bottom-inset)); }
html.is-bot-surface.is-telegram-webapp.has-native-back .app-header.compact,
html.is-bot-surface.is-telegram-webapp.has-native-back .detail-topbar { display: none; }
html.is-bot-surface.is-telegram-webapp.has-native-back .content { padding-top: 12px; }

@media (min-width:700px) {
  .app-shell { border-inline: 1px solid var(--line); }
  .content { padding-inline: 20px; }
}
@media (max-width:350px) {
  .content { padding-inline: 10px; }
  .market-header { padding-inline: 10px; }
  .market-location { padding-inline: 8px; }
  .card-main { grid-template-columns: 112px minmax(0,1fr); gap: 9px; padding: 8px; }
  .compact-image { height: 158px; }
  .cta-row { padding: 0 8px 8px; }
  .bottom-nav { right: 8px; left: 8px; width: calc(100% - 16px); }
  .detail-content { padding-inline: 10px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior: auto; animation-duration: .01ms; animation-iteration-count: 1; transition-duration: .01ms; } }
