/* Material You (Material 3): tonal colour roles from one seed colour, filled containers
   instead of shadows, pill buttons, a navigation bar with an indicator behind the icon. */

:root {
  --primary: #006a6a;
  --on-primary: #ffffff;
  --primary-container: #9cf1f0;
  --on-primary-container: #002020;
  --secondary-container: #cce8e7;
  --on-secondary-container: #051f1f;
  --tertiary-container: #d3e4ff;
  --on-tertiary-container: #041c35;
  --surface: #f4fbfa;
  --surface-low: #eef5f4;
  --surface-mid: #e9efee;
  --surface-high: #e3e9e8;
  --surface-highest: #dde4e3;
  --on-surface: #161d1d;
  --on-surface-variant: #3f4948;
  --outline: #6f7979;
  --outline-variant: #bec9c8;
  --error: #ba1a1a;
  --chrome: #f4fbfa;
  --font: Roboto, "Google Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E");
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
}
[data-scheme="dark"] {
  --primary: #80d5d4;
  --on-primary: #003737;
  --primary-container: #004f4f;
  --on-primary-container: #9cf1f0;
  --secondary-container: #324b4b;
  --on-secondary-container: #cce8e7;
  --tertiary-container: #334863;
  --on-tertiary-container: #d3e4ff;
  --surface: #0e1514;
  --surface-low: #161d1d;
  --surface-mid: #1a2121;
  --surface-high: #252b2b;
  --surface-highest: #2f3636;
  --on-surface: #dde4e3;
  --on-surface-variant: #bec9c8;
  --outline: #889392;
  --outline-variant: #3f4948;
  --error: #ffb4ab;
  --chrome: #0e1514;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--on-surface);
  font: 400 16px/1.5 var(--font); letter-spacing: .01em; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none; overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; position: relative; overflow: hidden; }
/* State layer: every button darkens or lightens a little while pressed. */
button::after { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0;
  transition: opacity .2s; pointer-events: none; border-radius: inherit; }
button:active::after { opacity: .12; }
h1, h2, h3, p { margin: 0; }
.i { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

.app { min-height: var(--tg-viewport-stable-height, 100vh); display: flex; flex-direction: column; }
.page { flex: 1; display: flex; flex-direction: column; gap: 16px;
  padding: 8px 16px calc(150px + var(--safe-bottom)); }
.page > * { min-width: 0; }
.app:not(:has(.tabbar)) .page { padding-bottom: calc(24px + var(--safe-bottom)); }

/* Top app bar */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px;
  min-height: 64px; padding: calc(var(--safe-top) + 8px) 8px 8px 16px; background: var(--surface); }
.topbar__text { flex: 1; min-width: 0; }
.topbar__title { font-size: 22px; line-height: 28px; font-weight: 400; }
.topbar__sub { font-size: 14px; color: var(--on-surface-variant); letter-spacing: .02em; }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: var(--on-surface-variant); }
.icon-btn--filled { width: 40px; height: 40px; background: var(--primary); color: var(--on-primary); border-radius: 12px; }
.icon-btn--filled .i { width: 20px; height: 20px; }
.avatar { width: 40px; height: 40px; margin: 0 4px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--tertiary-container); color: var(--on-tertiary-container); font-weight: 500; }

/* Cards: filled containers */
.card { background: var(--surface-mid); border-radius: 16px; padding: 16px; }
.card--accent { background: var(--primary-container); color: var(--on-primary-container); border-radius: 28px; padding: 20px; }
.hero__label { font-size: 14px; font-weight: 500; letter-spacing: .03em; }
.hero__value { font-size: 45px; line-height: 52px; font-weight: 400; margin: 4px 0 14px; }
.hero__value small { font-size: 24px; }
.hero__hint { font-size: 14px; margin-top: 10px; opacity: .85; }
.progress { height: 4px; border-radius: 2px; background: var(--secondary-container); overflow: hidden; }
.card--accent .progress { background: color-mix(in srgb, var(--on-primary-container) 15%, transparent); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }

.section-title { font-size: 14px; font-weight: 500; letter-spacing: .06em; color: var(--primary);
  padding: 8px 4px 0; margin-bottom: -8px; }

