/* =====================================================================
   ZUNO — дизайн-система
   Цвета бренда: #7C3AED (основной), #0B0B0F (тёмный), #FFFFFF, #94A3B8
   Тёмная тема подготовлена через переменные: [data-theme="dark"]
   ===================================================================== */
:root {
  --violet: #7C3AED;
  --violet-strong: #6D28D9;
  --violet-soft: #F1EBFE;
  --violet-line: #DCCDFB;
  --ink: #0B0B0F;
  --text: #1A1A22;
  --text-2: #565B69;
  --muted: #94A3B8;
  --bg: #F5F5F8;
  --surface: #FFFFFF;
  --surface-2: #F0F0F4;
  --line: #E6E6EC;
  --danger: #DC2626;
  --danger-soft: #FEECEC;
  --success: #16A34A;
  --success-soft: #E8F7EE;
  --warn: #B45309;
  --warn-soft: #FFF5E5;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(11, 11, 15, .06);
  --shadow-2: 0 8px 28px rgba(11, 11, 15, .10);
  --shadow-violet: 0 6px 18px rgba(124, 58, 237, .35);

  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;

  --nav-h: 64px;
  --top-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --wrap: 1180px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --violet-soft: #241A3D; --violet-line: #3B2A66;
  --ink: #FFFFFF; --text: #ECECF2; --text-2: #A9AEBC; --muted: #7C869A;
  --bg: #0B0B0F; --surface: #15151B; --surface-2: #1E1E26; --line: #2A2A34;
  --danger-soft: #3A1717; --success-soft: #11291A; --warn-soft: #33250F;
  --shadow-2: 0 8px 28px rgba(0,0,0,.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-md); line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--violet); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--ink); letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); font-weight: 700; }
h2 { font-size: var(--fs-xl); font-weight: 700; }
h3 { font-size: var(--fs-lg); font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Каркас ---------- */
#app { min-height: 100dvh; }
.page { max-width: var(--wrap); margin: 0 auto; padding: 12px 16px calc(var(--nav-h) + var(--safe-b) + 24px); }
.page.narrow { max-width: 720px; }
.page.flush { padding-left: 0; padding-right: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-xs); }
.hidden { display: none !important; }
svg.chev { width: 18px; height: 18px; color: var(--muted); flex: none; }
svg.ic { width: 22px; height: 22px; flex: none; }
.desk-only { display: none; }
@media (min-width: 900px) { .desk-only { display: block; } .mob-only { display: none !important; } }

