/* Design tokens (Spec.dc.html) mapped to Telegram theme vars; design light values are fallbacks. */
:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --bg2: var(--tg-theme-secondary-bg-color, #f2f2f7);
  --sec: var(--tg-theme-section-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #111418);
  --hint: var(--tg-theme-hint-color, #666b71);
  --sub: var(--tg-theme-subtitle-text-color, #666b71);
  --link: var(--tg-theme-link-color, #1b67b8);
  --btn: var(--tg-theme-button-color, #1f6fc8);
  --btn-text: var(--tg-theme-button-text-color, #ffffff);
  --accent: var(--tg-theme-accent-text-color, #1b67b8);
  --sh: var(--tg-theme-section-header-text-color, #666b71);
  --sep: var(--tg-theme-section-separator-color, #e4e4ea);
  --danger: var(--tg-theme-destructive-text-color, #c62f35);
  --bar: var(--tg-theme-bottom-bar-bg-color, rgba(255, 255, 255, .94));
  --good: #17733e; --warn: #975600;
  --tint: #e6eef8; --fill: #eff0f4; --good-bg: #e6f2ea; --warn-bg: #faf0e1; --bad-bg: #fbe9ea;
  --hc: rgba(116, 116, 128, .14); --sk: #e8e9ee; --ov: rgba(10, 14, 20, .42);
  --toast: #1d232a; --toast-text: #ffffff; --toast-link: #6ab3f3;
  --tint: color-mix(in srgb, var(--btn) 12%, var(--sec));
  --fill: color-mix(in srgb, var(--hint) 10%, var(--sec));
  --good-bg: color-mix(in srgb, var(--good) 14%, var(--sec));
  --warn-bg: color-mix(in srgb, var(--warn) 14%, var(--sec));
  --bad-bg: color-mix(in srgb, var(--danger) 12%, var(--sec));
  color-scheme: light;
}
/* Dark: data-theme from Telegram.WebApp.colorScheme, or the OS setting outside Telegram. */
:root[data-theme="dark"] {
  --bg: var(--tg-theme-bg-color, #17212b); --bg2: var(--tg-theme-secondary-bg-color, #0e1621); --sec: var(--tg-theme-section-bg-color, #17212b);
  --text: var(--tg-theme-text-color, #f3f5f7); --hint: var(--tg-theme-hint-color, #8595a7); --sub: var(--tg-theme-subtitle-text-color, #8595a7);
  --link: var(--tg-theme-link-color, #6ab3f3); --btn: var(--tg-theme-button-color, #2b6fbd); --accent: var(--tg-theme-accent-text-color, #6ab3f3);
  --sh: var(--tg-theme-section-header-text-color, #8fa3b8); --sep: var(--tg-theme-section-separator-color, #243241); --danger: var(--tg-theme-destructive-text-color, #ff6b6b);
  --bar: var(--tg-theme-bottom-bar-bg-color, rgba(23, 33, 43, .96));
  --good: #52c47f; --warn: #f0a53a; --hc: rgba(255, 255, 255, .10); --sk: #223040; --ov: rgba(0, 0, 0, .55);
  --toast: #e8ecf0; --toast-text: #111418; --toast-link: #1b67b8;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #17212b; --bg2: #0e1621; --sec: #17212b; --text: #f3f5f7; --hint: #8595a7; --sub: #8595a7; --link: #6ab3f3; --btn: #2b6fbd; --accent: #6ab3f3;
    --sh: #8fa3b8; --sep: #243241; --danger: #ff6b6b; --bar: rgba(23, 33, 43, .96);
    --good: #52c47f; --warn: #f0a53a; --hc: rgba(255, 255, 255, .10); --sk: #223040; --ov: rgba(0, 0, 0, .55);
    --toast: #e8ecf0; --toast-text: #111418; --toast-link: #1b67b8; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/20px -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  background: var(--bg2); color: var(--text); overflow-x: hidden; -webkit-tap-highlight-color: transparent;
  padding: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)) var(--tg-safe-area-inset-right, 0px)
    calc(84px + var(--tg-safe-area-inset-bottom, 0px)) var(--tg-safe-area-inset-left, 0px);
}
body.notabs { padding-bottom: calc(24px + var(--tg-safe-area-inset-bottom, 0px)); }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--btn); outline-offset: 2px; }
.i { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.num, .price, .price28, .kpi-v, .srow-v, .frow-r, .stage-n, .kv { font-variant-numeric: tabular-nums; }
hr.sep { border: 0; height: 1px; background: var(--sep); margin: 0; width: 100%; }

/* layout helpers (spacing scale 4/8/12/16/20/24/32) */
.page { display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; }
.stack4, .stack6, .stack8, .stack12, .stack14 { display: flex; flex-direction: column; }
.stack4 { gap: 4px; } .stack6 { gap: 6px; } .stack8 { gap: 8px; } .stack12 { gap: 12px; } .stack14 { gap: 14px; }
.mx16 { margin-left: 16px; margin-right: 16px; }
.mt12 { margin-top: 12px; }
.pad { padding: 8px 16px; }
.pad16 { padding: 16px; }
.pad-t { padding: 14px 16px 6px; }
.gap8 { height: 8px; }
.grow { flex-grow: 1; min-width: 0; }
.center { text-align: center; }
.nudge { margin-top: -6px; }
.offscreen { position: fixed; left: -9999px; top: 0; }

/* type scale 34/28/24/22/17/15/13/11 */
.phead { padding: 8px 16px 4px; display: flex; flex-direction: column; gap: 6px; }
.phead h1 { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -0.02em; }
.phead h1.h22, .h22 { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; }
.phead-sub { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; color: var(--hint); }
.sub15 { font-size: 15px; line-height: 20px; color: var(--sub); }
.t15 { font-size: 15px; line-height: 20px; }
.t15b { font-size: 15px; line-height: 20px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.t13b { font-size: 13px; line-height: 18px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cap { font-size: 13px; line-height: 18px; color: var(--hint); }
.cap b { color: var(--text); font-weight: 600; }
.sub13 { font-size: 13px; line-height: 18px; color: var(--sub); }
.lbl { font-size: 15px; line-height: 20px; }
.hint { color: var(--hint); }
.good { color: var(--good) !important; }
.warn { color: var(--warn) !important; }
.sh { padding: 8px 32px 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--sh); display: flex; justify-content: space-between; }
.sh.in { padding: 12px 16px 4px; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--hint); flex-shrink: 0; display: inline-block; }
.dot.good, .dot.new { background: var(--good); } .dot.new { background: #4cd07d; } .dot.warn { background: var(--warn); } .dot.bad { background: var(--danger); }

/* cards, rows */
.card { background: var(--sec); border-radius: 16px; margin: 0 16px; overflow: hidden; }
.srow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 0 8px 0 16px; text-align: left; }
.srow + .srow, .set + .set, .card > .item + .item, .favitem + .favitem { border-top: 1px solid var(--sep); }
.srow-ic { width: 28px; display: flex; justify-content: center; color: var(--hint); }
.srow-main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; padding: 10px 0; }
.srow-t { font-size: 15px; line-height: 20px; }
.srow-s { font-size: 13px; line-height: 18px; color: var(--hint); }
.srow-v { font-size: 15px; color: var(--text); white-space: nowrap; }
.srow-v.hint { color: var(--hint); }
.srow-chev { width: 28px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--hint); }
.srow-chev.up .i { transform: rotate(180deg); }
.srow.gone { opacity: .55; }
.set.flash, .flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--tint); } }
.set-ed { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.item { padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.iconbtn { width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center; }
.iconbtn.link { color: var(--link); }
.ldot { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; background: var(--hint); display: inline-block; }

/* buttons, chips, segmented, switch, fields */
.btn { height: 44px; padding: 0 16px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; text-align: center; }
.btn.main { height: 50px; font-size: 17px; background: var(--btn); color: var(--btn-text); }
.btn.tint { background: var(--tint); color: var(--link); }
.btn.fill { background: var(--fill); color: var(--text); }
.btn.plain { color: var(--link); }
.btn.ghost { color: var(--hint); font-weight: 400; margin: 4px 16px 0; }
.btn.danger { color: var(--danger); font-weight: 400; margin: 0 16px; }
.state .btn, .page > .btn.tint, .page > .btn.fill { margin: 0 16px; }
.btn2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.link { color: var(--link); min-height: 44px; padding: 0 8px; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; padding: 0 14px; border-radius: 18px; background: var(--fill); color: var(--text); font-size: 15px; display: inline-flex; align-items: center; gap: 6px; position: relative; }
.chip::after { content: ""; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; } /* 44px hit area */
.chip.on { background: var(--tint); color: var(--link); font-weight: 600; }
.favchips .chip.on { background: var(--btn); color: var(--btn-text); }
.seg { padding: 3px; border-radius: 12px; background: var(--hc); display: grid; gap: 3px; }
.seg button { height: 36px; border-radius: 9px; text-align: center; font-size: 15px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button[aria-checked="true"] { background: var(--sec); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--hc); position: relative; flex: none; cursor: pointer; margin: 6px 8px 6px 0; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch:checked { background: var(--btn); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .4; }
.field { height: 44px; padding: 0 12px; border-radius: 10px; background: var(--fill); display: flex; align-items: center; gap: 6px; color: var(--hint); }
.field input { flex-grow: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: 17px; font-weight: 600; padding: 0; outline: none; }
.field input[type=search] { font-weight: 400; }
.field.bad { background: var(--bad-bg); box-shadow: inset 0 0 0 2px var(--danger); }
.unit { font-size: 15px; color: var(--hint); }
.ferr { font-size: 13px; line-height: 18px; color: var(--danger); }
.ferr:empty { display: none; }
select, textarea { width: 100%; border: 0; border-radius: 10px; background: var(--fill); padding: 10px 12px; font-size: 16px; min-height: 44px; }
textarea { resize: vertical; display: block; line-height: 21px; }
.range { width: 100%; height: 32px; accent-color: var(--btn); margin: 0; }

/* badges, pills */
.badge2 { height: 26px; padding: 0 10px; border-radius: 13px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge2.good { background: var(--good-bg); color: var(--good); }
.badge2.warn { background: var(--warn-bg); color: var(--warn); }
.badge2.neutral { background: var(--fill); color: var(--sub); }
.badge2.accent { background: var(--tint); color: var(--link); border-radius: 8px; height: 28px; }
.pill { height: 26px; padding: 0 10px; border-radius: 13px; background: rgba(17, 20, 24, .64); color: #fff; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.pills { display: flex; gap: 8px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill-tab { height: 36px; padding: 0 14px; border-radius: 18px; background: var(--sec); color: var(--text); font-size: 15px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pill-tab[aria-selected="true"] { background: var(--btn); color: var(--btn-text); font-weight: 600; }
.pill-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }

/* flat card */
.fcard { margin: 0 16px; border-radius: 16px; background: var(--sec); overflow: hidden; }
.gal3 { position: relative; display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; height: 228px; width: 100%; background: var(--fill); }
.gal3 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal3 img:first-child { grid-row: 1 / 3; }
.gal3.one { display: block; }
.gal3.one img { height: 228px; }
.gal3.one img + img { display: none; }
.ov { position: absolute; }
.ov.tl { left: 10px; top: 10px; } .ov.tr { right: 10px; top: 10px; } .ov.br { right: 10px; bottom: 10px; } .ov.br2 { right: 14px; bottom: 30px; }
.fcard-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.pricerow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pricerow.end { align-items: flex-end; }
.price { font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.01em; }
.price .per { font-size: 15px; font-weight: 500; color: var(--hint); }
.price28 { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.01em; }
.metro { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 20px; }
.cap.metro { font-size: 13px; gap: 6px; }
.commute { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; line-height: 18px; color: var(--hint); }
.commute span, .iconline { display: inline-flex; align-items: center; gap: 6px; }
.ailine { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 18px; color: var(--sub); }
.ailine.hint { color: var(--hint); }
.note-warn { padding: 12px; border-radius: 12px; background: var(--warn-bg); display: flex; gap: 10px; align-items: flex-start; color: var(--warn); }
.note-t { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--warn); }
.note-s { font-size: 13px; line-height: 18px; color: var(--text); }

/* compact row (Избранное, выборки) */
.frow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 84px; padding: 10px 16px; text-align: left; }
.frow.gone { opacity: .5; }
.thumb { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--fill); display: block; }
.frow-main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.frow-r { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.warnic { color: var(--warn); display: inline-flex; }
.favchips { padding: 0 16px 14px 88px; }
.stages { margin: 0 16px; padding: 4px; border-radius: 16px; background: var(--sec); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.stages button { height: 60px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text); }
.stages button[aria-selected="true"] { background: var(--btn); color: var(--btn-text); }
.stage-n { font-size: 17px; font-weight: 700; }
.stage-t { font-size: 12px; font-weight: 500; }
.listhead { padding: 0 8px 0 16px; display: flex; align-items: center; justify-content: space-between; }
.dealcard { padding: 12px 14px; border-radius: 12px; background: var(--fill); display: flex; justify-content: space-between; gap: 12px; }

/* detail */
.detail { margin-top: calc(-1 * (var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px))); }
.dgal { position: relative; height: 340px; background: var(--fill); }
.gal { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; height: 100%; scrollbar-width: none; }
.gal::-webkit-scrollbar { display: none; }
.gal img { flex: 0 0 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.gdots { position: absolute; left: 0; right: 0; bottom: 34px; display: flex; justify-content: center; gap: 6px; }
.gdot { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .55); transition: width .2s; }
.gdot.on { width: 18px; background: #fff; }
.dsheet { position: relative; margin-top: -20px; border-radius: 20px 20px 0 0; background: var(--bg2); padding: 20px 0 24px; display: flex; flex-direction: column; gap: 12px; }
.dsheet.nogal { margin-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)); }
.dhead { padding: 0 16px 4px; display: flex; flex-direction: column; gap: 6px; }
.dhead .chips { padding-top: 6px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; line-height: 20px; }
.kv > span:first-child { color: var(--sub); }
.kv.b { font-weight: 600; }
.kv.b > span:first-child { color: var(--text); }
.rbar { position: relative; height: 24px; }
.rb-track { position: absolute; left: 0; right: 0; top: 10px; height: 4px; border-radius: 2px; background: var(--fill); }
.rb-band { position: absolute; top: 10px; height: 4px; border-radius: 2px; background: var(--tint); }
.rb-med { position: absolute; top: 6px; width: 2px; height: 12px; background: var(--hint); }
.rb-me { position: absolute; top: 4px; width: 16px; height: 16px; border-radius: 8px; background: var(--good); border: 3px solid var(--sec); }
.notes, .qs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 20px; }
.notes li { display: flex; gap: 10px; }
.notes li .i { color: var(--good); }
.notes li.w .i { color: var(--warn); }
.qs li { display: flex; gap: 12px; }
.qs li .hint { width: 16px; flex-shrink: 0; }
.msg { padding: 12px 14px; border-radius: 12px; background: var(--fill); font-size: 15px; line-height: 21px; white-space: pre-wrap; }
.bbar { position: sticky; bottom: 0; padding: 8px 16px calc(8px + var(--tg-safe-area-inset-bottom, 0px)); background: var(--bar); border-top: 1px solid var(--sep); }

/* stats */
.fstage { display: flex; flex-direction: column; gap: 6px; }
.fbar { height: 10px; border-radius: 5px; background: var(--tint); display: block; }
.fbar.btn { background: var(--btn); }
.fbar.good { background: var(--good); }
.b.good, b.good { color: var(--good); }
.fdrop { padding: 4px 0 4px 12px; font-size: 13px; line-height: 18px; color: var(--hint); }
.fbox { margin: 6px 0; padding: 12px; border-radius: 12px; background: var(--fill); display: flex; flex-direction: column; gap: 8px; }
.frule { display: grid; grid-template-columns: minmax(0, 1fr) 72px 36px; gap: 10px; align-items: center; font-size: 13px; min-height: 32px; text-align: left; }
.frule .num { text-align: right; }
.mini { height: 6px; border-radius: 3px; background: var(--sec); display: flex; }
.mini-fill { height: 6px; border-radius: 3px; background: var(--hint); display: block; }
.srcgrid { padding: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.src { padding: 10px; border-radius: 10px; background: var(--fill); display: flex; flex-direction: column; gap: 4px; }

/* settings */
.searchcard { padding: 14px 12px 14px 16px; border-radius: 16px; background: var(--sec); display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; color: var(--hint); }
.searchcard .t15b { color: var(--text); display: block; }
.diff { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.diff-v { display: flex; align-items: center; gap: 8px; font-size: 17px; line-height: 22px; }
.diff-v > span { color: var(--hint); }
.diff-v .i { color: var(--hint); }
.pauserow { display: flex; gap: 12px; align-items: flex-start; }

/* admin */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpi { padding: 12px 14px; border-radius: 16px; background: var(--sec); display: flex; flex-direction: column; gap: 2px; }
.kpi-v { font-size: 22px; line-height: 28px; font-weight: 700; }
.kpi-v.warn { color: var(--warn); } .kpi-v.bad { color: var(--danger); } .kpi-v.good { color: var(--good); }
.cnt { min-width: 24px; height: 24px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.fbhead { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--tint); color: var(--link); font-weight: 700; font-size: 17px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }

/* onboarding */
.obhead { padding: 8px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.obbar { height: 4px; border-radius: 2px; background: var(--hc); display: block; overflow: hidden; }
.obbar-fill { height: 4px; background: var(--btn); display: block; }

/* states */
.state { margin: 8px 16px 0; padding: 24px; border-radius: 16px; background: var(--sec); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.state h2 { font-size: 22px; line-height: 28px; font-weight: 700; }
.state p { font-size: 15px; line-height: 20px; color: var(--sub); }
.state .btn { margin: 6px 0 0; align-self: stretch; }
.state-ic { width: 56px; height: 56px; border-radius: 28px; background: var(--tint); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.state-ic.sm { width: 40px; height: 40px; border-radius: 20px; }
.skel { height: 96px; border-radius: 16px; margin: 8px 0; background: var(--sk); animation: pulse 1.2s ease-in-out infinite; }
.skel:first-child { height: 300px; }
@keyframes pulse { 50% { opacity: .55; } }

/* toast, sheet, tab bar */
.toast-wrap { position: fixed; left: 12px; right: 12px; bottom: calc(80px + var(--tg-safe-area-inset-bottom, 0px)); z-index: 20; }
.notabs .toast-wrap { bottom: calc(12px + var(--tg-safe-area-inset-bottom, 0px)); }
.toast { position: relative; min-height: 52px; padding: 4px 6px 4px 14px; border-radius: 14px; background: var(--toast); color: var(--toast-text); overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .22); display: flex; flex-direction: column; justify-content: center; }
.toast-row { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.toast-btn { height: 44px; padding: 0 12px; border-radius: 10px; color: var(--toast-link); font-size: 15px; font-weight: 600; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--toast-link); transform-origin: left; animation: shrink linear forwards; }
@keyframes shrink { to { transform: scaleX(0); } }
.sheet-bg { position: fixed; top: 0; left: 0; right: 0; bottom: 0; min-height: 100lvh; background: var(--ov); z-index: 30; display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--sec); border-radius: 20px 20px 0 0; padding: 8px 16px calc(16px + var(--tg-safe-area-inset-bottom, 0px)); max-height: 85vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.handle { width: 36px; height: 5px; border-radius: 3px; background: var(--sep); align-self: center; }
.sheet h2 { font-size: 22px; line-height: 28px; font-weight: 700; padding-top: 12px; }
.sheet-btns { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--bar); border-top: 1px solid var(--sep);
  padding: 6px calc(6px + var(--tg-safe-area-inset-right, 0px)) calc(8px + var(--tg-safe-area-inset-bottom, 0px)) calc(6px + var(--tg-safe-area-inset-left, 0px));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.tabs.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tab { height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--hint); font-size: 11px; line-height: 13px; font-weight: 500; position: relative; text-align: center; }
.tab[aria-selected="true"] { color: var(--accent); font-weight: 600; }
.badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.img-none{display:none!important}
html{touch-action:pan-x pan-y}
.row-sb{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.btn.more{width:100%;justify-content:center;gap:4px;color:var(--link)}
.bullet{position:relative;padding-left:16px}.bullet::before{content:'•';position:absolute;left:2px;color:var(--hint)}
.dot.off{background:#e8ecf0}.ustat{display:inline-flex;align-items:center;gap:6px;color:var(--hint);font-size:13px;white-space:nowrap}
/* status dots pulse: soft brightness + fading ring in the dot's own colour (metro .ldot excluded) */
.dot.good,.dot.new,.dot.warn,.dot.bad,.dot.off{position:relative;animation:dot-pulse 2s ease-in-out infinite}
.dot.good::after,.dot.new::after,.dot.warn::after,.dot.bad::after,.dot.off::after{content:'';position:absolute;inset:0;border-radius:50%;background:inherit;animation:dot-ring 2s ease-out infinite}
@keyframes dot-pulse{0%,100%{opacity:1}50%{opacity:.6}}
@keyframes dot-ring{0%{transform:scale(1);opacity:.55}80%,100%{transform:scale(2.6);opacity:0}}
@media (prefers-reduced-motion:reduce){.dot,.dot::after{animation:none!important}}
.fab { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabs-h, 64px) + 10px); z-index: 11; }
.fab .btn.main { width: 100%; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.fab .btn.main:disabled { opacity: .6; }
body.has-fab .page { padding-bottom: 84px; }


/* admin: access requests, user switches */
.btnrow { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.btn.sm { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn.sm.main { height: 32px; font-size: 13px; }
label.ustat { cursor: pointer; }

/* map (Leaflet): feed header button, full-height box, price pins */
.headrow { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.headrow .phead { flex: 1; min-width: 0; }
.btn.maplink { margin: 16px 16px 0 0; flex-shrink: 0; }
.mapbox { height: calc(100dvh - 190px - var(--tg-safe-area-inset-top, 0px) - var(--tg-content-safe-area-inset-top, 0px)); min-height: 320px;
  margin: 0 16px 8px; border-radius: 12px; overflow: hidden; background: var(--fill); }
.mappage .cap { font-size: 11px; }
.mapbox.mini { height: 210px; min-height: 0; margin: 12px 16px 0; cursor: pointer; }
.skelbox { background: var(--fill); }
.pin { width: 0; height: 0; overflow: visible; }
.pin b { position: absolute; left: 0; top: 0; background: var(--btn); color: var(--btn-text); font: 600 12px/1 system-ui, sans-serif; padding: 5px 7px;
  border-radius: 10px; white-space: nowrap; transform: translate(-50%, -130%); box-shadow: 0 1px 3px rgba(0,0,0,.25); border: 1.5px solid #fff; }
.pin.approx b { background: var(--sec); color: var(--text); border-style: dashed; border-color: var(--btn); }
.pin.fav b { background: #e0a800; color: #1b1b1b; }
.pin.focus { z-index: 1000 !important; }
.pin.focus b { background: #d93f3f; color: #fff; font-size: 14px; }
.leaflet-container { font: inherit; }
.pin.work b { background: #1b1b1b; color: #fff; }

/* feed: line between flats from not-yet-seen checks and the seen ones */
.feedsep { display: flex; align-items: center; gap: 10px; margin: 4px 16px 12px; color: var(--hint); font-size: 13px; }
.feedsep::before, .feedsep::after { content: ''; flex: 1; height: 1px; background: color-mix(in srgb, var(--hint) 45%, transparent); }