/* Lists */
.list { list-style: none; margin: 0; padding: 4px 0; background: var(--surface-low); border-radius: 16px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 16px; padding: 8px 16px; min-height: 72px; position: relative; }
.row::after { content: ""; position: absolute; inset: 0; background: var(--on-surface); opacity: 0; transition: opacity .2s; }
.row:active::after { opacity: .08; }
.row__icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--primary-container); color: var(--on-primary-container); }
.row__icon .i { width: 20px; height: 20px; }
.row__body { flex: 1; min-width: 0; }
.row__title { font-size: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px;
  min-width: 0; overflow-wrap: anywhere; }
.row__sub { font-size: 14px; color: var(--on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__end { display: flex; align-items: center; gap: 12px; color: var(--on-surface-variant); position: relative; z-index: 1; }
.price { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.chev { width: 20px; height: 20px; }
.badge { font-size: 11px; font-weight: 500; letter-spacing: .04em; padding: 0 8px; line-height: 20px; border-radius: 6px;
  background: var(--tertiary-container); color: var(--on-tertiary-container); }

/* Segmented button and filter chips: the chosen one gets a tick */
.segmented { display: flex; border: 1px solid var(--outline); border-radius: 20px; overflow: hidden; }
.segmented > * { flex: 1; height: 40px; font-size: 14px; font-weight: 500; display: flex; align-items: center;
  justify-content: center; gap: 6px; transition: background .3s var(--ease); }
.segmented > * + * { border-left: 1px solid var(--outline); }
.segmented > .is-active, .chip.is-active { background: var(--secondary-container); color: var(--on-secondary-container); }
.segmented > .is-active::before, .chip.is-active::before { content: ""; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--check) center / contain no-repeat; mask: var(--check) center / contain no-repeat; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 32px; padding: 0 16px; border-radius: 8px; white-space: nowrap; font-size: 14px; font-weight: 500;
  flex: none;
  display: inline-flex; align-items: center; gap: 8px; color: var(--on-surface-variant);
  box-shadow: inset 0 0 0 1px var(--outline-variant); transition: background .3s var(--ease); }
.chip.is-active { box-shadow: none; padding-left: 8px; }

/* Fields: filled text fields with the label inside */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; padding: 8px 16px 6px; border-radius: 4px 4px 0 0;
  background: var(--surface-highest); box-shadow: inset 0 -1px 0 var(--on-surface-variant); transition: box-shadow .2s; }
.field:focus-within { box-shadow: inset 0 -2px 0 var(--primary); }
.field__label { font-size: 12px; color: var(--on-surface-variant); }
.field:focus-within .field__label { color: var(--primary); }
.input { width: 100%; border: 0; background: none; padding: 2px 0; font-size: 16px; outline: none; resize: none;
  caret-color: var(--primary); }
.input::placeholder { color: var(--on-surface-variant); opacity: .7; }
.search { display: flex; align-items: center; gap: 16px; height: 56px; padding: 0 20px; border-radius: 28px;
  background: var(--surface-high); color: var(--on-surface-variant); }
.search .input { padding: 0; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.switch { appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative; cursor: pointer;
  width: 52px; height: 32px; border-radius: 16px; background: var(--surface-highest);
  box-shadow: inset 0 0 0 2px var(--outline); transition: background .3s var(--ease), box-shadow .3s; }
.switch::after { content: ""; position: absolute; top: 8px; left: 8px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--outline); transition: all .3s var(--ease); }
.switch:checked { background: var(--primary); box-shadow: none; }
.switch:checked::after { top: 4px; left: 24px; width: 24px; height: 24px; background: var(--on-primary); }

/* Buttons: filled, tonal, text */
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions__row { display: flex; gap: 8px; }
.actions__row > .btn { flex: 1; padding: 0 12px; }
.btn { height: 48px; padding: 0 24px; border-radius: 24px; font-size: 15px; font-weight: 500; letter-spacing: .01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: border-radius .3s var(--ease); }
.btn:active { border-radius: 12px; }
.btn:disabled { opacity: .38; }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--secondary { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn--ghost { color: var(--primary); }
.btn--danger { color: var(--error); }
.btn--block { width: 100%; }

/* Empty state */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 32px 24px; }
.empty__icon { width: 96px; height: 96px; border-radius: 32px; display: grid; place-items: center; margin-bottom: 8px;
  background: var(--secondary-container); color: var(--on-secondary-container); }
.empty__icon .i { width: 40px; height: 40px; stroke-width: 1.6; }
.empty__title { font-size: 22px; line-height: 28px; }
.empty__text { color: var(--on-surface-variant); font-size: 14px; max-width: 280px; margin-bottom: 8px; }

/* Navigation bar: a pill indicator grows behind the chosen icon */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex;
  padding: 12px 8px calc(12px + var(--safe-bottom)); background: var(--surface-mid); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 500;
  color: var(--on-surface-variant); overflow: visible; }
