/* MSR — минималистичный интерфейс. Мобильный первым. */

@font-face {
  font-family: 'Manrope';
  font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/fonts/manrope-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/fonts/manrope-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+20B8;
}

:root {
  --bg: #f5f5f2;
  --surface: #ffffff;
  --surface-2: #efeeea;
  --text: #141414;
  --muted: #6e6e69;
  --faint: #a3a29c;
  --line: #e6e5e0;
  --accent: #12a37b;
  --accent-ink: #0b7a5b;
  --accent-weak: #e2f4ed;
  --warn-ink: #9a6412;
  --warn-weak: #f9efdc;
  --danger: #c2412d;
  --danger-weak: #fbe9e5;
  --btn: #141414;
  --btn-ink: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
  --radius: 14px;
  --radius-sm: 10px;
  --top-h: 56px;
  --tab-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --maxw: 640px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f; --surface: #191918; --surface-2: #232321; --text: #f2f2ef; --muted: #9b9b95;
    --faint: #6a6a66; --line: #2a2a28; --accent: #2bc197; --accent-ink: #4fd3ad; --accent-weak: rgba(43,193,151,.14);
    --warn-ink: #e3ad57; --warn-weak: rgba(227,173,87,.14); --danger: #ef6f5b; --danger-weak: rgba(239,111,91,.14);
    --btn: #f2f2ef; --btn-ink: #111; --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 750; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.sm { gap: 8px; }
.stack.lg { gap: 20px; }
.grow { flex: 1; min-width: 0; }
.ic { width: 22px; height: 22px; flex: none; }
.ic.sm { width: 18px; height: 18px; }
.ic.xs { width: 15px; height: 15px; }

/* ---------- Каркас ---------- */
#app { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 8px 0;
  display: flex; align-items: center; gap: 4px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar.hidden { display: none; }
.topbar .title { flex: 1; min-width: 0; font-weight: 750; font-size: 17px; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .logo { display: flex; align-items: center; gap: 8px; padding: 0 8px; flex: 1; }
.topbar .logo img { height: 18px; width: auto; }
.wordmark { height: 17px; width: 51px; color: var(--text); display: block; }
.iconbtn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: var(--text); position: relative;
}
.iconbtn:active { background: var(--surface-2); }
.iconbtn .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.view {
  max-width: var(--maxw); margin: 0 auto; outline: none;
  padding: 4px 16px calc(var(--tab-h) + var(--safe-b) + 24px);
  min-height: calc(100dvh - var(--top-h));
}
.view.wide { max-width: 1040px; }
.view.wide .searchbar, .view.wide .hero, .view.wide .chips.scroll, .view.wide .feed-meta, .view.wide .banner { max-width: 100%; }
.view.flush { padding-left: 0; padding-right: 0; }
.view.no-tabbar { padding-bottom: calc(96px + var(--safe-b)); }
.boot { display: grid; place-items: center; height: 60vh; }
.boot img { border-radius: 16px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; justify-content: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar.hidden { display: none; }
.tabbar .inner { display: flex; width: 100%; max-width: var(--maxw); }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--faint); position: relative;
}
.tab.active { color: var(--text); }
.tab .badge { position: absolute; top: 6px; left: calc(50% + 6px); }
.tab.add .plus {
  width: 44px; height: 32px; border-radius: 12px; background: var(--btn); color: var(--btn-ink);
  display: grid; place-items: center;
}
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1;
}

/* ---------- Кнопки и поля ---------- */
.btn {
  height: 48px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-2); color: var(--text); white-space: nowrap; transition: transform .08s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--btn); color: var(--btn-ink); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: var(--danger-weak); color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.icon { width: 48px; padding: 0; }