/* ---------- Верхняя панель ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: var(--wrap); margin: 0 auto; height: var(--top-h); padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: var(--fs-lg); font-weight: 600; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-nav { display: none; gap: 4px; margin-left: auto; }
.desk-nav a { color: var(--text-2); padding: 8px 12px; border-radius: var(--r-pill); font-weight: 500; font-size: var(--fs-sm); position: relative; }
.desk-nav a.active, .desk-nav a:hover { color: var(--ink); background: var(--surface-2); }
.desk-nav .btn { margin-left: 8px; }
.desk-nav a.btn-primary, .desk-nav a.btn-primary:hover { color: #fff; background: var(--violet); }
.desk-nav a.btn-primary:hover { background: var(--violet-strong); }

.logo { display: inline-flex; align-items: center; height: 26px; color: var(--ink); flex: none; }
.logo svg { height: 100%; width: auto; }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-pill); border: 0; background: transparent;
  display: inline-grid; place-items: center; color: var(--ink); flex: none; position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.on-photo { background: rgba(255,255,255,.92); color: #0B0B0F; box-shadow: var(--shadow-1); }
.icon-btn svg { width: 22px; height: 22px; }

.city-btn { border: 0; background: transparent; display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 500; font-size: var(--fs-sm); padding: 6px 8px; border-radius: var(--r-pill); margin-left: auto; }
.city-btn svg { width: 16px; height: 16px; color: var(--violet); }
.city-btn:hover { background: var(--surface-2); }

/* ---------- Нижняя навигация (телефон) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.bottom-nav-inner { height: var(--nav-h); max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 500; position: relative; padding: 6px 0; }
.bottom-nav a svg { width: 24px; height: 24px; }
.bottom-nav a.active { color: var(--violet); }
.bottom-nav .add { justify-self: center; width: 48px; height: 48px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-violet); padding: 0; }
.bottom-nav .add svg { width: 26px; height: 26px; }
.badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: #EF4444; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; border: 2px solid var(--surface); }
.desk-nav .badge { top: 0; left: auto; right: -2px; }

@media (min-width: 900px) {
  .bottom-nav { display: none; }
  .desk-nav { display: flex; align-items: center; }
  .page { padding-bottom: 48px; }
  .city-btn { margin-left: 8px; }
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: var(--r-md); border: 1px solid transparent;
  font-weight: 600; font-size: var(--fs-md); white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
  text-decoration: none; user-select: none;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-strong); }
.btn-outline { background: var(--surface); color: var(--violet); border-color: var(--violet); }
.btn-outline:hover { background: var(--violet-soft); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover { background: var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 36px; padding: 0 14px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-block { width: 100%; }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.loading::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { border: 0; background: none; color: var(--violet); font-weight: 600; font-size: var(--fs-sm); padding: 4px 0; }

/* ---------- Поля форм ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.field .hint { font-size: var(--fs-xs); color: var(--text-2); }
.field .error { font-size: var(--fs-xs); color: var(--danger); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); font-size: var(--fs-md); transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--danger); }
.input-group { position: relative; display: flex; }
.input-group .input { padding-left: 44px; }
.input-group > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }

.check { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; cursor: pointer; }
.check + .check { border-top: 1px solid var(--line); }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: var(--r-pill); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .15s; }
.switch input:checked + span { background: var(--violet); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); padding: 4px; border-radius: var(--r-md); gap: 4px; }
.segmented button { border: 0; background: transparent; height: 40px; border-radius: 10px; font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--violet); box-shadow: var(--shadow-1); }

/* ---------- Поиск ---------- */
.search-bar { display: flex; gap: 8px; align-items: center; }
.search-bar .input-group { flex: 1; }
.search-bar .input { background: var(--surface); border-color: var(--line); height: 48px; }
.square-btn { width: 48px; height: 48px; flex: none; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink); position: relative; }
.square-btn svg { width: 22px; height: 22px; }
.square-btn .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); }