.tab::after { display: none; }
.tab .i { width: 64px; height: 32px; padding: 4px 20px; border-radius: 16px; overflow: visible;
  transition: background .3s var(--ease); }
.tab:active .i { background: color-mix(in srgb, var(--on-surface) 10%, transparent); }
.tab.is-active { color: var(--on-surface); }
.tab.is-active .i { background: var(--secondary-container); color: var(--on-secondary-container); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* app */
.page--plain { padding-bottom: calc(24px + var(--safe-bottom)); }
.page--chat { padding-bottom: calc(76px + var(--safe-bottom)); gap: 8px; }
.topbar__title, .topbar__sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__text { min-width: 0; }
.loading { padding: 40px 0; text-align: center; color: var(--on-surface-variant); font-size: 14px; }

/* Скелетоны: экран не пустует, пока грузится лента */
.sk { background: var(--surface-mid); border-radius: 8px; animation: sk-pulse 1.2s ease-in-out infinite; }
@keyframes sk-pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.sk-tile { background: var(--surface-low); border-radius: 16px; overflow: hidden; }
.sk-tile__pic { aspect-ratio: 1 / 1; border-radius: 0; }
.sk-tile__body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.sk-line { height: 12px; width: 100%; }
.sk-line--short { width: 55%; }
.sk-ava { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.row__body .sk + .sk { margin-top: 8px; }

/* Лента: сетка карточек */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; text-align: left; background: var(--surface-low);
  border-radius: 16px; overflow: hidden; padding: 0; }
.tile__pic { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--surface-high); }
.tile__pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile__ph { width: 100%; height: 100%; display: grid; place-items: center;
  color: var(--on-surface-variant); opacity: .55; }
.tile__ph .i { width: 40px; height: 40px; stroke-width: 1.5; }
.tile__badge { position: absolute; top: 8px; left: 8px; padding: 0 8px; line-height: 22px;
  border-radius: 6px; background: var(--surface); color: var(--on-surface);
  font-size: 11px; font-weight: 500; }