.link { color: var(--accent-ink); font-weight: 650; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 650; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.field .err { font-size: 12.5px; color: var(--danger); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; height: 48px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); padding: 0 14px; font-size: 16px; outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color .15s;
}
.textarea { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--text); }
.input.invalid, .select.invalid { border-color: var(--danger); }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 38px;
}
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 40px; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: none;
}
.chip.on { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.chip .x { opacity: .6; margin-right: -4px; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--text); flex: none; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; flex: none; transition: background .2s; margin: 0; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); padding: 4px; border-radius: 12px; gap: 4px; }
.seg button { height: 38px; border-radius: 9px; font-weight: 650; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.card.pad { padding: 16px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 0 10px; }
.section-title h2 { font-size: 17px; }

.feed { display: grid; gap: 14px; }
@media (min-width: 720px) { .feed.grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .feed.grid { grid-template-columns: repeat(3, 1fr); } }

.lcard { display: block; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); position: relative; }
.lcard .ph { aspect-ratio: 16 / 10; background: var(--surface-2); position: relative; overflow: hidden; }
.lcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.lcard .ph .cnt { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 8px; display: flex; gap: 4px; align-items: center; }
.lcard .fav { position: absolute; top: 8px; right: 8px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.9); color: #141414; display: grid; place-items: center; z-index: 2; }
.lcard .fav.on { color: #e0453a; }
.lcard .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.lcard .t { font-weight: 750; font-size: 16px; }
.lcard .specs { color: var(--muted); font-size: 13px; }
.lcard .wants { font-size: 13.5px; display: flex; gap: 6px; align-items: flex-start; }
.lcard .wants .ic { color: var(--accent); margin-top: 1px; }
.lcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px 8px; margin-top: 2px; flex-wrap: wrap; }
.lcard .est { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.lcard.archived { opacity: .6; }

.pay { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pay.i_pay { background: var(--accent-weak); color: var(--accent-ink); }
.pay.they_pay { background: var(--warn-weak); color: var(--warn-ink); }
.pay.even, .pay.any { background: var(--surface-2); color: var(--text); }
.pay.lg { height: 36px; font-size: 15px; padding: 0 12px; border-radius: 10px; }

.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--accent-weak); color: var(--accent-ink); }
.tag.warn { background: var(--warn-weak); color: var(--warn-ink); }
.tag.bad { background: var(--danger-weak); color: var(--danger); }

/* компактная карточка-строка */
.rcard { display: flex; gap: 12px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); align-items: stretch; position: relative; }
.rcard .th { width: 108px; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: none; align-self: flex-start; }
.rcard .th img { width: 100%; height: 100%; object-fit: cover; }
.rcard .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rcard .t { font-weight: 750; font-size: 15px; }
.rcard .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

/* ---------- Поиск в ленте ---------- */
.searchbar { display: flex; gap: 8px; align-items: center; margin: 4px 0 12px; }
.searchbar .box { flex: 1; position: relative; }
.searchbar .box .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.searchbar .input { padding-left: 42px; height: 46px; border-radius: 14px; }
.searchbar .fbtn { width: 46px; height: 46px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; position: relative; }
.searchbar .fbtn .badge { position: absolute; top: -5px; right: -5px; }
.feed-meta { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 10px; font-size: 13px; color: var(--muted); }
.feed-meta select { border: 0; background: transparent; font-weight: 650; color: var(--text); font-size: 13px; padding-right: 2px; }

.banner { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; }
.banner img { width: 40px; height: 40px; border-radius: 10px; flex: none; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic { width: 40px; height: 40px; color: var(--faint); margin-bottom: 4px; }
.empty h3 { color: var(--text); font-size: 16px; }

.hero { padding: 6px 0 2px; }
.hero h1 { font-size: 24px; line-height: 1.2; }

/* ---------- Объявление ---------- */
.gallery { position: relative; background: var(--surface-2); margin: 0 -16px; }
@media (min-width: 640px) { .gallery { margin: 0; border-radius: var(--radius); overflow: hidden; } }
.gallery .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4/3; }
.gallery .track::-webkit-scrollbar { display: none; }
.gallery .track img { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; cursor: zoom-in; }
.gallery .counter { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 8px; }
.gallery .noph { aspect-ratio: 4/3; display: grid; place-items: center; color: var(--faint); }
.dots { display: flex; gap: 5px; justify-content: center; margin-top: 10px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); transition: all .2s; }
.dots i.on { background: var(--text); width: 16px; }

