@font-face { font-family: Manrope; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-cyrillic-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Manrope; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-cyrillic-wght-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Manrope; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-latin-wght-normal.woff2) format('woff2'); 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; }

:root {
  --bg: #ffffff;
  --accent: #7837d4;
  --accent-press: #672bbd;
  /* тот же фиолетовый потемнее: для текста и значков на сером */
  --accent-ink: #672bbd;
  --surface: #f4f4f5;
  --surface-2: #eaeaec;
  --line: rgba(0, 0, 0, .1);
  --text: #141414;
  --text-2: #404044;
  --muted: #66666b;
  --danger: #c9324b;
  --error: #b8203a;
  --ok: #13744a;
  /* кнопки и подписи поверх фотографий */
  --over: rgba(255, 255, 255, .92);
  --shadow: 0 1px 4px rgba(0, 0, 0, .16);
  --r-s: 8px;
  --r: 12px;
  --r-l: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --tabs: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.locked { overflow: hidden; }
body { font: 400 14px/1.5 Manrope, system-ui, sans-serif; color: var(--text); background: var(--bg); min-height: 100dvh; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .55; cursor: default; }
a { color: inherit; text-decoration: none; touch-action: manipulation; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
h2 { font-size: 18px; line-height: 1.35; font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
#view:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.feed + p { margin-top: 32px; }
.small { font-size: 12px; }
.center { text-align: center; }
.noscript { padding: 40px 20px; text-align: center; }
/* один набор значков, одна толщина линии */
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

#view { padding: var(--safe-t) 16px calc(var(--tabs) + var(--safe-b) + 32px); max-width: 1180px; margin: 0 auto; }
.has-footer #view { min-height: 100dvh; padding-bottom: 48px; }

/* ---------- логотип: пакет с тенге и название ---------- */
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 24px; letter-spacing: -.045em; line-height: 1; }
.logo::before { content: ''; width: 1.15em; height: 1.15em; flex: none; background: url('/icons/mark.svg') center / contain no-repeat; }
.logo b { color: var(--accent); font-weight: inherit; }

/* ---------- полоса про соцсети ---------- */
#promo { padding: var(--safe-t) 16px 0; background: var(--surface); }
#promo > div { display: flex; align-items: center; justify-content: center; gap: 16px; max-width: 920px; min-height: 80px; margin: 0 auto; }
#promo img { flex: none; width: 48px; height: 48px; filter: drop-shadow(0 6px 8px rgba(20, 12, 40, .22)); }
#promo p { flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; }
#promo a { color: var(--accent-ink); font-weight: 500; }
#promo a:hover { text-decoration: underline; }
#promo button { display: grid; place-items: center; flex: none; width: 40px; height: 40px; margin-right: -8px; border-radius: var(--r); color: var(--muted); }
#promo button:hover { background: var(--surface-2); color: var(--text); }
.has-promo #topbar, .has-promo #view { --safe-t: 0px; }

/* включение входа по коду в модерации */
.setup .my { display: flex; flex-direction: column; gap: 12px; }

/* ---------- нижнее меню ---------- */
#tabs { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabs) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--bg); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--muted); min-width: 0; }
.tab span { position: relative; display: grid; place-items: center; width: 48px; height: 28px; }
/* число непрочитанных на значке чатов */
[data-unread] { position: absolute; top: -2px; right: 4px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; line-height: 1; box-shadow: 0 0 0 2px var(--bg); }
.tab[aria-current] { color: var(--text); }
.tab[aria-current] .i { stroke: var(--accent-ink); }
.tab-new span { background: var(--accent); color: #fff; border-radius: var(--r-s); }
.tab-new[aria-current] .i { stroke: #fff; }
body[data-page='item'] #tabs, body[data-page='chat'] #tabs { display: none; }

/* ---------- шапка с поиском ---------- */
#topbar { display: none; }
body[data-page='home'] #topbar, body[data-page='search'] #topbar { display: block; }
body[data-page='home'] #view, body[data-page='search'] #view { padding-top: 0; }
.head { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'logo' 'search'; align-items: center; gap: 12px; padding: calc(12px + var(--safe-t)) 16px 16px; border-bottom: 1px solid var(--line); }
.head > .logo { grid-area: logo; justify-self: start; font-size: 28px; }
.head .pill, .head .head-post { display: none; }
.searchbar { grid-area: search; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 4px 0 16px; background: var(--surface); border: 1px solid transparent; border-radius: var(--r-l); color: var(--muted); }
.searchbar:focus-within { border-color: var(--accent); }
.searchbar input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--text); font-size: 16px; }
.filter-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--text); font-weight: 500; flex: none; }
.filter-btn .i { width: 16px; height: 16px; }
.filter-btn b { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; }