.tile__body { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.tile__price { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tile__title { font-size: 14px; line-height: 18px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.tile__sub { font-size: 12px; color: var(--on-surface-variant); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }

/* Карточка объявления */
.gallery { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.gallery::-webkit-scrollbar { display: none; }
.gallery--one { display: block; margin: 0; padding: 0; }
.gallery__slide { flex: none; width: calc(100% - 24px); scroll-snap-align: center;
  border-radius: 20px; overflow: hidden; background: var(--surface-high); aspect-ratio: 1 / 1; }
.gallery--one .gallery__slide { width: 100%; }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__ph { aspect-ratio: 1 / 1; border-radius: 20px; display: grid; place-items: center;
  background: var(--surface-high); color: var(--on-surface-variant); opacity: .6; }
.gallery__ph .i { width: 48px; height: 48px; stroke-width: 1.5; }
.gallery-wrap { position: relative; }
.gallery__count { position: absolute; top: 12px; right: 12px; z-index: 1;
  padding: 1px 10px; border-radius: 12px; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 12px; line-height: 20px; font-variant-numeric: tabular-nums; pointer-events: none; }
.gallery__dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.gallery__dots span { width: 6px; height: 6px; border-radius: 3px;
  background: var(--outline-variant); transition: width .25s var(--ease), background .25s; }
.gallery__dots span.is-active { width: 18px; background: var(--primary); }
.detail-head { display: flex; align-items: flex-start; gap: 8px; }
.detail-head__text { flex: 1; min-width: 0; }
.detail-head__actions { display: flex; align-items: center; gap: 4px; flex: none; }
.detail-price { font-size: 28px; line-height: 34px; font-weight: 500;
  font-variant-numeric: tabular-nums; }
.detail-title { font-size: 20px; line-height: 26px; font-weight: 400;
  overflow-wrap: anywhere; word-break: break-word; }
.icon-btn--fav { background: var(--primary-container); color: var(--on-primary-container); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; }
.meta__item { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 12px;
  border-radius: 16px; background: var(--surface-mid); color: var(--on-surface-variant);
  font-size: 13px; line-height: 20px; max-width: 100%; overflow-wrap: anywhere; }
.meta__item .i { width: 16px; height: 16px; }
.detail-desc { font-size: 16px; line-height: 1.5; white-space: pre-wrap; min-width: 0; max-width: 100%;
  overflow-wrap: anywhere; word-break: break-word; }
.detail-desc--clamped { max-height: 10.5em; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent);
  mask-image: linear-gradient(180deg, #000 72%, transparent); }
.desc-toggle { align-self: flex-start; margin-top: -8px; padding: 8px 4px;
  color: var(--primary); font-size: 14px; font-weight: 500; }
.seller { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.seller__ava { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  flex: none; background: var(--tertiary-container); color: var(--on-tertiary-container);
  font-weight: 500; }
.sold-note { display: inline-flex; align-items: center; gap: 6px; color: var(--error);
  font-size: 14px; font-weight: 500; }
.sold-note .i { width: 18px; height: 18px; }

/* Фото в форме */
.thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb { position: relative; flex: none; width: 92px; height: 92px; border-radius: 14px;
  overflow: hidden; background: var(--surface-high); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb__del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px;
  border-radius: 50%; display: grid; place-items: center; background: var(--surface);
  color: var(--on-surface); }
.thumb__del .i { width: 15px; height: 15px; }
.thumb__cover { position: absolute; left: 4px; bottom: 4px; padding: 1px 7px; border-radius: 8px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 10px; line-height: 16px; }
.thumb--add { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; border: 1px dashed var(--outline); background: none; cursor: pointer;
  color: var(--on-surface-variant); font-size: 12px; }
.thumb--add .i { width: 24px; height: 24px; }
.form-error { color: var(--error); font-size: 14px; padding: 0 4px; }

/* Список и переписка */
.row__icon--pic { overflow: hidden; padding: 0; background: var(--surface-high); }
.row__icon--pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; background: var(--primary);
  color: var(--on-primary); font-size: 12px; font-weight: 500; }
.chat__time { font-size: 12px; color: var(--on-surface-variant); }
.messages { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.msg { align-self: flex-start; max-width: 82%; padding: 9px 14px 7px; border-radius: 18px;
  background: var(--surface-high); font-size: 15px; line-height: 20px; word-break: break-word;
  display: flex; flex-direction: column; gap: 2px; }
.msg--other { border-bottom-left-radius: 6px; }
.msg--me { align-self: flex-end; border-bottom-right-radius: 6px;
  background: var(--primary-container); color: var(--on-primary-container); }
.msg__time { align-self: flex-end; font-size: 10px; opacity: .65; }
.msg-day { align-self: center; margin: 4px 0; font-size: 12px; color: var(--on-surface-variant); }
.msg-day span { padding: 3px 10px; border-radius: 10px; background: var(--surface-mid); }
.chat-empty { margin: auto; padding: 24px 12px; text-align: center; font-size: 14px;
  color: var(--on-surface-variant); }
.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex;
  align-items: flex-end; gap: 8px; padding: 8px 12px calc(8px + var(--safe-bottom));
  background: var(--surface); border-top: 1px solid var(--outline-variant); }
.composer__input { flex: 1; min-height: 44px; max-height: 120px; padding: 11px 16px;
  border: 0; border-radius: 22px; background: var(--surface-high); font-size: 16px;
  line-height: 22px; resize: none; outline: none; caret-color: var(--primary); }
.icon-btn--filled:disabled { opacity: .4; }

/* Значок непрочитанных на вкладке */
.tab__badge { position: absolute; top: 2px; right: calc(50% - 36px); min-width: 18px;
  height: 18px; padding: 0 5px; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; background: var(--primary); color: var(--on-primary);
  font-size: 11px; font-weight: 500; }

/* Всплывающая подсказка */
.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-bottom)); z-index: 50;
  transform: translateX(-50%); max-width: 80%; padding: 10px 18px; border-radius: 12px;
  background: var(--surface-highest); color: var(--on-surface); font-size: 14px;
  text-align: center; }
.toast[hidden] { display: none; }

/* Кнопка «Наверх» на длинной ленте */
.to-top { position: fixed; left: 16px; bottom: calc(96px + var(--safe-bottom)); z-index: 7;
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-highest); color: var(--on-surface-variant);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .16); }
.to-top .i { width: 22px; height: 22px; }