/* ---------- Категории ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(8, 1fr); } }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); font-size: 12px; font-weight: 500; text-align: center; line-height: 1.25; }
.cat-tile .ic { width: 56px; height: 56px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--violet); }
.cat-tile .ic svg { width: 26px; height: 26px; }
.cat-tile:hover .ic { border-color: var(--violet-line); background: var(--violet-soft); }

.list { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--text); width: 100%; border: 0; background: none; text-align: left; font-size: var(--fs-md); }
.list-item + .list-item { border-top: 1px solid var(--line); }
.list-item:hover { background: var(--surface-2); }
.list-item .ic { width: 24px; height: 24px; color: var(--violet); flex: none; }
.list-item .chev { width: 18px; height: 18px; color: var(--muted); flex: none; }
.list-item .count { color: var(--muted); font-size: var(--fs-sm); }
.list-item.danger { color: var(--danger); }
.list-item.danger .ic { color: var(--danger); }

/* ---------- Разделы ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 12px; }
.section-head h2 { font-size: var(--fs-lg); }
.section-head a { font-size: var(--fs-sm); font-weight: 600; }

/* ---------- Карточки объявлений ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.cards.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: 44%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.cards.row-scroll::-webkit-scrollbar { display: none; }
.cards.row-scroll > * { scroll-snap-align: start; }
@media (min-width: 640px) { .cards.row-scroll { grid-auto-columns: 30%; } }
@media (min-width: 900px) { .cards.row-scroll { grid-auto-columns: 18%; } }

.card { position: relative; background: var(--surface); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; color: var(--text); }
.card.highlight { border: 2px solid var(--violet); }
.card .ph { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.card .ph .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.card .ph .noimg svg { width: 36px; height: 36px; }
.card .fav { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; }
.card .fav svg { width: 19px; height: 19px; }
.card .fav.on { color: var(--violet); }
.card .tags { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 4px; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.card .title { font-size: var(--fs-sm); line-height: 1.35; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.card .price { font-weight: 700; font-size: var(--fs-md); color: var(--ink); }
.card .meta { display: flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--muted); min-width: 0; }
.card .meta svg { width: 13px; height: 13px; flex: none; }
.card .meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; background: var(--violet); color: #fff; }
.tag.soft { background: var(--violet-soft); color: var(--violet); }
.tag.gray { background: var(--surface-2); color: var(--text-2); }
.tag.green { background: var(--success-soft); color: var(--success); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.amber { background: var(--warn-soft); color: var(--warn); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-sm); font-weight: 500; color: var(--text); white-space: nowrap; }
.chip svg { width: 16px; height: 16px; }
.chip.active { border-color: var(--violet); color: var(--violet); background: var(--violet-soft); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }

/* скелетоны загрузки */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.card.sk .ph { background: none; }
.card.sk .ph .skeleton { position: absolute; inset: 0; border-radius: 0; }
.sk-line { height: 12px; margin: 4px 0; }

/* ---------- Пустые состояния и ошибки ---------- */
.empty { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic { width: 72px; height: 72px; border-radius: 22px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; margin-bottom: 6px; }
.empty .ic svg { width: 34px; height: 34px; }
.empty h3 { font-size: var(--fs-lg); }
.empty p { color: var(--text-2); max-width: 340px; font-size: var(--fs-sm); }
.empty .btn { margin-top: 8px; }

.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--violet-soft); color: var(--ink); font-size: var(--fs-sm); align-items: flex-start; }
.notice svg { width: 20px; height: 20px; flex: none; color: var(--violet); margin-top: 1px; }
.notice.warn { background: var(--warn-soft); }
.notice.warn svg { color: var(--warn); }
.notice.danger { background: var(--danger-soft); }
.notice.danger svg { color: var(--danger); }
.notice.success { background: var(--success-soft); }
.notice.success svg { color: var(--success); }

.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--ink); color: var(--surface); text-align: center; font-size: var(--fs-sm); padding: 6px 12px; }
:root[data-theme="dark"] .offline-bar { background: #fff; color: #0B0B0F; }

/* ---------- Панели, листы, тосты ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.panel h3 { margin-bottom: 12px; }

.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(11, 11, 15, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; border-radius: 22px 22px 0 0; padding: 8px 16px calc(16px + var(--safe-b)); animation: up .2s ease; }
.sheet.full { max-width: 720px; height: 92dvh; }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { border-radius: 22px; padding-bottom: 16px; }
}

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 120; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { background: var(--ink); color: var(--surface); padding: 12px 16px; border-radius: var(--r-md); font-size: var(--fs-sm); box-shadow: var(--shadow-2); animation: up .2s ease; pointer-events: auto; }
.toast.error { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .toast:not(.error) { background: #fff; color: #0B0B0F; }

/* ---------- Объявление ---------- */
.gallery { position: relative; background: #0B0B0F; margin: -12px -16px 0; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 3; max-height: 70vh; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.gallery .noimg { aspect-ratio: 4 / 3; display: grid; place-items: center; color: var(--muted); background: var(--surface-2); }
.gallery .noimg svg { width: 56px; height: 56px; }
.gallery-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.gallery-top > * { pointer-events: auto; }
.gallery-count { position: absolute; right: 12px; bottom: 12px; background: rgba(11, 11, 15, .65); color: #fff; font-size: var(--fs-xs); font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill); }
.thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none; }
.listing-layout { display: flex; flex-direction: column; gap: 16px; }
.thumbs button { flex: none; width: 64px; height: 52px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--surface-2); }
.thumbs button.active { border-color: var(--violet); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) {
  .listing-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .gallery { margin: 0; border-radius: var(--r-lg); overflow: hidden; }
  .listing-side { position: sticky; top: calc(var(--top-h) + 16px); }
}

.price-xl { font-size: var(--fs-2xl); font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.specs { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--text-2); font-size: var(--fs-sm); }
.specs > span { display: inline-flex; align-items: center; gap: 6px; }
.specs svg { width: 18px; height: 18px; color: var(--muted); }
.description { white-space: pre-wrap; word-wrap: break-word; color: var(--text); font-size: var(--fs-md); }

.seller { display: flex; align-items: center; gap: 12px; color: var(--text); }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; font-weight: 700; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 40px; height: 40px; font-size: var(--fs-sm); }
.avatar.lg { width: 84px; height: 84px; font-size: var(--fs-2xl); }