.ltitle { margin-top: 14px; }
.ltitle h1 { font-size: 23px; }
.ltitle .meta { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ltitle .meta span { display: inline-flex; gap: 4px; align-items: center; }

.barter { padding: 16px; display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.barter .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.wish { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.wish:first-child { border-top: 0; padding-top: 0; }
.wish .n { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.wish .w-t { font-weight: 700; }
.wish .w-s { font-size: 13px; color: var(--muted); }

.specs-t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.specs-t td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs-t tr:last-child td { border-bottom: 0; }
.specs-t td:first-child { color: var(--muted); width: 44%; padding-right: 12px; }
.specs-t td:last-child { font-weight: 600; }
.desc { white-space: pre-wrap; word-wrap: break-word; font-size: 15px; }

.seller { display: flex; gap: 12px; align-items: center; padding: 14px 16px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: 17px; flex: none; color: var(--text); }
.avatar.sm { width: 36px; height: 36px; font-size: 14px; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }

.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 10px 16px calc(10px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.actionbar .inner { max-width: calc(var(--maxw) - 32px); margin: 0 auto; display: flex; gap: 8px; }
.actionbar .btn { flex: 1; }
.actionbar .btn.icon { flex: none; }

.overlay-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 10px; z-index: 3; pointer-events: none; }
.overlay-top .iconbtn { background: rgba(255,255,255,.92); color: #141414; pointer-events: auto; }

/* полноэкранный просмотр фото */
.viewer { position: fixed; inset: 0; background: #000; z-index: 100; display: flex; flex-direction: column; }
.viewer .track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.viewer .track::-webkit-scrollbar { display: none; }
.viewer .track div { flex: none; width: 100%; height: 100%; display: grid; place-items: center; scroll-snap-align: center; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .vtop { position: absolute; top: calc(var(--safe-t) + 8px); left: 8px; right: 8px; display: flex; justify-content: space-between; align-items: center; color: #fff; z-index: 2; font-weight: 700; }
.viewer .vtop .iconbtn { color: #fff; background: rgba(255,255,255,.12); }

/* ---------- Нижние шторки и диалоги ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 60; opacity: 0; transition: opacity .2s; }
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
  max-width: var(--maxw); margin: 0 auto; padding-bottom: var(--safe-b);
}
.sheet.show { transform: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 2px; flex: none; }
.sheet .sh-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 20px; flex: none; }
.sheet .sh-body { overflow-y: auto; padding: 4px 20px 16px; flex: 1; overscroll-behavior: contain; }
.sheet .sh-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex: none; }
.sheet .sh-foot .btn { flex: 1; }
@media (min-width: 700px) {
  .sheet { bottom: 50%; transform: translateY(60%); opacity: 0; border-radius: 20px; max-width: 520px; transition: transform .2s, opacity .2s; }
  .sheet.show { transform: translateY(50%); opacity: 1; }
}
.menu-list { display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); font-weight: 600; text-align: left; width: 100%; }
.menu-item:last-child { border-bottom: 0; }
.menu-item .ic { color: var(--muted); }
.menu-item.danger, .menu-item.danger .ic { color: var(--danger); }
.menu-item .chev { margin-left: auto; color: var(--faint); }

.option { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; }
.option.on { border-color: var(--text); }
.option .th { width: 72px; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; background: var(--surface-2); flex: none; }
.option .th img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Тосты ---------- */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--btn); color: var(--btn-ink); padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; max-width: 420px; box-shadow: 0 6px 24px rgba(0,0,0,.18); animation: tin .2s ease-out; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Редактор ---------- */
.steps { display: flex; gap: 6px; margin: 4px 0 18px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--text); }
.step-head { margin-bottom: 18px; }
.step-head .muted { margin-top: 4px; font-size: 14px; }
.photos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ptile { aspect-ratio: 1; border-radius: 12px; overflow: hidden; position: relative; background: var(--surface-2); }
.ptile img { width: 100%; height: 100%; object-fit: cover; }
.ptile .cover { position: absolute; left: 6px; bottom: 6px; background: var(--btn); color: var(--btn-ink); font-size: 10.5px; font-weight: 800; padding: 3px 7px; border-radius: 6px; }
.ptile .rm { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.ptile.add { border: 1.5px dashed var(--faint); background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 12.5px; font-weight: 650; cursor: pointer; }
.ptile.busy::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.5); }
.wish-card { display: flex; gap: 12px; align-items: center; padding: 12px 12px 12px 14px; }
.editor-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px 16px calc(10px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); }
.editor-foot .inner { max-width: calc(var(--maxw) - 32px); margin: 0 auto; display: flex; gap: 8px; }
.editor-foot .btn.primary { flex: 1; }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

/* ---------- Совпадения ---------- */
.mine-pick { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 6px; padding: 2px 16px 6px; }
.mine-pick::-webkit-scrollbar { display: none; }
.mine-pick button { flex: none; display: flex; gap: 10px; align-items: center; padding: 6px 12px 6px 6px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; }
.mine-pick button.on { border-color: var(--text); }
.mine-pick img, .mine-pick .noimg { width: 52px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.mine-pick .t { font-weight: 700; font-size: 13.5px; }
.info-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--muted); }

/* ---------- Чаты ---------- */
.chat-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.chat-row .th { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--surface-2); flex: none; position: relative; }
.chat-row .th img { width: 100%; height: 100%; object-fit: cover; }
.chat-row .t { font-weight: 750; }
.chat-row .s { font-size: 13px; color: var(--muted); }
.chat-row .p { font-size: 14px; color: var(--muted); }
.chat-row.unread .p { color: var(--text); font-weight: 650; }
.chat-row .time { font-size: 12px; color: var(--faint); white-space: nowrap; }

.chat-wrap { display: flex; flex-direction: column; height: calc(100dvh - var(--top-h) - var(--safe-t)); max-width: var(--maxw); margin: 0 auto; }
.chat-listing { display: flex; gap: 10px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-listing img { width: 48px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.msg { max-width: 80%; padding: 9px 13px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; white-space: pre-wrap; word-wrap: break-word; font-size: 15px; }
.msg.me { align-self: flex-end; background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.msg .tm { font-size: 10.5px; opacity: .55; margin-top: 3px; text-align: right; display: flex; gap: 3px; justify-content: flex-end; align-items: center; }
.msg.offer { padding: 10px; width: 280px; max-width: 85%; }
.offer-card { display: flex; flex-direction: column; gap: 8px; }
.offer-card .lbl { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; opacity: .7; display: flex; gap: 6px; align-items: center; }
.offer-card a.inner { display: flex; gap: 10px; align-items: center; background: var(--surface-2); color: var(--text); padding: 8px; border-radius: 12px; }
.msg.me .offer-card a.inner { background: color-mix(in srgb, var(--btn-ink) 12%, transparent); color: var(--btn-ink); }
.offer-card img { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--line); }
.day-sep { align-self: center; font-size: 12px; color: var(--faint); font-weight: 650; margin: 10px 0 4px; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px calc(8px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; border-radius: 22px; border: 1px solid var(--line); background: var(--bg); padding: 10px 16px; resize: none; outline: none; font-size: 16px; line-height: 1.4; }
.composer .send { width: 44px; height: 44px; border-radius: 50%; background: var(--btn); color: var(--btn-ink); display: grid; place-items: center; flex: none; }
.composer .attach { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--accent); }

/* ---------- Профиль ---------- */
.profile-head { display: flex; gap: 14px; align-items: center; padding: 8px 0 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.stats div { background: var(--surface); padding: 12px; text-align: center; }
.stats b { display: block; font-size: 18px; }
.stats span { font-size: 12px; color: var(--muted); }
.my-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.auth { max-width: 400px; margin: 0 auto; padding-top: 12px; }
.auth .logo-big { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 18px; }
.prose { font-size: 14.5px; line-height: 1.6; }
.prose h2 { margin: 22px 0 8px; font-size: 16px; }
.prose p, .prose ul { margin: 0 0 10px; }
.prose ul { padding-left: 20px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }
.sk-card { height: 300px; }

@media (min-width: 720px) {
  .view { padding-left: 24px; padding-right: 24px; }
  .chips.scroll { margin: 0; padding: 0; }
  .mine-pick { margin: 0 0 6px; padding: 2px 0 6px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
