/* ============================================================================
 * Dubai Unit — property Mini App  ·  Telegram-native · iOS-quiet
 *
 * Typography: a deliberate editorial TYPE SCALE (hero 30 · big value 32 ·
 * tile value 20 · body 15.5 · caption 12.5 · micro 11), hierarchy from
 * size + weight + opacity together. Still restrained: system font only,
 * lowercase UI copy, one ink at several opacities, one accent — plus
 * WhatsApp green on the contact button and muted deal-type tints that
 * encode data, not chrome.
 *
 * The page is a stack of UNIFORM titled inset cards (iOS grouped style):
 * lowercase label outside, rounded --bg-2 surface inside. Soft charcoal
 * dark (#1b1b1e, never pure black) + light, driven by Telegram themeParams
 * with a prefers-color-scheme fallback.
 * ==========================================================================*/

:root {
  --bg:        #ffffff;
  --bg-2:      #f2f2f7;                       /* card surface — iOS grouped */
  --ink-rgb:   0, 0, 0;
  --acc:       #007aff;
  --xray:      #ff3b30;                       /* x-ray / community-map highlight — iOS red */
  --wa:        #25d366;                       /* WhatsApp brand green */

  --fill:      rgba(120, 120, 128, 0.12);     /* iOS systemFill — chips/controls */
  --fill-2:    rgba(120, 120, 128, 0.20);

  --ink:   rgba(var(--ink-rgb), 0.92);
  --ink-2: rgba(var(--ink-rgb), 0.55);
  --ink-3: rgba(var(--ink-rgb), 0.32);
  --ink-4: rgba(var(--ink-rgb), 0.14);
  --sep:   rgba(var(--ink-rgb), 0.085);

  /* deal-type tints (data colors, muted) */
  --c-sale: #0a6cff; --t-sale: rgba(10, 108, 255, 0.12);
  --c-rent: #1fa04b; --t-rent: rgba(48, 176, 88, 0.14);
  --c-mort: #c07a00; --t-mort: rgba(255, 159, 10, 0.16);
  --c-gift: #d63964; --t-gift: rgba(255, 55, 95, 0.13);
  --c-lto:  #0e8296; --t-lto:  rgba(90, 200, 250, 0.18);

  /* type scale */
  --fs-hero:  30px;     /* hero title */
  --fs-big:   32px;     /* the money numbers */
  --fs-tile:  20px;     /* stat tile values */
  --fs-body:  15.5px;
  --fs-cap:   12.5px;
  --fs-micro: 11px;

  --pad: 16px;
  --card-x: 16px;
  --card-y: 15px;
  --r: 18px;
  --tg-top: 0px;                              /* Telegram content-safe-area (JS) */
  --out:    cubic-bezier(0.23, 1, 0.32, 1);
  --spring: cubic-bezier(0.32, 0.72, 0, 1);

  color-scheme: light;
  font: 400 var(--fs-body)/1.47 -apple-system, BlinkMacSystemFont, system-ui,
        'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
}

/* soft dark — warm charcoal, not black. JS sets data-theme from Telegram;
   prefers-color-scheme covers stand-alone opens. */