/* ---------- категории ---------- */
.cats-wrap { position: relative; }
.cats, .chips { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 16px; }
.cats::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.cats { gap: 4px; }
.cat { flex: none; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 8px; align-self: flex-start; font-size: 11px; line-height: 1.35; font-weight: 500; text-align: center; overflow-wrap: break-word; hyphens: auto; }
.cat span { display: grid; place-items: center; width: 64px; height: 64px; background: var(--surface); border: 1px solid transparent; border-radius: 20px; transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.cat img { width: 44px; height: 44px; }
.cat[aria-pressed='true'] span { background: rgba(120, 55, 212, .12); border-color: var(--accent); }
.cat[aria-pressed='true'] { color: var(--accent-ink); }
.cats-arrow { display: none; }

.chips { gap: 8px; padding-block: 12px; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-s); background: var(--surface); border: 1px solid var(--line); font-weight: 500; white-space: nowrap; }
.chip .i { width: 16px; height: 16px; color: var(--muted); }
.chip[aria-pressed='true'] { border-color: var(--accent); background: rgba(120, 55, 212, .1); }

/* ---------- сетка товаров: по два в ряд ---------- */
.feed-head { display: flex; align-items: baseline; gap: 8px; padding: 8px 0 16px; }
.feed-head h1 { font-size: 20px; }
.feed-head span { color: var(--muted); font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; align-items: start; }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.card-photo { display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; background: var(--surface); border-radius: var(--r-l); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-photo .ph { width: 32px; height: 32px; color: var(--muted); }
.card-head { display: flex; align-items: flex-start; gap: 4px; margin-top: 8px; }
.card h3 { flex: 1; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 400; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
/* вся карточка — одна большая ссылка, сердечко лежит поверх неё */
.card h3 a::after { content: ''; position: absolute; inset: 0; }
.card:has(a:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 4px; border-radius: var(--r-l); }
.card h3 a:focus-visible { outline: 0; }
.card .heart { position: relative; z-index: 1; display: grid; place-items: center; flex: none; width: 36px; height: 36px; margin: -8px -8px -16px 0; color: var(--text-2); }
.card-price { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; margin-top: 4px; font-size: 18px; line-height: 24px; font-weight: 600; }
.card-price s, .price-was s { color: var(--muted); font-weight: 400; }
.card-price s { font-size: 13px; }
.card-meta { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; line-height: 16px; min-width: 0; }
.card-meta .i { width: 14px; height: 14px; color: var(--muted); }
.card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-place { color: var(--text-2); }
.card-date, .card-cond { color: var(--muted); }
.card-cond { margin-top: 4px; font-size: 12px; line-height: 16px; }
.heart .i { width: 20px; height: 20px; transition: fill .15s var(--ease), stroke .15s var(--ease); }
.heart[aria-pressed='true'] .i { fill: var(--accent); stroke: var(--accent-ink); }
.round { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--over); box-shadow: var(--shadow); }
.round.heart[aria-pressed='true'] { background: var(--accent); color: #fff; }
.round.heart[aria-pressed='true'] .i { fill: #fff; stroke: #fff; }

.skel span { background: var(--surface); border-radius: var(--r-s); }
.skel > span:nth-child(2) { height: 12px; margin-top: 12px; width: 84%; display: block; }
.skel > span:nth-child(3) { height: 16px; margin-top: 8px; width: 48%; display: block; }
.skel .card-photo { border-radius: var(--r-l); }
.skel, .skel-block { animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .5; } }
.feed-end { min-height: 1px; }
.loading-more { padding: 24px 0 0; text-align: center; color: var(--muted); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 48px 20px; }
.empty p { color: var(--muted); max-width: 36ch; }
.empty .btn { margin-top: 12px; }
.empty-mark { width: 72px; height: 72px; margin-bottom: 12px; background: var(--surface-2); -webkit-mask: url('/icons/mark.svg') center / contain no-repeat; mask: url('/icons/mark.svg') center / contain no-repeat; }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 20px; border-radius: var(--r); background: var(--accent); color: #fff; font-weight: 600; text-align: center; line-height: 20px; transition: background-color .15s var(--ease), transform .1s var(--ease); }
.btn:active { background: var(--accent-press); transform: scale(.98); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.small { min-height: 36px; padding: 4px 12px; font-weight: 500; border-radius: var(--r-s); }
.btn.wide { width: 100%; }
.btn:not([href]):is(a) { opacity: .5; }
.btn.busy .i { animation: pulse .6s ease-in-out infinite alternate; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-s); flex: none; }
.link-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; color: var(--muted); font-weight: 500; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }

.narrow { max-width: 560px; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 8px; max-width: 560px; margin: 0 auto; padding: 16px 0; }
.page-head:has(+ .feed), .page-head.wide { max-width: none; }
.page-head .icon-btn { margin-left: -12px; }

.form { display: flex; flex-direction: column; gap: 20px; }
fieldset { border: 0; min-width: 0; }
legend, .field > span { display: block; margin-bottom: 8px; font-weight: 500; }
fieldset > p { font-size: 12px; margin-bottom: 12px; }
.form-part > legend, .form-title { font-size: 18px; font-weight: 600; }
.form-title { margin-top: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.field { display: block; }
.input { width: 100%; min-height: 48px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-size: 16px; outline: 0; transition: border-color .15s var(--ease); }
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--muted); }
.input.big { font-size: 20px; font-weight: 600; }
textarea.input { resize: vertical; line-height: 1.5; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2366666b' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
[data-field] em { display: none; margin-top: 8px; font-size: 12px; font-style: normal; color: var(--error); }
[data-field].bad em { display: block; }
[data-field].bad .input, [data-field].bad .seg span, [data-field].bad .add { border-color: var(--danger); }
.form-error { color: var(--error); }
.form-error:empty { display: none; }
.segs { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: var(--r-s); background: var(--surface); border: 1px solid var(--line); font-weight: 500; pointer-events: none; }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.form a:not(.btn) { color: var(--accent-ink); text-decoration: underline; }

.uploader { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--surface); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.busy img { opacity: .4; }
.thumb.busy::after { content: ''; position: absolute; left: calc(50% - 14px); top: calc(50% - 14px); width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.thumb figcaption { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 4px; background: var(--over); font-size: 11px; font-weight: 500; }
.thumb .drop, .thumb .make-main { position: absolute; top: 4px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--over); box-shadow: var(--shadow); }
.thumb .drop { right: 4px; }
.thumb .make-main { left: 4px; }
.thumb button .i { width: 16px; height: 16px; }
.thumb.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px dashed var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 500; }
.ai { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ai .btn { border: 1px solid var(--accent); }
.ai .i { color: var(--accent-ink); }

/* ---------- страница товара ---------- */
body[data-page='item'] #view { padding: 0 0 32px; }
.item { display: flex; flex-direction: column; }
.col-main, .col-side { display: contents; }
.item-media { order: 1; min-width: 0; }
.item-info { order: 2; }
.item-more { order: 3; }
.item-seller { order: 4; }
.same { order: 5; }
.similar { order: 6; }
.item-info, .item-more, .item-seller, .same, .similar { padding: 0 16px; }
.gallery > img { cursor: zoom-in; }
.gallery-wrap { position: relative; background: var(--surface); }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 1; max-height: 70dvh; width: 100%; }
.gallery::-webkit-scrollbar, .thumbs::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: start; scroll-snap-stop: always; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 12px 16px 0; }
.thumbs button { flex: none; width: 64px; height: 64px; padding: 2px; border: 1px solid transparent; border-radius: var(--r); opacity: .6; transition: opacity .15s var(--ease), border-color .15s var(--ease); }
.thumbs button[aria-current] { opacity: 1; border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-s); }
.no-photo { flex: 1; display: grid; place-items: center; color: var(--muted); }
.no-photo .i { width: 48px; height: 48px; }
.skel-block { background: var(--surface); }
.g-back { position: absolute; top: calc(12px + var(--safe-t)); left: 12px; }
.g-actions { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; display: flex; gap: 8px; }
.counter { position: absolute; bottom: 12px; right: 12px; padding: 4px 8px; border-radius: var(--r-s); background: var(--over); box-shadow: var(--shadow); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.g-prev, .g-next { display: none; position: absolute; top: calc(50% - 20px); }
.g-prev { left: 12px; }
.g-next { right: 12px; }
.item-info { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 16px; }
.item-info > .actions, .item-info > .status-note { align-self: stretch; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.crumbs a:hover { color: var(--text); }
.crumbs .i { width: 14px; height: 14px; }
.item h1 { font-size: 20px; font-weight: 500; overflow-wrap: anywhere; }
/* плашка с ценой и условием сделки */
.price-box { align-self: stretch; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 16px 20px; background: #f4eefd; border-radius: var(--r-l); }
.price-tag { color: var(--accent-ink); font-size: 32px; font-weight: 700; letter-spacing: -.025em; line-height: 40px; }
.price-box .deal { padding: 4px 12px; border-radius: 99px; background: var(--bg); color: var(--accent-ink); font-size: 12px; font-weight: 600; line-height: 20px; }
.price-was { flex-basis: 100%; color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.price-was s { margin-right: 8px; }
.price-same { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; color: var(--accent-ink); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.price-same .i { width: 16px; height: 16px; }
.meta { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.meta .i { width: 16px; height: 16px; color: var(--muted); }
.item-more { display: flex; flex-direction: column; align-items: stretch; gap: 32px; padding-top: 24px; }
.item-seller > .link-btn { align-self: flex-start; }
.item-more h2 { margin-bottom: 12px; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 70ch; }
.specs > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.specs > div:first-child { padding-top: 0; }
.specs dt { color: var(--muted); flex: none; }
.specs dd { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); font-size: 12px; font-weight: 500; }
.write { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-l); }
.item-more .write h2 { margin-bottom: 4px; }
.write-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.write-row .input { flex: 999 1 200px; width: auto; min-width: 0; background: var(--bg); }
.write-row .btn { flex: 1 0 auto; padding-inline: 24px; }
.item-map .meta { margin-bottom: 12px; }
.item-map iframe { display: block; width: 100%; height: 280px; border: 0; border-radius: var(--r-l); background: var(--surface); }
.item-map .link-btn { margin-top: 8px; }
.item-stamp { padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.item-seller { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }
.seller-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 16px; padding: 16px; background: var(--surface); border-radius: var(--r-l); }
.seller-card h2 { font-size: 16px; overflow-wrap: anywhere; }
.seller-card p { color: var(--muted); font-size: 12px; }
.seller-card .btn { grid-column: 1 / -1; }
.same, .similar { margin-top: 40px; }
.same h2, .similar h2 { margin-bottom: 16px; }
.same { scroll-margin-top: 104px; }
.same-list { display: grid; gap: 0 32px; }
.same-list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; height: 100%; padding: 12px 0; border-bottom: 1px solid var(--line); }
.same-list .my-photo { width: 64px; height: 64px; }
.same-text, .same-price { display: flex; flex-direction: column; min-width: 0; }
.same-text strong { font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.same-text small, .same-price small { color: var(--muted); font-size: 12px; }
.same-price { align-items: flex-end; }
.same-price b { font-size: 16px; font-weight: 600; white-space: nowrap; }
.same-price small { white-space: nowrap; }
.same-price small.cheaper { color: var(--ok); font-weight: 600; }
.seller-page > .seller-card { max-width: 560px; margin-bottom: 24px; }
.seller-card > .verified, .seller-card > .rating { grid-column: 1 / -1; }
.verified { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 4px 12px 4px 8px; border-radius: 99px; background: var(--bg); color: var(--accent-ink); font-size: 12px; font-weight: 600; line-height: 20px; }
.verified .i { width: 18px; height: 18px; }
.rating { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.seller-card .rating { font-size: 13px; }
.seller-card .rating span:last-child { color: var(--muted); }
.stars { display: inline-flex; gap: 2px; }
.stars .i { width: 16px; height: 16px; color: var(--muted); }
.stars .i.on { fill: var(--accent); stroke: var(--accent); }
.reviews { max-width: 560px; margin-top: 40px; scroll-margin-top: 104px; }
.reviews h2 { margin-bottom: 12px; }
.reviews h3 { margin: 24px 0 12px; font-size: 16px; font-weight: 600; }
.reviews li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.reviews li div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.reviews li strong { font-weight: 600; overflow-wrap: anywhere; }
.reviews li small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.reviews li p { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.reviews > .small { margin-top: 12px; }
.rate { display: flex; gap: 4px; }
.rate label { position: relative; display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; }
.rate input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rate .i { width: 32px; height: 32px; color: var(--muted); pointer-events: none; }
.rate label.on .i { fill: var(--accent); stroke: var(--accent); }
.rate label:has(input:focus-visible) { outline: 2px solid var(--accent-ink); border-radius: var(--r-s); }

/* ---------- вход и регистрация ---------- */
.auth { display: flex; flex-direction: column; gap: 16px; }
.tabs-line { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface); border-radius: var(--r); }
.tabs-line button { min-height: 40px; border-radius: var(--r-s); font-weight: 600; color: var(--muted); }
.tabs-line button[aria-selected='true'] { background: var(--bg); color: var(--text); box-shadow: var(--shadow); }
.auth .form { gap: 16px; }
.field > small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.auth .link-btn { align-self: center; }
.code-view h3 { font-size: 18px; font-weight: 600; }
.backup-code { display: block; padding: 16px 8px; border: 1px dashed var(--accent); border-radius: var(--r); font-size: 19px; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; text-align: center; overflow-wrap: anywhere; user-select: all; }
.account .menu { margin-top: 12px; }
.menu small.todo { color: var(--accent-ink); font-weight: 600; }
.price-hint { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: -8px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r); }
.price-hint small { color: var(--muted); font-size: 12px; }
.field > span.pass { position: relative; margin: 0; font-weight: 400; }
.pass .input { padding-right: 52px; }
.pass .input::-ms-reveal { display: none; }
.eye { position: absolute; top: 0; right: 0; bottom: 0; display: grid; place-items: center; width: 48px; border-radius: var(--r); color: var(--muted); cursor: pointer; }
.eye:hover { color: var(--text); }
[data-field].bad > small { display: none; }

/* ---------- чаты ---------- */
.dialogs a { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dialogs .my-photo { width: 64px; height: 64px; }
.dialog-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dialog-text > span { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.dialog-text strong { font-weight: 600; }
.dialog-text strong, .dialog-text > small, .dialog-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dialog-text small { color: var(--muted); font-size: 12px; }
.dialog-text > span > small { flex: none; }
.dialog-last { color: var(--text-2); }
.dialogs .new .dialog-last { color: var(--text); font-weight: 600; }
.dialog-text .pinned { display: inline-block; margin-right: 4px; vertical-align: -2px; }
.dialog-text .pinned .i { display: block; width: 14px; height: 14px; }
.dialogs li { position: relative; }
.dialog-remove { display: none; }
/* крестик нужен только там, где есть наведение: на телефоне чат удаляется из его меню */
@media (hover: hover) {
  .dialogs a { padding-right: 52px; }
  .dialog-remove { position: absolute; top: 50%; right: 0; display: grid; place-items: center; width: 40px; height: 40px; margin-top: -20px; border-radius: var(--r); color: var(--muted); opacity: 0; transition: opacity .15s var(--ease); }
  .dialogs li:hover .dialog-remove, .dialog-remove:focus-visible { opacity: 1; }
  .dialog-remove:hover { background: var(--surface); color: var(--danger); }
}
.dialog-text b { flex: none; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; }
body[data-page='chat'] #view { padding-bottom: 0; }
.chat { display: flex; flex-direction: column; max-width: 720px; min-height: calc(100dvh - var(--safe-t)); margin: 0 auto; }
.chat-top { position: sticky; z-index: 5; top: 0; padding-bottom: 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
.chat-top .page-head { max-width: none; padding-block: 8px; }
.chat-top h1 { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-ad { display: flex; align-items: center; gap: 12px; padding: 8px; background: var(--surface); border-radius: var(--r); }
.chat-ad .my-photo { width: 48px; height: 48px; background: var(--surface-2); border-radius: var(--r-s); }
.chat-ad > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.chat-ad strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-ad small { color: var(--muted); font-size: 12px; }
.chat-review:not(:empty) { padding-top: 4px; }
.chat-review .link-btn { color: var(--accent-ink); }
.messages { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 16px 0; }
.day { align-self: center; padding: 4px 12px; color: var(--muted); font-size: 12px; }
.msg { align-self: flex-start; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 82%; }
.msg p { padding: 8px 12px; border-radius: 4px 16px 16px 16px; background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.msg small { color: var(--muted); font-size: 11px; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.mine p { border-radius: 16px 4px 16px 16px; background: var(--accent); color: #fff; }
.composer { position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px; padding: 12px 0 calc(12px + var(--safe-b)); background: var(--bg); border-top: 1px solid var(--line); }
.composer textarea { resize: none; min-height: 48px; }
.composer .btn { width: 48px; padding: 0; flex: none; }
.attach { display: grid; place-items: center; flex: none; width: 40px; height: 48px; margin-left: -8px; border-radius: var(--r); color: var(--muted); }
.attach:hover { color: var(--text); }
.attach.busy { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.msg-photo { display: block; width: 224px; max-width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; border-radius: var(--r-l); background: var(--surface); cursor: zoom-in; }
.msg-photo img { width: 100%; height: 100%; object-fit: cover; font-size: 12px; color: var(--muted); }
.msg-photo img:not([src]) { visibility: hidden; }
.chat-head { display: flex; align-items: center; gap: 8px; }
.chat-head .page-head { flex: 1; min-width: 0; }
.chat-head > .icon-btn { margin-right: -12px; }
.chat-closed { position: sticky; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0 calc(16px + var(--safe-b)); background: var(--bg); border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.chat-queue h2, .review-queue h2 { margin: 24px 0 12px; }
.log { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; overflow-wrap: anywhere; }
.log .accused b { color: var(--error); }
.log img { margin-top: 8px; max-height: 320px; border-radius: var(--r-s); }

/* ---------- фото на весь экран ---------- */
.viewer { position: fixed; z-index: 45; inset: 0; background: var(--bg); animation: fade .18s var(--ease); }
.v-track { display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.v-track::-webkit-scrollbar, .v-slide::-webkit-scrollbar { display: none; }
.v-track.still { overflow: hidden; scroll-snap-type: none; }
.v-slide { flex: 0 0 100%; display: flex; min-width: 0; height: 100%; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; scrollbar-width: none; overscroll-behavior: contain; }
.v-slide img { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; user-select: none; }
.v-slide.zoomed { overflow: auto; }
.v-slide.zoomed img { flex: none; max-width: none; max-height: none; height: auto; cursor: grab; }
.v-close { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; }
.counter.v-counter { right: auto; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); }
.v-prev, .v-next { display: none; position: absolute; top: calc(50% - 20px); }
.v-prev { left: 16px; }
.v-next { right: 16px; }
.seller { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border-radius: var(--r-l); }
.seller div { flex: 1; min-width: 0; }
.seller strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.seller small { color: var(--muted); font-size: 12px; }
.avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface-2); font-weight: 600; font-size: 18px; flex: none; }
.safety { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--line); color: var(--text-2); font-size: 12px; }
.safety .i { color: var(--accent-ink); }
.status-note { padding: 12px 16px; border-radius: var(--r); background: var(--surface-2); font-weight: 600; }
.actions { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + var(--safe-b)); background: var(--bg); border-top: 1px solid var(--line); }
.actions > p { font-size: 12px; color: var(--muted); margin-bottom: 8px; text-align: center; }
.phone { font-size: 28px; font-weight: 600; text-align: center; margin-bottom: 16px; user-select: all; }
.sheet .safety { margin-top: 16px; }

/* ---------- профиль ---------- */
#view .narrow > section { margin-bottom: 32px; }
#view .narrow > section:empty { display: none; }
.narrow > section > h2 { margin-bottom: 12px; }
.panel { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--surface); border-radius: var(--r-l); }
.panel h2 { display: flex; align-items: center; gap: 8px; }
.panel h2 .i { color: var(--muted); }
.mine > p { margin-bottom: 12px; }
.my { padding: 16px 0; border-bottom: 1px solid var(--line); }
.my:first-child { padding-top: 0; }
.my-main { display: flex; gap: 12px; }
.my-main > span:last-child { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.my-main strong { font-weight: 400; overflow-wrap: anywhere; }
.my-main b { font-size: 16px; font-weight: 600; }
.my-main small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.my-main small .i { width: 14px; height: 14px; }
.my-main small.st-active { color: var(--ok); }
.my-photo { display: grid; place-items: center; width: 84px; height: 84px; flex: none; border-radius: var(--r); overflow: hidden; background: var(--surface); color: var(--muted); }
.my-photo img { width: 100%; height: 100%; object-fit: cover; }
.my-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.menu { background: var(--surface); border-radius: var(--r-l); overflow: hidden; }
.menu li + li { border-top: 1px solid var(--line); }
.menu button, .menu a { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; text-align: left; }
.menu span { flex: 1; }
.menu small { color: var(--muted); font-size: 12px; }
.menu .i { color: var(--muted); }
.menu .i:last-child { width: 16px; height: 16px; }
.menu button.danger, .menu button.danger .i { color: var(--danger); }
.sheet-actions { display: flex; gap: 12px; }
.sheet-actions .btn { flex: 1; }
.credit { margin-top: 32px; text-align: center; color: var(--muted); font-size: 12px; }
.prose section { margin-bottom: 24px; }
.prose h2 { margin-bottom: 8px; }
.prose ul { list-style: disc; padding-left: 20px; }
.prose li { margin-bottom: 4px; }

/* ---------- подвал ---------- */
#footer { border-top: 1px solid var(--line); padding: 32px 16px calc(var(--tabs) + var(--safe-b) + 24px); }
body[data-page='item'] #footer { padding-bottom: calc(104px + var(--safe-b)); }
.foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; max-width: 1232px; margin: 0 auto; }
.foot-about { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.foot-about p { color: var(--muted); max-width: 40ch; }
.foot h2 { font-size: 14px; margin-bottom: 8px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 32px; color: var(--muted); }
.foot nav a:hover { color: var(--text); }
.foot-credit { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

/* ---------- шторка и уведомление ---------- */
.sheet-wrap { position: fixed; z-index: 40; inset: 0; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .4); animation: fade .18s var(--ease); }
.sheet { display: flex; flex-direction: column; width: 100%; max-width: 520px; max-height: 88dvh; background: var(--bg); border-radius: 20px 20px 0 0; animation: rise .24s var(--ease); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 4px 20px; }
.sheet-head h2 { overflow-wrap: anywhere; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 12px 20px calc(20px + var(--safe-b)); }
.sheet-body > p { margin-bottom: 16px; }
.sheet-body > .field { display: block; margin-bottom: 16px; }
.options button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; text-align: left; border-bottom: 1px solid var(--line); }
.options li:last-child button { border-bottom: 0; }
.options button[aria-pressed='true'] { color: var(--accent-ink); font-weight: 600; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 12px 0; }
.steps .i { color: var(--accent-ink); width: 24px; height: 24px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
#toast { position: fixed; z-index: 50; left: 50%; bottom: calc(var(--tabs) + var(--safe-b) + 24px); transform: translate(-50%, 8px); width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: var(--r); background: var(--text); color: #fff; font-weight: 500; text-align: center; opacity: 0; visibility: hidden; transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s; }
#toast.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
body[data-page='item'] #toast { bottom: calc(var(--safe-b) + 96px); }

/* ---------- планшет и компьютер ---------- */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 16px; }
  .foot { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  :root { --tabs: 0px; }
  #tabs { display: none; }
  #topbar, body[data-page] #topbar { display: block; position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
  .head { display: flex; gap: 16px; max-width: 1272px; margin: 0 auto; padding: 16px 20px; border: 0; }
  .searchbar { flex: 1; min-width: 0; height: 52px; }
  .head .pill { display: flex; align-items: center; height: 52px; padding: 0 8px; background: var(--surface); border-radius: var(--r-l); }
  .pill a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); transition: background-color .15s var(--ease); }
  .pill a { position: relative; }
  .pill a + a { margin-left: 12px; }
  .pill a + a::before { content: ''; position: absolute; left: -7px; top: 10px; bottom: 10px; width: 1px; background: var(--line); }
  .pill a:hover { background: var(--surface-2); }
  .pill a[aria-current] { color: var(--accent-ink); background: var(--surface-2); }
  .head .head-post { display: inline-flex; height: 52px; border-radius: var(--r-l); white-space: nowrap; }
  #view { max-width: 1272px; padding-inline: 20px; padding-bottom: 64px; }
  .has-footer #view { padding-bottom: 64px; }
  .cats, .chips { margin-inline: 0; padding-inline: 0; }
  .cats { padding-block: 24px 16px; }
  .cat span { width: 72px; height: 72px; }
  .cat img { width: 48px; height: 48px; }
  .cat:hover span { background: var(--surface-2); }
  .cat[aria-pressed='true']:hover span { background: rgba(120, 55, 212, .12); }
  .cats-arrow { display: grid; place-items: center; position: absolute; top: 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(0, 0, 0, .14); }
  .cats-arrow.prev { left: -16px; }
  .cats-arrow.next { right: -16px; }
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px 16px; }
  .card h3 { transition: color .15s var(--ease); }
  .card:hover h3 { color: var(--accent-ink); }
  .page-head:first-child { padding-top: 24px; }
  body[data-page='item'] #view { padding: 24px 20px 64px; }
  .item { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px 32px; align-items: start; }
  .col-main, .col-side { display: flex; flex-direction: column; min-width: 0; }
  .col-main { gap: 32px; }
  .col-side { gap: 24px; }
  .same, .similar { grid-column: 1 / -1; margin: 0; }
  .item-info, .item-more, .item-seller, .same, .similar { padding: 0; }
  .same-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v-prev, .v-next { display: grid; }
  body[data-page='chat'] #view { padding-block: 0; }
  .chat { min-height: calc(100dvh - 85px); }
  #promo > div { min-height: 96px; gap: 24px; }
  #promo img { width: 64px; height: 64px; }
  #promo p { flex: 0 1 auto; margin-right: auto; }
  .chat-top { top: 85px; }
  .item-seller { margin: 0; }
  .gallery-wrap { background: none; }
  .gallery { flex-direction: column; gap: 12px; overflow: visible; aspect-ratio: auto; max-height: none; }
  .gallery > img, .gallery > .no-photo { flex: none; width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 640px; background: var(--surface); border-radius: var(--r-l); }
  .thumbs, .counter { display: none; }
  .actions { position: static; margin-top: 12px; padding: 0; border: 0; background: none; }
  .actions > p { text-align: left; }
  #footer, body[data-page='item'] #footer { padding: 48px 20px 32px; }
  .foot { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); }
  .foot-about { grid-column: auto; }
  .sheet-wrap { align-items: center; padding: 20px; }
  .sheet { border-radius: 20px; }
  #toast, body[data-page='item'] #toast { bottom: 32px; }
}

/* на широких экранах в ряд помещается целое число категорий, без обрезанной плитки */
@media (min-width: 900px) { .cat { width: calc((100% - 8 * 4px) / 9); } }
@media (min-width: 1100px) { .cat { width: calc((100% - 11 * 4px) / 12); } }
@media (min-width: 1272px) { .cat { width: calc((100% - 13 * 4px) / 14); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
