/* Adonis — дизайн-система мини-аппа и админки.

   Поверхности и текст берутся из темы Telegram (core.js / admin-core.js кладут
   themeParams в --paper/--surface/--ink…), поэтому приложение родное и в светлой,
   и в тёмной теме. Свой у бренда — один акцент: кобальт чешской эмалевой таблички
   с номером дома. Им же оформлена комнатность («2+kk») — главный узнаваемый элемент.
   Остальное намеренно тихое. */

:root {
  --paper: #ffffff;
  --surface: #f3f4f6;
  --ink: #111418;
  --ink-2: #5d6470;
  --ink-3: #686e79;
  --line: rgba(17, 20, 24, 0.1);
  --fill: rgba(17, 20, 24, 0.055);

  --cobalt: #1d4fa8;          /* заливки: табличка, кнопки (белый текст 7.7:1) */
  --cobalt-text: #1d4fa8;     /* кобальт как цвет текста */
  --cobalt-ink: #ffffff;
  --cobalt-soft: rgba(29, 79, 168, 0.1);
  --fresh: #187a4c;
  --alert: #c8102e;
  --alert-soft: rgba(200, 16, 46, 0.09);

  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-plate: 5px;
  --r-ctl: 12px;
  --r-thumb: 12px;
  --r-sheet: 22px;

  --pad: 16px;
  /* движение: пружина iOS для шторок/карточки, мягкий выход для остального */
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --tab-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15171b;
    --surface: #1e2126;
    --ink: #eef0f3;
    --ink-2: #a3a9b3;
    --ink-3: #8f96a1;
    --line: rgba(238, 240, 243, 0.12);
    --fill: rgba(238, 240, 243, 0.08);
    --cobalt: #3a6bd0;
    --cobalt-text: #5b8cf0;
    --cobalt-soft: rgba(74, 127, 224, 0.16);
    --fresh: #3fbf82;
    --alert: #ff5a6e;
    --alert-soft: rgba(255, 90, 110, 0.13);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15171b;
  --surface: #1e2126;
  --ink: #eef0f3;
  --ink-2: #a3a9b3;
  --ink-3: #8f96a1;
  --line: rgba(238, 240, 243, 0.12);
  --fill: rgba(238, 240, 243, 0.08);
  --cobalt: #3a6bd0;
  --cobalt-text: #5b8cf0;
  --cobalt-soft: rgba(74, 127, 224, 0.16);
  --fresh: #3fbf82;
  --alert: #ff5a6e;
  --alert-soft: rgba(255, 90, 110, 0.13);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--cobalt-text); }