.tab__badge[hidden] { display: none; }

[hidden] { display: none !important; }

/* Поиск: кнопка «очистить» */
.search { position: relative; }
.search__clear { flex: none; width: 40px; height: 40px; margin-right: -10px; border-radius: 50%;
  display: grid; place-items: center; color: var(--on-surface-variant); }
.search__clear .i { width: 20px; height: 20px; }

/* Компактное пустое состояние и разделы */
.empty--compact { padding: 20px 16px 24px; gap: 6px; }
.empty--compact .empty__icon { width: 64px; height: 64px; border-radius: 20px; margin-bottom: 4px; }
.empty--compact .empty__icon .i { width: 30px; height: 30px; }
.empty--compact .empty__title { font-size: 18px; line-height: 24px; }
.empty--compact .btn { margin-top: 8px; }
.catgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px;
  border-radius: 16px; background: var(--surface-low); font-size: 12px; line-height: 15px;
  text-align: center; color: var(--on-surface); }
.cat__icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--secondary-container); color: var(--on-secondary-container); }
.cat__icon .i { width: 20px; height: 20px; }
.cat__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Статистика продавца */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface-low); border-radius: 16px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px; }
.stat__value { font-size: 22px; line-height: 28px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 12px; line-height: 15px; color: var(--on-surface-variant); }

/* Кнопка «Разместить» */
.fab { position: fixed; right: 16px; bottom: calc(96px + var(--safe-bottom)); z-index: 7;
  display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 20px 0 16px;
  border-radius: 16px; background: var(--primary); color: var(--on-primary);
  font-size: 15px; font-weight: 500; box-shadow: 0 6px 18px rgba(0, 0, 0, .22); }
.fab .i { width: 22px; height: 22px; stroke-width: 2.4; }

/* Карточка в избранном с сердечком */
.tile { position: relative; cursor: pointer; }
.tile__fav { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--primary); }
.tile__fav .i { width: 18px; height: 18px; fill: currentColor; stroke: none; }

/* Строка чата: название объявления третьей строкой */
.row__note { font-size: 12px; line-height: 16px; color: var(--on-surface-variant);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* Закреплённая кнопка «Написать» на странице объявления */
.detail-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex;
  align-items: center; gap: 12px; padding: 10px 16px calc(10px + var(--safe-bottom));
  background: var(--surface); border-top: 1px solid var(--outline-variant); }
.detail-bar__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.detail-bar__price { font-size: 18px; line-height: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.detail-bar__title { font-size: 12px; line-height: 16px; color: var(--on-surface-variant);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-bar .btn { flex: none; }
.page--bar { padding-bottom: calc(96px + var(--safe-bottom)) !important; }

/* Лента: сортировка, цена и подписка */
.feed-tools { display: flex; align-items: center; gap: 8px; }
.segmented--sort { flex: 1; min-width: 0; }
.segmented--sort > * { height: 36px; font-size: 13px; }
.segmented--sort > .is-active::before { display: none; }
.tool-btn { flex: none; height: 36px; padding: 0 12px; border-radius: 12px;
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface-mid);
  color: var(--on-surface-variant); font-size: 13px; font-weight: 500; }
.tool-btn .i { width: 16px; height: 16px; }
.tool-btn.is-on { background: var(--secondary-container); color: var(--on-secondary-container); }
.save-search { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  height: 40px; padding: 0 16px; border-radius: 12px; background: var(--primary-container);
  color: var(--on-primary-container); font-size: 14px; font-weight: 500; }
.save-search .i { width: 18px; height: 18px; }
.hint { font-size: 13px; line-height: 18px; color: var(--on-surface-variant); padding: 0 4px; }
.badge--warn { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }
.icon-btn--small { width: 36px; height: 36px; }
.icon-btn--small .i { width: 19px; height: 19px; }

/* Просмотры по дням */
.chart { padding: 14px 16px; }
.chart__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: 14px; color: var(--on-surface-variant); }
.chart__head .i { width: 18px; height: 18px; }
.chart__bars { display: flex; align-items: flex-end; gap: 8px; height: 72px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; gap: 4px; }
.bar__fill { width: 100%; max-width: 26px; background: var(--primary); border-radius: 4px; }
.bar__day { font-size: 10px; color: var(--on-surface-variant); }

