/* ============ Барахолка — дизайн ============ */
:root {
  --bg: #f3f4f8; --card: #ffffff; --card2: #f6f7fa; --text: #15171c; --hint: #858b96;
  --sep: rgba(20, 24, 33, .08); --shadow: 0 1px 2px rgba(20,24,33,.04), 0 4px 14px rgba(20,24,33,.06);
  --danger: #e5484d; --ok: #2fa84f; --gold: #f5a524;
  --accent: #2f7cf6; --accent-2: #5a9bff; --accent-text: #ffffff;
  --radius: 18px; --tabbar-h: 66px;
  color-scheme: light;
}
:root[data-scheme="dark"] {
  --bg: #0f1115; --card: #1a1d23; --card2: #23272f; --text: #eef0f4; --hint: #8d939e;
  --sep: rgba(255,255,255,.08); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  color-scheme: dark;
}
:root[data-accent="green"]  { --accent: #1fa463; --accent-2: #45c486; }
:root[data-accent="violet"] { --accent: #7c5cf5; --accent-2: #a08bff; }
:root[data-accent="orange"] { --accent: #f07a1a; --accent-2: #ffa055; }
:root[data-accent="pink"]   { --accent: #e5408a; --accent-2: #ff77b0; }
:root { --accent-soft: color-mix(in srgb, var(--accent) 13%, transparent); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.42 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
body { padding-bottom: calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom)); min-height: 100vh;
  /* нельзя выделять и копировать интерфейс */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img { -webkit-user-drag: none; user-select: none; pointer-events: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
body.no-tabbar { padding-bottom: env(safe-area-inset-bottom); }

/* ---------- каркас: всё по центру ---------- */
.page { width: 100%; max-width: 640px; margin: 0 auto; padding: 14px 14px 24px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.hint { color: var(--hint); font-size: 13px; }
.h2 { font-size: 18px; font-weight: 750; margin: 22px 4px 12px; letter-spacing: -.2px; }
.section { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.empty { text-align: center; color: var(--hint); padding: 40px 20px; }
.empty .big { font-size: 46px; margin-bottom: 10px; }

/* заголовок страницы с описанием — одинаковый везде */
.page-head { text-align: center; padding: 10px 12px 18px; }
.page-head .ph-ico { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 22px; display: grid; place-items: center;
  font-size: 32px; background: var(--accent-soft); }
.page-head h1 { font-size: 22px; margin: 0; font-weight: 800; letter-spacing: -.3px; }
.page-head p { margin: 6px auto 0; max-width: 420px; color: var(--hint); font-size: 14px; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px;
  padding: 13px 16px; font-weight: 650; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-text); width: 100%; transition: transform .08s, opacity .2s; text-align: center; }
.btn:active { transform: scale(.98); }
.btn.secondary { background: var(--card2); color: var(--text); }
.section .btn.secondary, .sheet .btn.secondary { background: var(--card2); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.btn.danger-solid { background: var(--danger); color: #fff; }
.btn.report { background: transparent; color: var(--danger); border: 1.5px solid color-mix(in srgb, var(--danger) 55%, transparent); }
.btn.gold { background: linear-gradient(135deg, #f7b42c, #fc7a3a); color: #fff; }
.btn.ok { background: linear-gradient(135deg, #22a75a, #45c486); color: #fff; }
.btn.small { padding: 8px 12px; font-size: 14px; width: auto; border-radius: 11px; }
.btn.two { flex-direction: column; gap: 1px; padding: 10px; }
.btn.two small { font-weight: 500; opacity: .85; font-size: 12.5px; }
.btn:disabled { opacity: .5; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stack > * + * { margin-top: 8px; }

/* ---------- значки ---------- */
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 750; padding: 2px 8px;
  border-radius: 999px; vertical-align: middle; letter-spacing: .2px; white-space: nowrap; }
.badge.top { background: var(--gold); color: #3b2500; }
.badge.type { background: var(--accent); color: #fff; }
.badge.sold { background: #5a6170; color: #fff; }
.badge.pending { background: color-mix(in srgb, var(--gold) 22%, transparent); color: #b8760b; }
.badge.active { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge.rejected { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge.archived, .badge.deleted { background: var(--card2); color: var(--hint); }
.badge.plan-lite { background: linear-gradient(135deg, #17b3a3, #39d0b0); color: #fff; }
.badge.plan-medium { background: linear-gradient(135deg, #6c5ce7, #a08bff); color: #fff; }
.badge.plan-pro { background: linear-gradient(135deg, #f7b42c, #fc6a3a); color: #fff; }
.badge.role-admin { background: linear-gradient(135deg, #e5484d, #ff7a59); color: #fff; }
.badge.role-moderator { background: linear-gradient(135deg, #2f7cf6, #5ac8fa); color: #fff; }
.badge.verified { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }

/* ---------- нижнее меню (не растягивается) ---------- */
#tabbar { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom)); width: min(560px, calc(100% - 20px)); height: var(--tabbar-h);
  display: flex; align-items: center; padding: 0 6px; border-radius: 24px;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px rgba(10, 14, 30, .16), 0 0 0 1px var(--sep); }
#tabbar a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--hint);
  font-size: 10.5px; font-weight: 600; padding: 6px 0; border-radius: 16px; }
#tabbar .ico { position: relative; font-size: 21px; line-height: 24px; filter: grayscale(1); opacity: .75; }
#tabbar a.active { color: var(--accent); }
#tabbar a.active .ico { filter: none; opacity: 1; }
#tabbar .tab-create .ico { width: 44px; height: 30px; border-radius: 12px; display: grid; place-items: center; filter: none; opacity: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 20px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent); }
#tabbar .tab-create { color: var(--accent); }
.lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab-badge { position: absolute; top: -4px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; font-style: normal; font-weight: 700; }

/* ---------- лента ---------- */
.hero { display: flex; align-items: center; gap: 12px; padding: 4px 4px 12px; }
.hero .logo { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; font-size: 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.hero b { display: block; font-size: 19px; letter-spacing: -.3px; }
.search { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 8px 0 4px; }
.search-row { display: flex; gap: 8px; }
.search-box { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; padding: 0 12px;
  box-shadow: var(--shadow); }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 0; outline: none; }
.icon-btn { border: 0; background: var(--card); border-radius: 14px; width: 44px; height: 44px; font-size: 18px; position: relative;
  box-shadow: var(--shadow); display: grid; place-items: center; flex: none; }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.icon-btn.sub-on { background: var(--ok); box-shadow: 0 4px 14px color-mix(in srgb, var(--ok) 40%, transparent); }
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--card); color: var(--text);
  white-space: nowrap; font-size: 14px; font-weight: 550; box-shadow: var(--shadow); }
.chip.on { background: var(--accent); color: #fff; }
.chips.sub .chip { font-size: 13px; padding: 6px 12px; box-shadow: none; background: var(--card2); }
.chips.sub .chip.on { background: var(--accent-soft); color: var(--accent); }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.section .chip, .sheet .chip { background: var(--card2); box-shadow: none; }
.section .chip.on, .sheet .chip.on { background: var(--accent); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; color: var(--text); display: flex;
  flex-direction: column; position: relative; box-shadow: var(--shadow); transition: transform .1s; }
.card:active { transform: scale(.98); }
.card.top { box-shadow: 0 0 0 2px var(--gold), var(--shadow); }
.card .ph { aspect-ratio: 1; background: var(--card2) center/cover no-repeat; }
.card .body { padding: 9px 11px 12px; }
.card .badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.price { font-weight: 800; font-size: 17px; letter-spacing: -.2px; }
.card .title { font-size: 14px; margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { color: var(--hint); font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { margin: 14px 0; }
.skeleton { background: var(--card); border-radius: var(--radius); aspect-ratio: .74; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.ad-card { grid-column: 1 / -1; background: var(--card); border-radius: var(--radius); overflow: hidden; display: flex;
  box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.ad-img { width: 36%; min-height: 128px; background: var(--card2) center/cover; flex: none; }
.ad-body { padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; }
.ad-label { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--hint); font-weight: 700; }
.ad-title { font-weight: 750; margin: 3px 0; font-size: 16px; }

/* ---------- карточка объявления ---------- */
.gallery-wrap { position: relative; margin: -14px -14px 12px; }
@media (min-width: 640px) { .gallery-wrap { margin: 0 0 12px; border-radius: var(--radius); overflow: hidden; } }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 1; }
.gallery::-webkit-scrollbar { display: none; }
.slide { flex: none; width: 100%; height: 100%; position: relative; overflow: hidden; scroll-snap-align: center; cursor: zoom-in; }
.slide .blur { position: absolute; inset: -30px; background: center/cover; filter: blur(28px) saturate(1.2); transform: scale(1.1); }
.slide img { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; }
.dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 0 3px rgba(0,0,0,.3); }
.dots i.on { background: #fff; width: 18px; border-radius: 4px; }
.g-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.g-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18); display: grid; place-items: center; color: #111; }
.detail-price { font-size: 28px; font-weight: 850; letter-spacing: -.5px; }
.detail-title { font-size: 18px; margin: 2px 0 12px; font-weight: 550; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tag { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--card2); font-weight: 600; }
.kv { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--sep); }
.kv:first-of-type { border-top: 0; }
.kv .k { color: var(--hint); width: 108px; flex: none; }
.desc { white-space: pre-wrap; word-wrap: break-word; }
.safety { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--ok) 10%, var(--card));
  border-radius: 14px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 12px; }
.safety .s-ico { font-size: 20px; }
.notice { border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; background: var(--card); }
.notice.warn { background: color-mix(in srgb, var(--gold) 16%, var(--card)); }
.notice.err { background: color-mix(in srgb, var(--danger) 12%, var(--card)); }
.notice.ok { background: color-mix(in srgb, var(--ok) 12%, var(--card)); }
.seller { display: flex; gap: 12px; align-items: center; color: var(--text); }
.seller-name { font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rating { color: var(--gold); letter-spacing: 1px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: center; }
.mini-stats b { display: block; font-size: 18px; }
.mini-stats span { font-size: 11px; color: var(--hint); }
.meta-line { text-align: center; color: var(--hint); font-size: 13px; margin: 6px 0 12px; }

/* ---------- просмотр фото ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: #000; }
.lightbox .lb-bg { position: absolute; inset: -40px; background: center/cover; filter: blur(40px) brightness(.55); transform: scale(1.1); }
.lightbox .lb-track { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lightbox .lb-track::-webkit-scrollbar { display: none; }
.lightbox .lb-slide { flex: none; width: 100%; height: 100%; display: grid; place-items: center; scroll-snap-align: center; padding: 56px 0; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lightbox .lb-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; z-index: 2; width: 42px; height: 42px;
  border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 20px; backdrop-filter: blur(8px); }
.lightbox .lb-count { position: absolute; top: calc(22px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; color: #fff;
  font-weight: 600; z-index: 2; text-shadow: 0 1px 3px rgba(0,0,0,.5); pointer-events: none; }

/* ---------- формы ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span, .field .lbl2 { display: block; font-size: 13px; color: var(--hint); margin: 0 2px 7px; font-weight: 600; }
.input, select.input, textarea.input { width: 100%; border: 1.5px solid var(--sep); background: var(--card2);
  border-radius: 13px; padding: 12px 13px; outline: none; transition: border-color .15s; }
.input:focus { border-color: var(--accent); background: var(--card); }
textarea.input { min-height: 110px; resize: vertical; }
.counter-hint { text-align: right; font-size: 12px; color: var(--hint); margin-top: 4px; }
.photos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.photos .ph { aspect-ratio: 1; border-radius: 12px; background: var(--card2) center/cover; position: relative; }
.photos .ph .x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.6); color: #fff; font-size: 12px; line-height: 22px; padding: 0; }
.photos .ph .main { position: absolute; left: 3px; bottom: 3px; font-size: 9.5px; background: rgba(0,0,0,.6); color: #fff;
  border-radius: 6px; padding: 1px 5px; }
.photos .add { aspect-ratio: 1; border-radius: 12px; border: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  display: grid; place-items: center; color: var(--accent); font-size: 26px; background: var(--accent-soft); }
.seg { display: flex; background: var(--card2); border-radius: 13px; padding: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 4px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--card); box-shadow: var(--shadow); color: var(--accent); }
.swatches { display: flex; gap: 12px; justify-content: center; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; }
.swatch.on { border-color: var(--text); }

/* ---------- профиль и меню (все пункты одного размера) ---------- */
.avatar { display: inline-block; flex: none; border-radius: 50%; background: var(--card2) center/cover no-repeat; }
.avatar.letter { display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 750; }
.profile-card { text-align: center; padding: 22px 16px 18px; }
.profile-card .avatar { margin: 0 auto 10px; display: block; }
.profile-card .avatar.letter { display: grid; }
.p-name { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.p-badges { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 8px 0 4px; }
.menu { background: var(--card); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); }
.menu-item { display: flex; align-items: center; gap: 13px; padding: 0 14px; min-height: 68px; color: var(--text);
  border-top: 1px solid var(--sep); }
.menu-item:first-child { border-top: 0; }
.mi-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; flex: none;
  background: var(--accent-soft); }
.mi-title { display: block; font-weight: 650; }
.mi-desc { display: block; color: var(--hint); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--hint); font-size: 20px; }
.count { background: var(--danger); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 8px; }

.welcome { text-align: center; padding: 10px 10px 18px; }
.avatar-edit { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; }
.avatar-edit label { cursor: pointer; }

/* ---------- списки ---------- */
.list-item { display: flex; gap: 12px; padding: 12px; background: var(--card); border-radius: var(--radius);
  margin-bottom: 9px; color: var(--text); align-items: center; box-shadow: var(--shadow); min-height: 88px; }
.list-item .thumb { width: 64px; height: 64px; flex: none; border-radius: 13px; background: var(--card2) center/cover; }
.list-item .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review { padding: 12px 0; border-top: 1px solid var(--sep); }
.review:first-child { border-top: 0; padding-top: 0; }
.star-pick { display: flex; justify-content: center; gap: 6px; margin: 14px 0; }
.star-pick button { border: 0; background: none; font-size: 40px; color: var(--gold); padding: 0 2px; }
.link-box { background: var(--card2); border-radius: 12px; padding: 12px; margin: 8px 0 12px; word-break: break-all; font-size: 14px; text-align: center; }

/* ---------- тарифы ---------- */
.plans { display: grid; gap: 10px; }
.plan { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.plan.current { box-shadow: 0 0 0 2px var(--ok), var(--shadow); }
.plan h3 { margin: 0 0 2px; font-size: 19px; }
.plan .pp { font-size: 22px; font-weight: 850; }
.plan ul { margin: 10px 0 14px; padding: 0; list-style: none; }
.plan li { padding: 4px 0; font-size: 14px; }
.plan .ribbon { position: absolute; top: 14px; right: 14px; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pack { background: var(--card); border-radius: 16px; padding: 14px 8px; text-align: center; box-shadow: var(--shadow); border: 0; }
.pack b { display: block; font-size: 22px; }
.pack .pp { color: var(--accent); font-weight: 750; margin-top: 4px; display: block; }

/* ---------- админка ---------- */
.tabs { display: flex; background: var(--card); border-radius: 14px; padding: 4px; margin-bottom: 12px; box-shadow: var(--shadow);
  overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; background: transparent; padding: 9px 13px; border-radius: 11px; font-size: 14px; font-weight: 600; color: var(--hint); }
.tabs button.on { background: var(--accent); color: #fff; }
.dict-item { display: flex; align-items: center; gap: 6px; padding: 10px 0; border-top: 1px solid var(--sep); }
.dict-item:first-child { border-top: 0; }
.dict-item.hidden-item .name { opacity: .45; text-decoration: line-through; }
.dict-item.sub { padding: 7px 0; font-size: 14px; }
.mini { border: 0; background: var(--card2); border-radius: 9px; min-width: 32px; height: 32px; font-size: 14px; }
.dict-item.sub .mini { min-width: 28px; height: 28px; font-size: 12px; }
.subs-box { margin: 4px 0 0 16px; padding-left: 10px; border-left: 2px solid var(--sep); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stat { background: var(--card); border-radius: 16px; padding: 13px 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 22px; }
.mod-card { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 11px; box-shadow: var(--shadow); }
.mod-photos { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0; }
.mod-photos img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; flex: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.form-grid .field { margin-bottom: 4px; }

/* ---------- шторка и тост ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5,8,15,.45); backdrop-filter: blur(2px); }
.sheet-body { position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; width: min(640px, 100%); background: var(--card);
  border-radius: 24px 24px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto;
  animation: up .2s ease-out; }
.sheet-body::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--sep); margin: 0 auto 12px; }
@keyframes up { from { transform: translate(-50%, 40px); opacity: .4; } }
.sheet h3 { margin: 0 0 12px; font-size: 19px; text-align: center; }
.sheet .s-ico-big { font-size: 46px; text-align: center; }
#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 30px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 90; background: rgba(20,22,28,.92); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 14px;
  max-width: min(90vw, 520px); text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* ---------- чат (растягивается на всю высоту и ширину) ---------- */
.chat-page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; width: 100%; max-width: 980px; margin: 0 auto;
  background: var(--bg); }
.chat-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--card); border-bottom: 1px solid var(--sep); }
.chat-listing { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--sep);
  color: var(--text); font-size: 13px; }
.chat-listing .thumb { width: 40px; height: 40px; border-radius: 10px; flex: none; background: var(--card2) center/cover; }
.chat-safety { margin: 10px auto 4px; max-width: 520px; text-align: center; font-size: 12.5px; color: var(--hint);
  background: var(--card); border-radius: 12px; padding: 8px 12px; }
.messages { flex: 1; overflow-y: auto; padding: 8px 14px 12px; display: flex; flex-direction: column; gap: 6px; -webkit-user-select: none; }
.bubble { max-width: min(78%, 560px); padding: 9px 13px 6px; border-radius: 18px 18px 18px 6px; background: var(--card);
  align-self: flex-start; white-space: pre-wrap; word-wrap: break-word; box-shadow: var(--shadow); }
.bubble.mine { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-radius: 18px 18px 6px 18px; align-self: flex-end; }
.bubble.admin { align-self: center; max-width: 90%; background: color-mix(in srgb, var(--danger) 9%, var(--card));
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); border-radius: 14px; }
.bubble .who { display: block; font-size: 11.5px; font-weight: 750; margin-bottom: 2px; opacity: .8; }
.bubble .time { display: block; text-align: right; font-size: 10px; opacity: .65; margin-top: 2px; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--sep); }
.composer textarea { flex: 1; resize: none; border: 1.5px solid var(--sep); border-radius: 20px; padding: 10px 14px; background: var(--card2); outline: none; max-height: 140px; }
.composer .c-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card2); font-size: 20px; flex: none; }
.composer .send { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.emoji-panel { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 2px; padding: 8px 10px;
  background: var(--card); border-top: 1px solid var(--sep); max-height: 210px; overflow-y: auto; }
.emoji-panel button { border: 0; background: none; font-size: 26px; height: 42px; border-radius: 10px; }
.emoji-panel button:active { background: var(--card2); }

/* ===================== версия 4: карусель, анимации, поддержка ===================== */
/* единая карточка: фото всегда 4:5, любые пропорции аккуратно заполняют рамку */
.card .cz { aspect-ratio: 4 / 5; }
.card .title { min-height: 2.84em; }
.card .seller-line { font-size: 12px; color: var(--hint); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .seller-line .st { color: var(--gold); }
.cz { position: relative; overflow: hidden; background: var(--card2); touch-action: pan-y; }
.cz-track { display: flex; height: 100%; will-change: transform; transition: transform .32s cubic-bezier(.22,.8,.3,1); }
.cz-track.dragging { transition: none; }
.cz-slide { flex: none; width: 100%; height: 100%; position: relative; overflow: hidden; }
.cz-slide .bg { position: absolute; inset: 0; background: center/cover no-repeat; }
.cz.fit .cz-slide .bg { inset: -30px; filter: blur(26px) saturate(1.2); transform: scale(1.1); }
.cz.fit .cz-slide .fg { position: absolute; inset: 0; background: center/contain no-repeat; }
.cz-bar { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 3px; z-index: 2; pointer-events: none; }
.cz-bar i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.45); box-shadow: 0 0 2px rgba(0,0,0,.25);
  transition: background .2s; }
.cz-bar i.on { background: #fff; }
.cz-count { position: absolute; right: 10px; bottom: 16px; z-index: 2; font-size: 11px; font-weight: 700; color: #fff;
  background: rgba(0,0,0,.4); padding: 2px 7px; border-radius: 8px; pointer-events: none; }
.gallery-wrap .cz { aspect-ratio: 1; }
.gallery-wrap .cz-bar { bottom: 14px; left: 16px; right: 16px; }
.gallery-wrap .cz-bar i { height: 4px; }
.heart { position: absolute; top: 8px; right: 8px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.88); display: grid; place-items: center; font-size: 16px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.heart.pop { animation: pop .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.card .badges { z-index: 3; }

/* lightbox на карусели */
.lightbox .cz { position: absolute; inset: 0; background: transparent; }
.lightbox .cz-slide .fg { inset: 56px 0; }
.lightbox .cz-bar { top: calc(14px + env(safe-area-inset-top)); bottom: auto; left: 70px; right: 70px; }

/* анимации */
.page { animation: pageIn .28s ease-out both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }
.grid > .card, .grid > .ad-card { animation: cardIn .4s cubic-bezier(.2,.8,.3,1) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.skeleton { background: linear-gradient(100deg, var(--card) 30%, var(--card2) 50%, var(--card) 70%); background-size: 300% 100%;
  animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.hero .logo { position: relative; overflow: hidden; }
.hero .logo::before { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent, rgba(255,255,255,.55), transparent 40%);
  animation: spin 3.5s linear infinite; }
.hero .logo span { position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge.top { background: linear-gradient(110deg, #f5a524 35%, #ffe08a 50%, #f5a524 65%); background-size: 250% 100%; animation: glint 2.6s linear infinite; }
@keyframes glint { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.ai-note { display: flex; gap: 8px; align-items: center; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, #a08bff 15%, transparent));
  border-radius: 14px; padding: 10px 12px; margin-top: 10px; font-size: 14px; animation: pageIn .3s ease-out both; }
.ai-note .spark { animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(1.3) rotate(15deg); opacity: .7; } }
.ai-note a { font-weight: 650; cursor: pointer; }
.tab-create .ico { animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 4px 22px color-mix(in srgb, var(--accent) 65%, transparent); } }
.confetti { position: fixed; z-index: 100; top: 40%; left: 50%; width: 9px; height: 14px; border-radius: 2px; pointer-events: none;
  animation: confetti 1.3s cubic-bezier(.2,.7,.4,1) forwards; }
@keyframes confetti { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }
.float-heart { position: fixed; z-index: 100; pointer-events: none; font-size: 18px; animation: floatUp .9s ease-out forwards; }
@keyframes floatUp { to { transform: translate(var(--x), -70px) scale(1.4); opacity: 0; } }
.bubble { animation: bubbleIn .22s ease-out both; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px) scale(.98); } }

/* листаемые ряды на компьютере */
.chips, .tabs { cursor: grab; }
.chips.drag, .tabs.drag { cursor: grabbing; }

/* поддержка */
.ticket-status { font-size: 11px; }
.composer.closed { justify-content: center; color: var(--hint); font-size: 14px; padding: 16px; }
.bubble.staff { background: color-mix(in srgb, var(--ok) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); }
.bubble.system { align-self: center; background: transparent; box-shadow: none; color: var(--hint); font-size: 13px; }
.menu-item .count { margin-right: 4px; }