img { display: block; max-width: 100%; }
[hidden], .hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- текст ---------- */
.h1 { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.h2 { font-size: 20px; line-height: 1.25; font-weight: 650; letter-spacing: -0.015em; margin: 0; }
.h3 { font-size: 15px; font-weight: 600; margin: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- эмалевая табличка: комнатность ---------- */
.plate {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.6em; padding: 2px 7px 1px;
  background: var(--cobalt); color: var(--cobalt-ink);
  border: 2px solid var(--cobalt); border-radius: var(--r-plate);
  box-shadow: inset 0 0 0 1px var(--cobalt-ink);
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.25;
  white-space: nowrap;
}
.plate.lg { font-size: 16px; padding: 3px 10px 2px; border-width: 2.5px; box-shadow: inset 0 0 0 1.5px var(--cobalt-ink); }
.plate.ghost { background: transparent; color: var(--ink-2); border-color: var(--line); box-shadow: none; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border: 0; border-radius: var(--r-ctl);
  background: var(--cobalt); color: var(--cobalt-ink);
  font-size: 16px; font-weight: 600; text-decoration: none;
  transition: transform 0.22s var(--ease-out), opacity 0.2s ease, background-color 0.2s ease;
}
.btn:active { transform: scale(0.97); transition-duration: 0.08s; }
.btn:disabled { opacity: 0.45; }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn.soft { background: var(--cobalt-soft); color: var(--cobalt-text); }
.btn.quiet { background: var(--fill); color: var(--ink); }
.btn.danger { background: var(--alert-soft); color: var(--alert); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.text { background: none; color: var(--cobalt-text); padding: 0 4px; min-height: 40px; font-weight: 500; }
.iconbtn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink);
}
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn.onphoto { background: rgba(10, 12, 15, 0.55); color: #fff; backdrop-filter: blur(8px); }
.spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- поля ---------- */
.input {
  width: 100%; min-height: 46px; padding: 0 14px;
  border: 0; border-radius: var(--r-ctl); background: var(--fill);
  font-size: 16px; outline: none;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { box-shadow: inset 0 0 0 1.5px var(--cobalt); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.with-unit { position: relative; }
.with-unit .input { padding-right: 42px; }
.with-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 14px; pointer-events: none; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* выбор вариантов: невыбранный — контур, выбранный — табличка */
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  min-height: 40px; padding: 0 14px; border-radius: 10px;
  background: transparent; border: 1.5px solid var(--line); color: var(--ink);
  font-size: 15px; font-weight: 500;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.2s var(--ease-out);
}
.opt:active { transform: scale(0.96); transition-duration: 0.08s; }
.opt.on { background: var(--cobalt); border-color: var(--cobalt-text); color: var(--cobalt-ink); }
.opts.rooms { display: grid; grid-template-columns: repeat(4, 1fr); }
.opt.room { min-width: 0; font-weight: 650; letter-spacing: 0.02em; border-radius: var(--r-plate); }
.opt.room.on { box-shadow: inset 0 0 0 1px var(--cobalt-ink), inset 0 0 0 3px var(--cobalt); }

/* переключатель */
.switch { display: flex; align-items: center; gap: 12px; min-height: 52px; cursor: pointer; }
.switch .grow { flex: 1; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 50px; height: 30px; border-radius: 15px; background: var(--fill);
  position: relative; transition: background-color 0.25s ease, box-shadow 0.25s ease; flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px var(--line);
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.32s var(--ease-spring);
}
.switch input:checked + .track { background: var(--cobalt); box-shadow: none; }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--cobalt); outline-offset: 2px; }

/* ---------- группы строк (iOS-подобный список без карточного «кита») ---------- */
.group { background: var(--surface); border-radius: 16px; padding: 0 var(--pad); }
.group > * + * { border-top: 1px solid var(--line); }
.line {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 0;
  background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%;
  text-align: left; color: var(--ink); text-decoration: none;
}
.group > .line:first-child { border-top: 0; }
.line .grow { flex: 1; min-width: 0; }
.line .t { font-size: 16px; }
.line .s { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.line .v { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.line.danger .t { color: var(--alert); }
.chev { width: 8px; height: 13px; color: var(--ink-3); flex: 0 0 auto; }

.label { font-size: 15px; font-weight: 600; margin: 26px 0 10px; }
.label:first-child { margin-top: 8px; }
.hint { font-size: 13px; color: var(--ink-2); margin: 8px 2px 0; line-height: 1.45; }

/* ---------- статус-точки и метки ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); display: inline-block; flex: 0 0 auto; }
.dot.ok { background: var(--fresh); }
.dot.bad { background: var(--alert); }
.dot.warn { background: #d9a400; }
.tag { font-size: 13px; color: var(--ink-2); }
.tag.fresh { color: var(--fresh); font-weight: 600; }
.tag.alert { color: var(--alert); font-weight: 600; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 13px; background: var(--fill); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.pill.pro { background: var(--cobalt); color: var(--cobalt-ink); }
.pill.ok { background: rgba(30, 142, 90, 0.12); color: var(--fresh); }
.pill.bad { background: var(--alert-soft); color: var(--alert); }

/* ---------- плашки-сообщения ---------- */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px var(--pad); border-radius: 14px; background: var(--surface);
  font-size: 14px; line-height: 1.45;
}
.notice svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }
.notice.cobalt { background: var(--cobalt-soft); color: var(--ink); }
.notice.cobalt svg { color: var(--cobalt-text); }
.notice.alert { background: var(--alert-soft); }
.notice.alert svg { color: var(--alert); }
.notice b { font-weight: 650; }
.notice.tap { cursor: pointer; width: 100%; border: 0; text-align: left; }

.empty { text-align: center; padding: 56px 24px; color: var(--ink-2); }
.empty .h2 { color: var(--ink); margin-bottom: 8px; }
.empty .btn { margin-top: 18px; }

/* ---------- тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 90;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 500;
  transition: opacity 0.3s ease, transform 0.45s var(--ease-spring);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.act { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding-right: 8px; width: max-content; }
.toast.act span { white-space: nowrap; }
.toast-act {
  border: 0; background: none; color: var(--paper); font: 650 14px var(--font);
  padding: 6px 10px; border-radius: 9px; text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- скелетон загрузки ---------- */
.skel { background: var(--fill); border-radius: 8px; position: relative; overflow: hidden; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- шторка ---------- */
.modal {
  position: fixed; inset: 0; z-index: 70; background: rgba(5, 7, 10, 0.42);
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.modal.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto;
  background: var(--paper); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 8px var(--pad) calc(20px + var(--safe-b));
  transform: translateY(100%); transition: transform 0.5s var(--ease-spring); will-change: transform;
}
.modal.open .sheet { transform: none; }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* ================= МИНИ-АПП ================= */
.app { max-width: 640px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 12px); }

.top {
  position: sticky; top: 0; z-index: 20; background: var(--paper);
  padding: 12px var(--pad) 10px;
}
.top.scrolled { box-shadow: 0 1px 0 var(--line); }
.brandrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; margin-bottom: 10px; }
.wordmark { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.wordmark span { color: var(--ink-3); font-weight: 500; margin-left: 6px; }

.searchrow { display: flex; gap: 8px; }
.search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 14px; border: 0; border-radius: var(--r-ctl);
  background: var(--fill); text-align: left; color: var(--ink-3); font-size: 16px;
}
.search svg { width: 19px; height: 19px; flex: 0 0 auto; }
.search .q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search .q.on { color: var(--ink); font-weight: 500; }
.filterbtn {
  position: relative; width: 46px; min-height: 46px; border: 0; border-radius: var(--r-ctl);
  background: var(--fill); color: var(--ink); display: grid; place-items: center;
}
.filterbtn svg { width: 21px; height: 21px; }
.filterbtn.on { background: var(--cobalt); color: var(--cobalt-ink); }
.filterbtn i {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--ink); color: var(--paper);
  font: 700 11px/19px var(--font); font-style: normal; text-align: center;
}

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px var(--pad) 2px; margin: 0 calc(-1 * var(--pad)); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 17px; border: 1.5px solid var(--line);
  background: transparent; color: var(--ink); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.2s var(--ease-out);
}
.chip:active { transform: scale(0.96); transition-duration: 0.08s; }
.chip svg { width: 14px; height: 14px; color: var(--ink-3); }
.chip.on { border-color: transparent; background: var(--cobalt-soft); color: var(--cobalt-text); }
.chip.on svg { color: var(--cobalt-text); }