:root[data-theme="dark"] { color-scheme: dark;
  --bg: #1b1b1e; --bg-2: #27272c; --ink-rgb: 255, 255, 255; --acc: #0a84ff; --xray: #ff453a;
  --fill: rgba(120, 120, 128, 0.28); --fill-2: rgba(120, 120, 128, 0.42);
  --sep: rgba(255, 255, 255, 0.10);
  --c-sale: #4da2ff; --t-sale: rgba(10, 132, 255, 0.22);
  --c-rent: #4cd471; --t-rent: rgba(48, 209, 88, 0.20);
  --c-mort: #ffb340; --t-mort: rgba(255, 159, 10, 0.20);
  --c-gift: #ff6482; --t-gift: rgba(255, 55, 95, 0.20);
  --c-lto:  #6fd6f2; --t-lto:  rgba(90, 200, 250, 0.20);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark;
    --bg: #1b1b1e; --bg-2: #27272c; --ink-rgb: 255, 255, 255; --acc: #0a84ff;
    --fill: rgba(120, 120, 128, 0.28); --fill-2: rgba(120, 120, 128, 0.42);
    --sep: rgba(255, 255, 255, 0.10);
    --c-sale: #4da2ff; --t-sale: rgba(10, 132, 255, 0.22);
    --c-rent: #4cd471; --t-rent: rgba(48, 209, 88, 0.20);
    --c-mort: #ffb340; --t-mort: rgba(255, 159, 10, 0.20);
    --c-gift: #ff6482; --t-gift: rgba(255, 55, 95, 0.20);
    --c-lto:  #6fd6f2; --t-lto:  rgba(90, 200, 250, 0.20);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  color: var(--ink);
  font: inherit;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
b, strong { font-weight: 600; }
a { color: var(--acc); text-decoration: none; }
h1 { margin: 0; font: inherit; }
button { font: inherit; }

.app {
  max-width: 460px;
  margin: 0 auto;
  padding:
    calc(10px + var(--tg-top))
    max(var(--pad), env(safe-area-inset-right, 0px))
    calc(44px + env(safe-area-inset-bottom, 0px))
    max(var(--pad), env(safe-area-inset-left, 0px));
}

/* ── top bar (hidden inside Telegram — native header does this job) ──────── */
.top { display: flex; align-items: center; gap: 8px; height: 34px; margin-bottom: 10px; }
body.in-tg .top { display: none; }
.wordmark { font-size: var(--fs-body); font-weight: 700; letter-spacing: -0.02em; }
.wordmark .dot { color: var(--acc); }
.back {
  display: none; align-items: center; gap: 3px;
  color: var(--acc); background: none; border: none; padding: 0;
  min-height: 44px; cursor: pointer; letter-spacing: -0.012em;
  transition: opacity 120ms var(--out);
}
.back:active { opacity: 0.5; }
.back svg { width: 19px; height: 19px; margin-left: -5px; }
body.can-back:not(.in-tg) .back { display: inline-flex; }
body.can-back:not(.in-tg) .wordmark { display: none; }

/* ── THE section chrome — every block is label-outside + inset card ──────── */
.sec { margin-top: 26px; }
.sec:first-child { margin-top: 6px; }
.sec .lbl {
  font-size: var(--fs-cap); font-weight: 500; color: var(--ink-3);
  margin: 0 var(--card-x) 7px; letter-spacing: 0.01em;
}
.card {
  background: var(--bg-2);
  border-radius: var(--r);
  padding: var(--card-y) var(--card-x);
}

/* staggered reveal — transform + opacity only */
.reveal { opacity: 0; transform: translateY(8px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 420ms var(--out), transform 420ms var(--out); }

/* ── HERO (block 1) ──────────────────────────────────────────────────────── */
.eyebrow {
  font-size: var(--fs-micro); font-weight: 600; color: var(--ink-3);
  letter-spacing: 0.06em; margin-bottom: 5px;
}
.h-title {
  font-size: var(--fs-hero); line-height: 1.12; font-weight: 700;
  letter-spacing: -0.028em; text-wrap: balance;
}
/* where it is leads: unit/building line + address, then quiet beds·size */
.h-prime { font-size: var(--fs-body); font-weight: 600; margin-top: 7px; }
.h-addr { font-size: var(--fs-body); color: var(--ink-2); margin-top: 2px; }
.h-meta { font-size: var(--fs-cap); color: var(--ink-2); margin-top: 10px; }

/* ── stat tiles — big value over quiet caption ───────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px 12px;
  margin-top: 4px;
}
.stats + .rows, .stats + .badges, .stats + .note { margin-top: 12px; }
.stat .s-v {
  font-size: var(--fs-tile); font-weight: 600; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stat .s-k { font-size: var(--fs-cap); color: var(--ink-2); margin-top: 2px; }

/* ── chips ───────────────────────────────────────────────────────────────── */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; background: var(--fill); color: var(--ink-2);
  border-radius: 8px; padding: 5px 10px; min-height: 28px;
}
.chip.accent { color: var(--acc); }
.chip.warn { color: var(--c-gift); background: var(--t-gift); }
.chip.ok { color: var(--c-rent); background: var(--t-rent); font-weight: 600; }

/* ── the money numbers (predicted value · yield · economics) ─────────────── */
.value {
  font-size: var(--fs-big); line-height: 1.08; font-weight: 700;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 2px;
}
.value .cur { color: var(--ink-3); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.val-cap { font-size: var(--fs-cap); color: var(--ink-2); margin-top: 3px; }
.val-cap + .stats { margin-top: 16px; }
.stat .s-v.pos { color: var(--c-rent); }
.stat .s-v.neg { color: var(--c-gift); }
.valrow { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.valrow .psf { font-size: var(--fs-body); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.conf { font-size: var(--fs-cap); color: var(--ink-3); display: inline-flex; align-items: center; gap: 5px; }
.conf .dots { display: inline-flex; gap: 3px; }
.conf .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-4); }
.conf .dots i.on { background: var(--acc); }
.explain { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin-top: 10px; }
.fine { font-size: var(--fs-cap); color: var(--ink-3); margin-top: 8px; }

.sparkwrap { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.delta { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.delta.up { color: var(--acc); }
.delta.down { color: var(--ink); }

/* ── grouped rows — hairline separators inside the card ──────────────────── */
.sub-lbl { font-size: var(--fs-cap); font-weight: 500; color: var(--ink-3); margin-top: 16px; }
.sub-lbl:first-child { margin-top: 0; }
.scope { font-size: 14px; color: var(--ink-2); }
.mixline { font-size: var(--fs-cap); color: var(--ink-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.mixline + .rows { margin-top: 4px; }
.scope + .rows { margin-top: 4px; }

.rw {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 0.5px solid var(--sep);
  min-height: 48px;
}
.rw:last-child { border-bottom: none; padding-bottom: 4px; }
.rows:first-child .rw:first-child { padding-top: 2px; }
.rw .k { font-size: var(--fs-body); color: var(--ink-2); flex: none; }
.rw .v { flex: 1; text-align: right; font-size: var(--fs-body); color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.rw .main { flex: 1; min-width: 0; }
.rw .t1 { font-size: var(--fs-body); font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw .t1 .mut { color: var(--ink-3); font-weight: 400; }
.rw .t2 { font-size: var(--fs-cap); color: var(--ink-2); margin-top: 2px; }
.rw .t3 { font-size: var(--fs-micro); color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw .side { flex: none; text-align: right; }
.rw .side .price { font-size: var(--fs-body); font-weight: 600; font-variant-numeric: tabular-nums; }
.rw .side .pk { font-size: var(--fs-micro); color: var(--ink-3); margin-top: 1px; }
.rw .side .p-est { font-size: var(--fs-micro); color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
/* sister rows — neutral villa/building tile on the left (placeholder glyph) */
.sgl {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); background: var(--fill);
}
.sgl svg { display: block; }
.rw .st { font-size: var(--fs-cap); color: var(--ink-3); }
.rw.tap { cursor: pointer; transition: opacity 120ms var(--out); }
.rw.tap:active { opacity: 0.45; }
.rw .chev { flex: none; color: var(--ink-3); width: 8px; height: 14px; }
.lst-badge { color: var(--acc); font-weight: 500; }
.note { font-size: 14px; color: var(--ink-2); margin-top: 10px; }

/* ── OWNER contact card — the CRM moment ─────────────────────────────────── */
.card.owner {
  background: var(--bg-2);
  background: color-mix(in srgb, var(--acc) 5%, var(--bg-2));
}
.o-hero { display: flex; align-items: center; gap: 13px; }
.o-av {
  flex: none; width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--acc);
  background: var(--fill);
  background: color-mix(in srgb, var(--acc) 14%, transparent);
}
.o-av svg { display: block; fill: currentColor; }
.o-main { flex: 1; min-width: 0; }

/* masked tokens styled as handles — monospace, dim prefix */
.tk {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.tk .tk-pre { color: var(--ink-3); }
.o-name { display: block; font-size: 16.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-kind { font-size: var(--fs-cap); color: var(--ink-2); margin-top: 2px; }
.o-kind.solo { margin: 0 0 4px; }
.card.owner .chip { background: rgba(var(--ink-rgb), 0.06); }
.card.owner .chip.warn { background: var(--t-gift); }

/* contact (phone) rows — token left, tri-channel pills right */
.phlist { margin-top: 14px; }
.ph {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 0.5px solid var(--sep);
  min-height: 54px;
}
.phlist .ph:last-child { padding-bottom: 2px; }
.ph-main { flex: 1; min-width: 0; }
.ph-tk { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-sub { font-size: var(--fs-micro); color: var(--ink-3); margin-top: 1px; }

/* tri-channel pills — call (neutral) · WhatsApp (green) · Telegram (blue).
   Circular icon pills so all three fit beside the token on a 375px screen;
   brand colors keep them instantly readable. All masked → same unlock tap. */
.pills { flex: none; display: flex; gap: 7px; }
.cbtn {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 130ms var(--spring), opacity 130ms var(--out);
}
.cbtn:active { transform: scale(0.88); opacity: 0.85; }
.cbtn svg { display: block; }
.cbtn.call { background: var(--fill); color: var(--ink-2); }
.cbtn.wa { background: var(--wa); color: #fff; }
.cbtn.tg { background: #229ed9; color: #fff; }
.pills.sm { gap: 5px; }
.pills.sm .cbtn { width: 28px; height: 28px; }
.pills.sm .cbtn svg { width: 13px; height: 13px; }

/* previous owners — compact, dimmer */
.prev { margin-top: 4px; }
.pv { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.pv-av {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); background: var(--fill);
}
.pv-av svg { display: block; fill: currentColor; width: 15px; height: 15px; }
.pv-main { flex: 1; min-width: 0; }
.pv-tk { display: block; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-sub { font-size: var(--fs-micro); color: var(--ink-3); margin-top: 1px; }

/* ── satellite banner — the property from above, a dossier visual anchor ── */
.card.sat { padding: 0; overflow: hidden; position: relative; line-height: 0; }
.satimg {
  display: block; width: 100%;
  aspect-ratio: 32 / 21;                    /* the /api/sat tile is 640×420 */
  height: auto; object-fit: cover;
  background: var(--fill);
}
.sat-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.sat-bldg {
  fill: rgba(10, 132, 255, 0.18);
  stroke: #0a84ff; stroke-width: 0.7;
  paint-order: stroke; vector-effect: non-scaling-stroke;
}
.sat-ent {
  fill: #34c759; stroke: #fff; stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
}
.card.plan { line-height: 0; }
.plan-wrap { position: relative; cursor: zoom-in; }
.planimg {
  display: block; width: 100%; height: auto;
  border-radius: 12px; background: #fff;               /* plans are white line-art */
}
.plan-zoom {
  position: absolute; right: 8px; bottom: 8px;
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1; color: #fff;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.plan-cap {
  display: block; margin-top: 9px; line-height: 1.3;
  font-size: var(--fs-micro); color: var(--ink-3); text-align: center;
}
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex; align-items: center; justify-content: center;
  overflow: auto; padding: 16px; line-height: 0;
  opacity: 0; transition: opacity 0.18s ease;
  touch-action: pinch-zoom;
}
.lightbox.in { opacity: 1; }
.lightbox-img {
  width: 100%; max-width: 1400px; height: auto;
  border-radius: 8px; background: #fff;
}
.lightbox-x {
  position: fixed; top: 14px; right: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff; background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
/* history rows — date + BR/size on the left */
.hx-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hx-meta { font-size: var(--fs-micro); color: var(--ink-3); }
.rw.hx { align-items: center; }
.rw.hx .hx-price { margin-left: auto; white-space: nowrap; font-weight: 600; }

/* map deep-links — a tight row of small pills right under the satellite card */
.map-row { display: flex; gap: 8px; margin: 8px 2px 0; }
.map-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 7px 12px; cursor: pointer;
  background: var(--bg-2); color: var(--ink);
  font: 500 13px/1.1 -apple-system, system-ui, sans-serif; letter-spacing: -0.01em;
  transition: transform 130ms var(--spring), opacity 120ms var(--out);
}
.map-pill:active { transform: scale(0.96); opacity: 0.7; }
.map-pill .mp-ico { font-size: 13px; line-height: 1; }
.sat-toggle {
  position: absolute; right: 10px; top: 10px; display: flex;
  border-radius: 9px; overflow: hidden; line-height: 1;
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.sat-toggle .seg {
  border: 0; background: transparent; color: rgba(255, 255, 255, 0.72);
  font: 600 11px/1 -apple-system, system-ui, sans-serif; letter-spacing: 0.02em;
  padding: 6px 11px; cursor: pointer;
}
.sat-toggle .seg.on { background: rgba(255, 255, 255, 0.22); color: #fff; }
.sat-cap {
  position: absolute; left: 10px; bottom: 10px;
  font-size: var(--fs-micro); font-weight: 500; line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-radius: 9px; padding: 5px 9px;
  letter-spacing: 0.02em;
}

/* ── portal badges ───────────────────────────────────────────────────────── */
.pico {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 19px; padding: 0 5px; border-radius: 5px;
  font: 700 11px/1 -apple-system, system-ui, sans-serif; letter-spacing: 0.02em;
  color: #fff; flex: none;
}
.pico-pf { background: #ef4a5b; }
.pico-by { background: #2dbe60; }
.pico-x  { background: var(--ink-3); }

/* ── charts share the card surface — no inner boxes ──────────────────────── */
.chart { margin: 6px 0 2px; }
.sub-lbl + .chart { margin-top: 8px; }
.hist, .vmap { display: block; }
.hist .bar { fill: rgba(var(--ink-rgb), 0.20); }
.hist .axis { stroke: var(--sep); stroke-width: 1; }
.hist .mk { stroke: var(--acc); stroke-width: 1.6; }
.hist .mk-dot { fill: var(--acc); stroke: var(--bg-2); stroke-width: 2.5; }
.axis-lbls {
  display: flex; justify-content: space-between;
  font-size: var(--fs-micro); color: var(--ink-3); margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.chart-legend { display: flex; flex-wrap: wrap; gap: 7px 15px; margin-top: 10px; }
.chart-legend .lg { font-size: var(--fs-cap); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .lg.dim { color: var(--ink-3); }
.chart-legend .sw { width: 9px; height: 9px; border-radius: 2.5px; display: inline-block; flex: none; }
.chart-legend .sw.mkr { background: var(--acc); border-radius: 50%; }
.chart-cap { font-size: var(--fs-cap); color: var(--ink-2); margin-top: 7px; }

svg.spark { display: block; overflow: visible; }
svg.spark .ln { fill: none; stroke: var(--acc); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
svg.spark .dot { fill: var(--acc); }

/* ── tower matrix — one square per unit, one row per floor, top-down ─────── */
.xwrap { overflow-x: auto; }
.matrix { display: flex; flex-direction: column; gap: 2px; width: max-content; min-width: 100%; }
.matrix .flr { display: flex; align-items: center; gap: 8px; }
.matrix .fno {
  flex: none; width: 26px; text-align: right;
  font-size: 10px; line-height: 1; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.matrix .cells { display: flex; gap: var(--cgap, 2px); }
.matrix .c {
  flex: none;
  width: var(--cell, 9px); height: var(--cell, 9px);
  border-radius: 2px;
  background: rgba(var(--ink-rgb), 0.13);
}
.matrix .c.lst { background: var(--acc); opacity: 0.42; }        /* listed = blue */
.matrix .c.cur {                                                 /* this home = red */
  background: var(--xray); opacity: 1; border-radius: 2.5px;
  box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 3.5px var(--xray);
  animation: mpulse 2.4s var(--out) infinite;
}
@keyframes mpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.chart-legend .sw.m-cur { background: var(--xray); }
.chart-legend .sw.m-lst { background: var(--acc); opacity: 0.42; }
.chart-legend .sw.m-oth { background: rgba(var(--ink-rgb), 0.13); }

/* ── villa community map — plot polygons (dot field as fallback), this home
   is the red filled + ringed plot ─────────────────────────────────────────── */
.vmap .vp { fill: rgba(var(--ink-rgb), 0.16); }                  /* others = grey */
.vmap .vp.on { fill: var(--acc); opacity: 0.55; }                /* listed = blue */
.vmap .vp.cur {                                                  /* this home = red */
  fill: var(--xray); opacity: 1;
  stroke: var(--xray); stroke-width: 1.2; stroke-linejoin: round;
  paint-order: stroke;
}
.vmap .vd { fill: rgba(var(--ink-rgb), 0.22); }                   /* others = grey */
.vmap .vd.on { fill: var(--acc); opacity: 0.6; }                 /* listed = blue */
.vmap .pin-ring { fill: none; stroke: var(--xray); stroke-width: 1.5; opacity: 0.5; animation: ppulse 2.4s var(--out) infinite; transform-origin: center; transform-box: fill-box; }
.vmap .pin-halo { fill: var(--bg-2); }
.vmap .pin { fill: var(--xray); }                                /* this home = red */
@keyframes ppulse { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.3); opacity: 0.2; } }
.chart-legend .sw.v-cur { background: var(--xray); border-radius: 50%; }
.chart-legend .sw.v-lst { background: var(--acc); opacity: 0.6; border-radius: 50%; }

/* ── history rows + deal-type badges ─────────────────────────────────────── */
.rw.hx { min-height: 42px; padding: 8px 0; }
.hx-date { flex: none; width: 96px; font-size: var(--fs-cap); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hx-price { flex: 1; text-align: right; font-size: var(--fs-body); font-weight: 600; font-variant-numeric: tabular-nums; }
.tbadge {
  flex: none; display: inline-flex; align-items: center;
  font-size: var(--fs-micro); font-weight: 600; letter-spacing: 0.01em;
  border-radius: 6px; padding: 3px 8px;
}
.b-sale { color: var(--c-sale); background: var(--t-sale); }
.b-rent { color: var(--c-rent); background: var(--t-rent); }
.b-mort { color: var(--c-mort); background: var(--t-mort); }
.b-gift { color: var(--c-gift); background: var(--t-gift); }
.b-lto  { color: var(--c-lto);  background: var(--t-lto); }
.b-oth  { color: var(--ink-2);  background: var(--fill); }

/* ── seller motion ───────────────────────────────────────────────────────── */
.score { display: flex; align-items: baseline; gap: 4px; }
.score .s-big { font-size: var(--fs-tile); font-weight: 700; font-variant-numeric: tabular-nums; }
.score .s-of { font-size: var(--fs-cap); color: var(--ink-2); }

/* meters + agent share bars */
.meter { height: 3px; border-radius: 2px; background: var(--fill-2); overflow: hidden; margin: 9px 0 2px; }
.meter i { display: block; height: 100%; background: var(--acc); border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform 900ms var(--out); }
.abar { height: 3px; border-radius: 2px; background: var(--fill-2); overflow: hidden; margin-top: 7px; max-width: 180px; }
.abar i { display: block; height: 100%; background: var(--acc); border-radius: 2px; }

/* ── project photo slider — bleeds to card edges, snap paging ────────────── */
.photos {
  position: relative;
  margin: calc(-1 * var(--card-y)) calc(-1 * var(--card-x)) 12px;
  border-radius: var(--r) var(--r) 0 0;
  overflow: hidden;
  background: var(--fill);
}
.photos .strip {
  display: flex; overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.photos .strip::-webkit-scrollbar { display: none; }
.photos .slide { flex: 0 0 100%; scroll-snap-align: center; }
.photos img { display: block; width: 100%; height: 190px; object-fit: cover; background: var(--fill); }
.photos .pdots {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: flex; justify-content: center; gap: 5px; pointer-events: none;
}
.photos .pdots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }
.photos .pdots i.on { background: #ffffff; }

/* ── skeleton ────────────────────────────────────────────────────────────── */
.sk { border-radius: 7px; background: var(--fill);
  background: linear-gradient(100deg, var(--fill) 30%, var(--fill-2) 50%, var(--fill) 70%);
  background-size: 200% 100%; animation: shim 1.3s linear infinite; }
@keyframes shim { to { background-position: -200% 0; } }
.sk.line { height: 14px; margin: 10px 0; }
.sk.big { height: 34px; width: 62%; margin: 6px 0 12px; }
.sk.w25 { width: 25%; } .sk.w40 { width: 40%; } .sk.w55 { width: 55%; } .sk.w70 { width: 70%; }
.sec > .sk.line { height: 11px; margin: 0 var(--card-x) 8px; }

/* ── empty / error ───────────────────────────────────────────────────────── */
.empty { padding: 72px 0; text-align: center; color: var(--ink-2); }
.empty .big { font-size: var(--fs-tile); font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.empty .retry { display: inline-flex; align-items: center; margin-top: 14px; color: var(--acc); cursor: pointer; min-height: 44px; font-weight: 500; }

/* ── toast (outside-Telegram fallback for popups) ────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 10px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg);
  font-size: 13px; font-weight: 500;
  padding: 9px 16px; border-radius: 18px; white-space: nowrap;
  transition: opacity 220ms var(--out), transform 220ms var(--out);
  z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── footer ──────────────────────────────────────────────────────────────── */
.foot { margin-top: 40px; color: var(--ink-3); font-size: var(--fs-cap); }
.foot .wm { font-size: var(--fs-body); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 5px; color: var(--ink-2); }
.foot .wm .dot { color: var(--acc); }
.foot .fl { padding: 2px 0; }

/* ── reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 140ms !important; animation-duration: 0.001ms !important; }
  .reveal { transform: none !important; }
  .meter i { transition: none !important; }
  .sk { animation: none !important; background: var(--fill) !important; }
  .matrix .c.cur, .vmap .pin-ring { animation: none !important; }
}