/* Жалоба на объявление */
.report-link { display: inline-flex; align-items: center; gap: 6px; align-self: center;
  padding: 8px 12px; color: var(--on-surface-variant); font-size: 13px; }
.report-link .i { width: 16px; height: 16px; }

/* Нижняя шторка */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end;
  background: rgba(0, 0, 0, .45); }
.sheet__panel { width: 100%; max-height: 86vh; overflow-y: auto; display: flex;
  flex-direction: column; gap: 12px; padding: 24px 20px calc(24px + var(--safe-bottom));
  background: var(--surface-low); border-radius: 24px 24px 0 0; }
.sheet__title { font-size: 22px; line-height: 28px; font-weight: 400; }
.sheet__text { font-size: 14px; line-height: 19px; color: var(--on-surface-variant); }
.price-range { display: flex; align-items: flex-end; gap: 8px; }
.price-range .field { flex: 1; }
.price-range__dash { padding-bottom: 14px; color: var(--on-surface-variant); }
.report-list { display: flex; flex-direction: column; background: var(--surface-mid);
  border-radius: 16px; overflow: hidden; }
.report-list .row { width: 100%; min-height: 52px; padding: 8px 16px; text-align: left; }
.report-list .row .i { width: 18px; height: 18px; color: var(--error); }

/* Поделиться объявлением */
.share-list { display: flex; flex-direction: column; background: var(--surface-mid);
  border-radius: 16px; overflow: hidden; }
.share-list .row { width: 100%; min-height: 60px; padding: 8px 16px; text-align: left; }
.share-list .row .i { width: 20px; height: 20px; color: var(--primary); flex: none; }

/* Просмотр фото на весь экран */
.lightbox { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: #000; }
.lightbox img { max-width: 100%; max-height: 78vh; object-fit: contain; display: block; }
.lightbox__close { position: absolute; top: calc(16px + var(--safe-top)); right: 16px;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 18px; }
.lightbox__bar { display: flex; align-items: center; gap: 24px; margin-top: 18px;
  color: #fff; font-size: 14px; }
.lightbox__nav { width: 44px; height: 44px; border-radius: 50%; display: grid;
  place-items: center; background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 26px; line-height: 1; }

/* Быстрые ответы над полем сообщения */
.quick { position: fixed; left: 0; right: 0; bottom: calc(60px + var(--safe-bottom));
  z-index: 6; display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px;
  background: var(--surface); border-top: 1px solid var(--outline-variant);
  scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .chip { height: 30px; background: var(--surface-high); color: var(--on-surface);
  box-shadow: none; padding: 0 12px; }
.page--chat { padding-bottom: calc(132px + var(--safe-bottom)); }

/* Снижение цены: старая цена зачёркнута, на фото — процент скидки */
.tile__price s, .detail-price s { margin-left: 6px; font-size: .7em; font-weight: 400;
  color: var(--on-surface-variant); text-decoration-thickness: 1px; }
.tile__badge--off { background: var(--primary); color: var(--on-primary); }

/* Недавно смотрели: горизонтальная лента мини-карточек */
.rail { display: flex; gap: 10px; overflow-x: auto; padding: 0 0 4px;
  scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.rail::-webkit-scrollbar { display: none; }
.mini { flex: none; width: 104px; display: flex; flex-direction: column; gap: 4px;
  text-align: left; padding: 0; background: none; }
.mini__pic { width: 104px; height: 104px; border-radius: 14px; overflow: hidden;
  background: var(--surface-high); display: block; }
.mini__pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini__ph { width: 100%; height: 100%; display: grid; place-items: center;
  color: var(--on-surface-variant); opacity: .5; }
.mini__price { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.mini__title { font-size: 12px; line-height: 15px; color: var(--on-surface-variant);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Продавец в карточке объявления и его страница */
.seller--link { width: 100%; text-align: left; }
.seller-head { display: flex; align-items: center; gap: 16px; padding: 4px 0; }
.seller-head__ava { width: 72px; height: 72px; border-radius: 50%; display: grid;
  place-items: center; flex: none; font-size: 28px; font-weight: 500;
  background: var(--primary-container); color: var(--on-primary-container); }
.seller-head__name { font-size: 22px; line-height: 28px; }