.action-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + var(--safe-b)); }
.action-bar-inner { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; }
.action-bar .btn { flex: 1; }
.has-action-bar { padding-bottom: calc(80px + var(--safe-b) + 16px) !important; }
@media (min-width: 900px) {
  .action-bar.inline-desk { position: static; border: 0; padding: 0; background: none; }
  .action-bar.inline-desk .action-bar-inner { max-width: none; }
  .has-action-bar.desk-inline { padding-bottom: 48px !important; }
}

.mini-actions { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.mini-actions button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--text-2); padding: 8px 0; }
.mini-actions svg { width: 22px; height: 22px; color: var(--ink); }
.mini-actions .on svg { color: var(--violet); }

/* ---------- Редактор ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(5, 1fr); } }
.photo-cell { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; }
.photo-cell .x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(11,11,15,.7); color: #fff; display: grid; place-items: center; }
.photo-cell .x svg { width: 16px; height: 16px; }
.photo-cell .cover { position: absolute; left: 6px; bottom: 6px; }
.photo-cell .mv { position: absolute; left: 6px; top: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: #0B0B0F; display: grid; place-items: center; }
.photo-cell .mv svg { width: 16px; height: 16px; }
.photo-add { aspect-ratio: 1; border-radius: var(--r-md); border: 1.5px dashed var(--violet-line); background: var(--violet-soft); color: var(--violet); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }
.photo-add svg { width: 26px; height: 26px; }
.ai-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--violet-line); background: var(--violet-soft); color: var(--violet); font-size: var(--fs-sm); font-weight: 600; }
.ai-btn svg { width: 16px; height: 16px; }
.ai-btn.loading { opacity: .6; pointer-events: none; }

/* ---------- Чат ---------- */
.chat-item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; color: var(--text); }
.chat-item + .chat-item { border-top: 1px solid var(--line); }
.chat-item .thumb { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: var(--surface-2); flex: none; position: relative; }
.chat-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.chat-item .name { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .last { color: var(--text-2); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .when { font-size: var(--fs-xs); color: var(--muted); flex: none; align-self: flex-start; margin-top: 2px; }
.chat-item .unread { width: 10px; height: 10px; border-radius: 50%; background: var(--violet); flex: none; }

.chat-page { display: flex; flex-direction: column; height: 100dvh; }
.chat-head-listing { display: flex; gap: 10px; align-items: center; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--text); }
.chat-head-listing .chev { width: 18px; height: 18px; color: var(--muted); flex: none; }
.chat-head-listing img, .chat-head-listing .noimg { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; max-width: 760px; width: 100%; margin: 0 auto; }
.msg { max-width: 80%; padding: 8px 12px 6px; border-radius: 18px; font-size: var(--fs-md); line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.msg .t { display: block; text-align: right; font-size: 11px; margin-top: 2px; opacity: .7; }
.msg.me { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.pending { opacity: .6; }
.day-sep { align-self: center; font-size: var(--fs-xs); color: var(--muted); padding: 8px 0; }
.composer { border-top: 1px solid var(--line); background: var(--surface); padding: 8px 12px calc(8px + var(--safe-b)); }
.composer-inner { max-width: 760px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: 10px 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--bg); line-height: 1.4; }
.composer textarea:focus { outline: none; border-color: var(--violet); }
.composer .send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--violet); color: #fff; display: grid; place-items: center; flex: none; }
.composer .send svg { width: 20px; height: 20px; }

/* ---------- Профиль ---------- */
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h1 { font-size: var(--fs-xl); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; text-align: center; }
.stat b { display: block; font-size: var(--fs-xl); color: var(--ink); }
.stat span { font-size: var(--fs-xs); color: var(--text-2); }

/* ---------- Мои объявления ---------- */
.my-item { display: flex; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.my-item .thumb { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: none; display: grid; place-items: center; color: var(--muted); }
.my-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.my-item .title { display: block; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-item .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Заставка / приветствие ---------- */
.welcome {
  min-height: 100dvh; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 24px calc(32px + var(--safe-b));
  background:
    radial-gradient(120% 70% at 85% 10%, rgba(124, 58, 237, .55), transparent 60%),
    radial-gradient(90% 60% at 0% 100%, rgba(124, 58, 237, .30), transparent 60%),
    #0B0B0F;
}
.welcome .mark { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.welcome .mark svg { width: min(64vw, 280px); height: auto; color: #fff; }
.welcome .slogan { letter-spacing: .32em; font-size: var(--fs-sm); color: rgba(255,255,255,.85); }
.welcome .points { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 420px; margin: 0 auto 32px; }
.welcome .points div { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); color: rgba(255,255,255,.8); }
.welcome .points svg { width: 22px; height: 22px; color: #A78BFA; flex: none; }
.welcome .points b { display: block; color: #fff; font-weight: 600; }
.welcome .acts { max-width: 420px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.welcome .btn-ghost-light { background: transparent; color: #C4B5FD; }

/* ---------- Вход ---------- */
.auth-wrap { max-width: 440px; margin: 0 auto; padding: 24px 16px 48px; }
.auth-wrap .logo { height: 32px; margin: 8px 0 24px; }

/* ---------- Админ ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin: 0 -16px 16px; padding: 0 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 12px 10px; font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--violet); border-bottom-color: var(--violet); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.kpi b { display: block; font-size: var(--fs-xl); color: var(--ink); }
.kpi span { font-size: var(--fs-xs); color: var(--text-2); }
.admin-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.admin-row .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.table-scroll { overflow-x: auto; }

.service-card { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); width: 100%; text-align: left; }
.service-card[aria-pressed="true"] { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.service-card .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; flex: none; }
.service-card .ic svg { width: 22px; height: 22px; }

.ai-chat .msg.them { background: var(--violet-soft); border-color: var(--violet-line); }
.load-more { display: flex; justify-content: center; padding: 16px 0; }
.map-box { position: relative; z-index: 0; isolation: isolate; height: 220px; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.map-box.tall { height: min(45dvh, 380px); }
.map-box .spinner { margin-top: 80px; }
.map-box .leaflet-control-attribution { font-size: 10px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--violet-soft); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; margin: 32px auto; }

/* ---------- Баннер «Скачать приложение» ---------- */
.app-banner { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 31; }
.app-banner-inner { max-width: var(--wrap); margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 6px; }
.app-banner .x { width: 32px; height: 32px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: 50%; flex: none; }
.app-banner .x:hover { background: var(--surface-2); }
.app-banner .x svg { width: 18px; height: 18px; }
.app-banner .app-ic { width: 40px; height: 40px; border-radius: 10px; background: #0B0B0F; display: grid; place-items: center; flex: none; color: #fff; }
.app-banner .app-ic svg { width: 26px; height: 26px; }
.app-banner .txt { flex: 1; min-width: 0; line-height: 1.25; }
.app-banner .txt b { display: block; font-size: var(--fs-sm); color: var(--ink); }
.app-banner .txt span { display: block; font-size: var(--fs-xs); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-banner .btn { height: 34px; padding: 0 16px; font-size: var(--fs-sm); border-radius: var(--r-pill); flex: none; }

/* ---------- VIP, продвижение, скидка ---------- */
.tag svg { width: 13px; height: 13px; flex: none; }
.tag.vip { background: #0B0B0F; color: #fff; }
.tag.vip svg { color: #C4B5FD; }
:root[data-theme="dark"] .tag.vip { box-shadow: inset 0 0 0 1px #3B2A66; }
.tag.promo { width: 22px; padding: 0; justify-content: center; }
.card.vip { border-color: var(--violet-line); }
.card.vip .body { background: var(--violet-soft); flex: 1; }
.price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; min-width: 0; }
.price-row .b { font-weight: 700; color: var(--ink); }
.old-price { color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }
.price-xl + .old-price { font-size: var(--fs-md); }
.disc { color: var(--danger); font-size: var(--fs-xs); font-weight: 700; }
.price-xl ~ .disc { font-size: var(--fs-sm); background: var(--danger-soft); padding: 1px 8px; border-radius: var(--r-pill); }
.one-line { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ---------- Мои объявления: статистика ---------- */
.my-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; width: 100%; margin-top: 8px; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); text-align: left; }
.my-stats b { color: var(--ink); }
.my-stats { position: relative; padding-right: 30px; }
.my-stats svg.chev { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; }
.owner-stats { width: 100%; border: 0; text-align: left; align-items: center; cursor: pointer; }
.stat-chart { display: flex; flex-direction: column; gap: 6px; }
.stat-chart .bars { height: 110px; display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; padding: 8px; background: var(--surface-2); border-radius: var(--r-md); }
.stat-chart .bar { height: 100%; display: flex; flex-direction: column-reverse; gap: 1px; }
.stat-chart .bar span { display: block; border-radius: 3px; min-height: 0; }
.stat-chart .imp, .stat-chart .dot.imp { background: var(--violet-line); }
.stat-chart .view, .stat-chart .dot.view { background: var(--violet); }
.stat-chart .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Кошелёк ---------- */
.wallet-card { background: linear-gradient(135deg, #0B0B0F 0%, #2A1659 60%, #7C3AED 130%); color: #fff; border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.wallet-card .spinner { margin: 40px auto; border-color: rgba(255,255,255,.2); border-top-color: #fff; }
.wallet-total { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.wallet-parts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0; }
.wallet-parts > div { background: rgba(255,255,255,.08); border-radius: var(--r-sm); padding: 8px 10px; display: flex; flex-direction: column; }
.wallet-parts span { font-size: var(--fs-xs); opacity: .8; display: inline-flex; align-items: center; gap: 2px; }
.wallet-parts svg { width: 13px; height: 13px; }
.h-sm { font-size: var(--fs-lg); }
.pkg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .pkg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pkg { position: relative; min-height: 84px; padding: 18px 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink); }
.pkg b { font-size: var(--fs-xl); }
.pkg[aria-pressed="true"] { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.pkg-flag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--violet); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.pkg-bonus { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--success); }
.pkg-bonus svg { width: 14px; height: 14px; }
b.plus { color: var(--success); }
b.minus { color: var(--ink); }
.wallet-strip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.wallet-strip .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; flex: none; }
.wallet-strip .ic svg { width: 22px; height: 22px; }
.wallet-strip b { font-size: var(--fs-lg); color: var(--ink); }

/* ---------- Продвижение ---------- */
.promo-listing { display: flex; align-items: center; gap: 12px; color: inherit; padding: 12px; }
.promo-listing .thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: none; display: grid; place-items: center; color: var(--muted); }
.promo-listing .thumb img { width: 100%; height: 100%; object-fit: cover; }
.budget-value b { font-size: var(--fs-xl); color: var(--violet); }
.budget-value span { color: var(--text-2); font-size: var(--fs-sm); }
.range { width: 100%; accent-color: var(--violet); height: 28px; margin: 0; }
.reach { display: flex; gap: 12px; align-items: flex-start; }
.reach .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; flex: none; }
.reach .ic svg { width: 22px; height: 22px; }
.service-card .ic.vip { background: #0B0B0F; color: #C4B5FD; }

/* ---------- Отзывы и рейтинг ---------- */
.rating { display: inline-flex; align-items: center; gap: 4px; }
.rating svg { width: 16px; height: 16px; color: #F59E0B; }
.stars { display: inline-flex; gap: 2px; color: #F59E0B; }
.stars svg { width: 16px; height: 16px; }
.review { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.star-picker { display: flex; gap: 6px; justify-content: center; }
.star-picker button { border: 0; background: none; padding: 4px; color: var(--muted); border-radius: 10px; }
.star-picker button.on { color: #F59E0B; }
.star-picker svg { width: 36px; height: 36px; }

/* ---------- Характеристики ---------- */
.attr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 380px) { .attr-grid { grid-template-columns: 1fr; } }
.attr-list { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 8px 12px; margin: 0; font-size: var(--fs-sm); }
.attr-list dt { color: var(--text-2); }
.attr-list dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.save-search { flex: none; }
.saved-item { align-items: center; }
.tiny svg, .small > span > svg { width: 14px; height: 14px; vertical-align: -2px; flex: none; }
.promo-listing .row span { display: inline-flex; align-items: center; gap: 4px; }
.my-item.col { flex-direction: column; gap: 10px; }
.my-top { display: flex; gap: 12px; min-width: 0; }
.my-item.col .my-stats, .my-item.col .acts { margin-top: 0; }
.my-item.col .acts .btn-primary { flex: 1 1 100%; }
@media (min-width: 520px) { .my-item.col .acts .btn-primary { flex: 0 0 auto; } }

/* ---------- Пригласить друга ---------- */
.referral-card .ic, .invite-strip .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--success-soft); color: var(--success); display: grid; place-items: center; flex: none; }
.referral-card .ic svg, .invite-strip .ic svg { width: 22px; height: 22px; }
.referral-card > .row:first-child { gap: 12px; }
.ref-link { font-size: var(--fs-sm); color: var(--violet); font-weight: 600; background: var(--violet-soft); border-color: var(--violet-line); text-overflow: ellipsis; }
.share-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.share-row .btn { width: 100%; }
.invite-strip { display: flex; align-items: center; gap: 12px; color: inherit; padding: 12px 14px; }
.invite-hero { background: linear-gradient(135deg, #0B0B0F 0%, #2A1659 60%, #7C3AED 130%); color: #fff; border-radius: var(--r-lg); padding: 22px 18px; display: flex; flex-direction: column; gap: 8px; }
.invite-hero h2 { color: #fff; font-size: var(--fs-xl); }
.invite-hero p { color: rgba(255,255,255,.82); font-size: var(--fs-sm); }
.invite-hero .gift-ic { width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,.12); display: grid; place-items: center; color: #C4B5FD; }
.invite-hero .gift-ic svg { width: 26px; height: 26px; }
.ref-code { display: inline-flex; align-items: center; gap: 6px; border: 1.5px dashed var(--violet-line); background: var(--violet-soft); color: var(--violet); font-weight: 700; letter-spacing: .12em; padding: 6px 10px; border-radius: var(--r-sm); font-size: var(--fs-md); flex: none; }
.ref-code svg { width: 16px; height: 16px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: var(--fs-sm); }