.main { padding: 4px var(--pad) 0; position: relative; }
.main.anim { transition: transform 0.45s var(--ease-spring); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.view-in { animation: viewIn 0.28s var(--ease-out); }
.fade-in { animation: fadeIn 0.3s ease; }

/* потянуть вниз — обновить ленту: индикатор растёт за пальцем, после порога стрелка разворачивается */
.ptr {
  position: absolute; left: 0; right: 0; top: -56px; height: 56px;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.ptr-ic {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cobalt-soft); color: var(--cobalt-text);
  opacity: 0; transition: transform 0.25s var(--ease-out), opacity 0.2s ease;
}
.ptr-ic svg { width: 18px; height: 18px; }
.ptr.ready .ptr-ic { transform: rotate(180deg); }
.ptr.loading .ptr-ic svg { display: none; }
.ptr.loading .ptr-ic::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite;
}
.feedhead { display: flex; align-items: baseline; justify-content: space-between; margin: 10px 0 2px; }
.feedhead .count { font-size: 13px; color: var(--ink-2); }

/* строка объявления */
.lot {
  display: grid; grid-template-columns: 108px 1fr; gap: 14px;
  padding: 14px 0; border: 0; border-bottom: 1px solid var(--line);
  background: none; width: 100%; text-align: left; color: var(--ink); cursor: pointer;
  transition: opacity 0.25s ease;
}
.lot:active { opacity: 0.55; transition-duration: 0.06s; }
.lot .ph img { transition: opacity 0.35s ease; }
.lot:last-child { border-bottom: 0; }
.lot .ph {
  width: 108px; height: 108px; border-radius: var(--r-thumb); object-fit: cover;
  background: var(--fill); position: relative; overflow: hidden;
}
.lot .ph img { width: 100%; height: 100%; object-fit: cover; }
.lot .ph .n {
  position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 6px;
  background: rgba(10, 12, 15, 0.6); color: #fff; font-size: 11px; font-weight: 600;
}
.lot .ph.none { display: grid; place-items: center; color: var(--ink-3); font-size: 12px; }
.lot .info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lot .r1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lot .price { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.lot .price small { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-left: 3px; letter-spacing: 0; }
.lot .when { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.lot .when.fresh { color: var(--fresh); font-weight: 600; }
.lot .break { font-size: 12.5px; color: var(--ink-3); margin-top: -2px; }
.lot .r2 { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.lot .where { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lot .flags { font-size: 12.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.lot .flags .owner { color: var(--fresh); font-weight: 600; }

/* обёртка строки: сердце лежит поверх фото, но вне <button class="lot"> */
.lotw { position: relative; overflow: hidden; transition: height 0.3s var(--ease-out), opacity 0.25s ease; }
.lotw .lot { position: relative; z-index: 1; background: var(--paper); transition: transform 0.35s var(--ease-spring), opacity 0.25s ease; }
.lotw::after { /* подложка свайпа «удалить» */
  content: "Удалить"; position: absolute; inset: 14px 0 14px auto; width: 50%;
  display: flex; align-items: center; justify-content: flex-end; padding-right: 18px;
  border-radius: var(--r-thumb); background: var(--fill); color: var(--ink-2); font-weight: 600; font-size: 14px;
}
.lotw.arm::after { background: var(--alert); color: #fff; }
.lotw.leaving { height: 0 !important; opacity: 0; }
.heart {
  position: absolute; z-index: 2; top: 20px; left: 6px; width: 34px; height: 34px;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(10, 12, 15, 0.42); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.heart svg { width: 18px; height: 18px; }
.heart.on { color: #ff4d64; background: rgba(255, 255, 255, 0.92); }
.heart.pop svg { animation: heartPop 0.42s var(--ease-spring); }
@keyframes heartPop { 0% { transform: scale(0.6); } 55% { transform: scale(1.22); } 100% { transform: scale(1); } }
.heart.inbar { position: static; width: 46px; height: 46px; flex: 0 0 auto; border-radius: var(--r-ctl); background: var(--fill); color: var(--ink); -webkit-backdrop-filter: none; backdrop-filter: none; }
.heart.inbar svg { width: 22px; height: 22px; }
.heart.inbar.on { color: var(--alert); background: var(--alert-soft); }
@media (prefers-reduced-motion: reduce) { .heart.pop svg { animation: none; } }

/* избранное: сегменты, снятые карточки, изменение цены */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: var(--r-ctl); background: var(--fill); }
.segbtn {
  border: 0; border-radius: 9px; background: none; color: var(--ink-2); height: 36px;
  font: 600 14px var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.segbtn span { font-weight: 500; color: var(--ink-3); font-size: 13px; }
.segbtn.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.delta { font-size: 12.5px; font-weight: 600; margin-top: -2px; }
.delta.down { color: var(--fresh); }
.delta.up { color: var(--ink-3); }
.gonehead { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.gonehead .label { margin: 18px 0 2px; color: var(--ink-2); }
.lotw.gone .lot { border-bottom: 0; padding-bottom: 8px; }
.lotw.gone .ph img { filter: grayscale(1); opacity: 0.55; }
.lotw.gone .price { color: var(--ink-3); font-size: 17px; }
.lotw.gone .price small { margin: 0 2px 0 0; color: var(--ink-3); }
.lotw.gone .r2, .lotw.gone .where { color: var(--ink-3); }
.goneflag { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--alert); }
.goneflag svg { width: 15px; height: 15px; flex: 0 0 auto; }
.goneacts { display: flex; gap: 8px; padding: 0 0 14px 122px; border-bottom: 1px solid var(--line); position: relative; z-index: 1; background: var(--paper); }
.simlist .lotw:last-child .lot { border-bottom: 0; }
#fav-controls .chips { padding-top: 12px; }

.lot.sk { cursor: default; }
.lot.sk .ph { animation: none; }

.more { display: flex; justify-content: center; padding: 18px 0 8px; }

/* полноэкранная карточка */
/* Внутри карточки ничего не position: fixed — у слоя с transform «fixed»-дети
   прилипают к нему, а не к экрану, и нижняя панель уезжала в середину (Android
   Telegram). Панель и «Назад» — sticky внутри прокручиваемой карточки. */
.cover {
  position: fixed; inset: 0; z-index: 60; background: var(--paper); overflow-y: auto;
  transform: translateY(100%); transition: transform 0.5s var(--ease-spring);
  display: flex; flex-direction: column;
}
#cover-body { flex: 1 0 auto; display: flex; flex-direction: column; }
.cover.open { transform: none; }
/* прокрутка карточки/шторки не «проваливается» в ленту под ними */
.cover, .sheet { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
body.scroll-locked { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
.cover .bar {
  position: sticky; top: 0; z-index: 3; height: 0; overflow: visible; flex: 0 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 0 12px; pointer-events: none;
}
.cover .bar .iconbtn { margin-top: 12px; }
.cover .bar .iconbtn { pointer-events: auto; }
.gal { position: relative; background: var(--fill); }
.gal .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gal .track::-webkit-scrollbar { display: none; }
.gal img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: center; }
.gal .count {
  position: absolute; right: 12px; bottom: 12px; padding: 3px 9px; border-radius: 10px;
  background: rgba(10, 12, 15, 0.6); color: #fff; font-size: 12.5px; font-weight: 600;
}
.gal.none { height: 120px; }
.dbody { width: 100%; max-width: 640px; margin: 0 auto; padding: 18px var(--pad) 24px; }
.cover .gal { width: 100%; }
.dhead { display: flex; flex-direction: column; gap: 10px; }
.dhead .where { color: var(--ink-2); font-size: 15px; }
.dprice { margin-top: 20px; }
.dprice .total { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.dprice .total small { font-size: 16px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-left: 4px; }
.costs { margin-top: 12px; }
.costs .line { min-height: 44px; padding: 10px 0; }
.costs .line .t { font-size: 15px; color: var(--ink-2); }
.costs .line .v { color: var(--ink); font-weight: 600; }
.costs .line.sum .t { color: var(--ink); font-weight: 600; }
.costs .line .v.na { color: var(--ink-3); font-weight: 500; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; margin-top: 22px; }
.facts div { background: var(--surface); padding: 12px 14px; }
.facts dt { font-size: 12.5px; color: var(--ink-3); margin: 0; }
.facts dd { font-size: 15px; font-weight: 600; margin: 2px 0 0; }
.facts div:last-child:nth-child(odd) { grid-column: 1 / -1; }
/* в Telegram есть родная кнопка «Назад» — своя плавающая не нужна и перекрывала бы текст */
[data-tg] .cover .bar { display: none; }
.lede { font-size: 17px; line-height: 1.5; margin: 24px 0 0; }
.prose { font-size: 15px; line-height: 1.6; color: var(--ink); white-space: pre-line; margin: 0; }
.prose.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.source { font-size: 13px; color: var(--ink-3); margin-top: 22px; }
.dfoot {
  position: sticky; bottom: 0; z-index: 4; margin-top: auto;
  background: var(--paper); box-shadow: 0 -1px 0 var(--line);
  padding: 10px var(--pad) calc(10px + var(--safe-b));
}
.dfoot .in { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; }
.dfoot .btn { flex: 1; }
.dfoot .btn.quiet { flex: 0 0 52px; padding: 0; }
.dfoot .btn svg { width: 21px; height: 21px; }

/* экран фильтров */
.screen-head {
  position: sticky; top: 0; z-index: 20; background: var(--paper);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px var(--pad) 8px; max-width: 640px; margin: 0 auto;
}
.fbody { padding: 0 var(--pad); }
.fbody .label .lock { font-weight: 500; color: var(--cobalt-text); font-size: 13px; margin-left: 6px; }
/* подсказки города — те же строки, что .line: текст по центру строки, число справа */
.sugg { margin-top: 6px; border-radius: var(--r-ctl); background: var(--surface); overflow: hidden; }
.sugg button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px;
  border: 0; background: none; text-align: left; font: inherit; font-size: 16px; line-height: 1.25;
  color: var(--ink); position: relative; transition: background-color 0.12s;
}
.sugg button > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg button + button::before {
  content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--line);
}
.sugg button:active, .sugg button:focus-visible { background: var(--line); outline: none; }
.sugg .n { flex: none; font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ffoot {
  position: sticky; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 5; background: var(--paper);
  padding: 12px var(--pad); margin-top: 24px; box-shadow: 0 -1px 0 var(--line);
  display: flex; gap: 8px;
}
.ffoot .btn:first-child { flex: 1; }

/* тарифы */
.plans { display: grid; gap: 8px; margin: 16px 0; }
.plan {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px;
  border-radius: 14px; border: 1.5px solid var(--line); background: none; text-align: left; width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease-out);
}
.plan:active { transform: scale(0.985); }
.plan .grow { flex: 1; }
.plan .t { font-size: 16px; font-weight: 600; }
.plan .s { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.plan .p { font-size: 16px; font-weight: 700; white-space: nowrap; }
.plan.on { border-color: var(--cobalt-text); box-shadow: inset 0 0 0 1px var(--cobalt); }
.plan .best { font-size: 12px; font-weight: 600; color: var(--cobalt-text); background: var(--cobalt-soft); padding: 2px 7px; border-radius: 6px; margin-left: 8px; vertical-align: 2px; }
.benefits { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.benefits li { display: flex; gap: 10px; font-size: 15px; }
.benefits svg { width: 20px; height: 20px; color: var(--cobalt-text); flex: 0 0 auto; margin-top: 1px; }

/* таб-бар */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--paper); box-shadow: 0 -1px 0 var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar .in { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--tab-h); }
.tab {
  border: 0; background: none; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; font-weight: 600;
}
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--cobalt-text); }
.tabic { position: relative; display: grid; }
.tabic i {
  position: absolute; top: -4px; left: 15px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--alert); color: #fff;
  font: 700 10.5px/18px var(--font); font-style: normal; text-align: center;
  box-shadow: 0 0 0 2px var(--paper);
}

/* ================= АДМИНКА ================= */
.ch-preview { padding: 12px 0; }
.post-preview { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.adm { min-height: 100vh; }
.adm-side { display: none; }
.adm-top {
  position: sticky; top: 0; z-index: 20; background: var(--paper);
  padding: 12px var(--pad) 0; box-shadow: 0 1px 0 var(--line);
}
.adm-top .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.adm-nav { display: flex; gap: 4px; overflow-x: auto; margin: 8px calc(-1 * var(--pad)) 0; padding: 0 var(--pad); scrollbar-width: none; }
.adm-nav::-webkit-scrollbar { display: none; }
.adm-nav button {
  flex: 0 0 auto; border: 0; background: none; color: var(--ink-2);
  padding: 10px 10px 12px; font-size: 15px; font-weight: 600; position: relative;
}
.adm-nav button[aria-selected="true"] { color: var(--ink); }
.adm-nav button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2.5px;
  border-radius: 2px; background: var(--cobalt);
}
.adm-main { padding: 8px var(--pad) 48px; max-width: 880px; }
.adm-main .label:first-child { margin-top: 18px; }
.readout .line { min-height: 46px; padding: 10px 0; }
.readout .line .t { font-size: 15px; }
.readout .line .v { color: var(--ink); font-weight: 650; font-size: 16px; }
.readout .line .v.warn { color: #b27b00; }
.readout .line .v.bad { color: var(--alert); }
.split { display: grid; gap: 0 24px; }
/* панель: плитки, графики, полосы */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.kpi { background: var(--surface); border-radius: 16px; padding: 14px 16px; }
.kpi .kv { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .kk { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }
.kpi .ks { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.kpi.warn .kv { color: #b27b00; }
.chartcard { background: var(--surface); border-radius: 16px; padding: 14px 16px 10px; margin-top: 14px; }
.chartcard .ct { font-size: 15px; font-weight: 650; }
.chartcard .cs { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.chartbox { position: relative; height: 220px; margin-top: 10px; }
.periods { display: flex; gap: 8px; margin-top: 16px; }
.bar { height: 6px; border-radius: 3px; background: var(--fill); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--cobalt); border-radius: 3px; }
.bar i.hot { background: var(--alert); }
.funnel .v { font-weight: 650; }
.qpos { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 6px; background: var(--fill); color: var(--ink-2); font: 600 12px/22px var(--font); text-align: center; }
.dot.warn { background: #d29a12; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.ch-panel { margin-top: 12px; }
.ch-panel .head { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.ch-panel .head .grow { flex: 1; min-width: 0; }
.ch-panel .head .t { font-size: 17px; font-weight: 650; }
.ch-panel .head .s { font-size: 13px; color: var(--ink-2); }
.formrow { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; }
.formrow > label, .formrow > .k { flex: 1; font-size: 15px; }
.formrow .input { width: 96px; min-height: 40px; text-align: right; }
.formrow .input.wide { width: 60%; text-align: left; }
.formrow .rate { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; }
.formrow .rate .input { width: 64px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 14px; }
.logs {
  font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word;
  background: var(--surface); border-radius: 14px; padding: 14px; margin: 16px 0 0; color: var(--ink-2);
}
.logs .lv-error { color: var(--alert); }
.logs .lv-warning { color: #b27b00; }
.searchbar { margin-top: 16px; }
.alot { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 0; text-decoration: none; color: var(--ink); }
.alot img, .alot .ph { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--fill); }
.alot .t { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.alot .s { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.urow { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.urow .grow { flex: 1; min-width: 0; }
.urow .t { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.urow .s { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

.login { max-width: 380px; margin: 0 auto; padding: 18vh 24px 40px; }
.login .wordmark { font-size: 22px; }
.login p { color: var(--ink-2); margin: 6px 0 28px; }
.login .stack { display: grid; gap: 10px; }
.login .err { color: var(--alert); font-size: 14px; min-height: 20px; margin-top: 12px; }

@media (min-width: 900px) {
  .adm { display: grid; grid-template-columns: 232px 1fr; }
  .adm-side {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh;
    padding: 22px 14px; border-right: 1px solid var(--line);
  }
  .adm-side .wordmark { padding: 0 10px 20px; }
  .adm-side button {
    border: 0; background: none; text-align: left; color: var(--ink-2);
    padding: 10px 12px; border-radius: 10px; font-size: 15px; font-weight: 550;
  }
  .adm-side button[aria-selected="true"] { background: var(--cobalt-soft); color: var(--cobalt-text); }
  .adm-side .grow { flex: 1; }
  .adm-top { position: static; box-shadow: none; padding: 22px 32px 0; max-width: 880px; }
  .adm-top .wordmark, .adm-nav { display: none; }
  .adm-main { padding: 0 32px 64px; }
  .split { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .adm-main, .adm-top { max-width: 1040px; }
}
