/* DOSALE — дизайн-система. Mobile-first, без внешних зависимостей. */
:root {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --text: #161B26;
  --muted: #687284;
  --faint: #9AA3B2;
  --line: #E2E6ED;
  --primary: #0B6CFF;
  --primary-dark: #0058DB;
  --primary-soft: #E8F1FF;
  --success: #12A150;
  --success-soft: #E6F6EC;
  --danger: #E0352B;
  --danger-soft: #FDECEA;
  --warn: #F5A000;
  --vip: #FFB020;
  --vip-soft: #FFF6DF;
  --hl: #FFF3C4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --header-h: 64px;
  --sticky-top: calc(var(--header-h) + 16px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
html, body { overflow-x: clip; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--text); background: var(--bg); }
body.has-tabbar { padding-bottom: 64px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 21px; font-weight: 750; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
.i { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px } .mt-4 { margin-top: 40px }
.mb-0 { margin-bottom: 0 } .mb-2 { margin-bottom: 16px }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--surface-2); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: #ECEFF3; color: var(--text); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #0E8742; color: #fff; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #FAD6D2; color: var(--danger); }
.btn-outline { background: var(--surface); border-color: var(--line); }
.btn-outline:hover { border-color: #C9D0DB; background: var(--surface); }
.btn-vip { background: var(--vip); color: #1d1400; }
.btn-vip:hover { background: #F2A200; color: #1d1400; }
.btn-lg { height: 52px; font-size: 17px; padding: 0 24px; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font-weight: 600; }

/* ---------- Шапка ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.topbar-in { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 22px; letter-spacing: .02em; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-mark { width: 34px; height: 34px; }
.logo em { font-style: normal; color: var(--primary); }
.logo b { font-weight: inherit; color: #F08C00; }
.logo-on-dark, .logo-on-dark:hover { color: #fff; }
.logo-on-dark b { color: #FFB020; }
.search { flex: 1; display: flex; align-items: center; min-width: 0; height: 44px; border: 2px solid var(--primary);
  border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; padding: 0 12px; background: transparent; }
.search button { height: 100%; border: 0; background: var(--primary); color: #fff; padding: 0 16px; cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.search button:hover { background: var(--primary-dark); }
.city-btn { display: none; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; color: var(--text); font-weight: 600; padding: 8px 6px; max-width: 200px; }
.city-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: none; align-items: center; gap: 4px; }
.top-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; font-size: 15px; }
.top-link:hover { background: var(--surface-2); color: var(--text); }
@media (min-width: 900px) {
  .city-btn, .top-actions { display: inline-flex; }
}

/* Кнопка и меню «Все категории» (как на Авито): слева разделы, справа подразделы выбранного */
.cat-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 14px; border: 0; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.cat-btn:hover { background: var(--primary-dark); }
.cat-btn .cat-btn-close, .cat-btn[aria-expanded="true"] .cat-btn-open { display: none; }
.cat-btn[aria-expanded="true"] .cat-btn-close { display: inline; }
@media (max-width: 899px) { .cat-btn { width: 44px; padding: 0; } .cat-btn span { display: none; } }
.catmenu { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); z-index: 45; }
.catmenu[hidden], .catmenu-backdrop[hidden] { display: none; }
.catmenu-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 35; }
.catmenu-in { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; padding-top: 16px; padding-bottom: 20px; max-height: calc(100vh - var(--header-h) - 24px); max-height: calc(100dvh - var(--header-h) - 24px); }
.catmenu-side { overflow-y: auto; }
.catmenu-city { display: none; }
.catmenu-roots { list-style: none; margin: 0; padding: 0; }
.catmenu-roots a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text); font-weight: 500; }
.catmenu-roots a span { flex: 1; min-width: 0; }
.catmenu-roots a .i:first-child { color: var(--primary); }
.catmenu-roots a .i:last-child { width: 16px; height: 16px; color: var(--faint); }
.catmenu-roots a:hover, .catmenu-roots a.on { background: var(--surface-2); color: var(--text); }
.catmenu-roots a.active span { font-weight: 700; }
.catmenu-pane { overflow-y: auto; min-height: 200px; }
.catmenu-title { display: inline-flex; align-items: center; gap: 4px; font-size: 22px; font-weight: 800; color: var(--text); margin: 4px 0 14px; }
.catmenu-title:hover { color: var(--primary); }
.catmenu-groups { columns: 3 200px; column-gap: 24px; }
.catmenu-group { break-inside: avoid; margin: 0 0 16px; }
.catmenu-group > a { display: block; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.catmenu-group ul { list-style: none; margin: 0; padding: 0; }
.catmenu-group li a { display: block; padding: 2px 0; font-size: 14px; color: var(--muted); }
.catmenu-group > a:hover, .catmenu-group li a:hover { color: var(--primary); }
.catmenu-group .more { color: var(--primary); }
.catmenu-back { display: none; }
.catmenu-loading { color: var(--muted); padding: 8px 0; }
/* Телефон: на весь экран под шапкой, разделы → подразделы с кнопкой «Назад» */
@media (max-width: 899px) {
  .catmenu { position: fixed; top: var(--header-h); bottom: 0; box-shadow: none; border-bottom: 0; overflow: hidden; z-index: 60; }
  .catmenu-in { display: block; height: 100%; max-height: none; padding-top: 8px; padding-bottom: 24px; overflow-y: auto; }
  .catmenu-city { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 8px; font-weight: 600; }
  .catmenu-pane { display: none; min-height: 0; overflow: visible; }
  .catmenu.drill .catmenu-side { display: none; }
  .catmenu.drill .catmenu-pane { display: block; }
  .catmenu-back { display: flex; align-items: center; gap: 6px; margin: 4px 0 4px; padding: 6px 0; border: 0; background: none; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; }
  .catmenu-groups { columns: 1; }
  .catmenu-group > a { padding: 6px 0; }
  .catmenu-group li a { padding: 6px 0; font-size: 15px; }
  body.catmenu-open { overflow: hidden; }
}

/* ---------- Нижняя панель (телефон) ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tabbar a.active { color: var(--primary); }
.tabbar .i { width: 24px; height: 24px; }
.tabbar .tab-add .i { width: 30px; height: 30px; padding: 4px; border-radius: 10px; background: var(--primary); color: #fff; margin-top: -2px; }
@media (min-width: 900px) { .tabbar { display: none; } body.has-tabbar { padding-bottom: 0; } }

/* ---------- Сообщения ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin: 16px 0 0; font-weight: 500; }
.flash-success { background: var(--success-soft); color: #0B6B35; }
.flash-error { background: var(--danger-soft); color: #A12118; }
.flash-info { background: var(--primary-soft); color: #0A4FB8; }
.notice { background: var(--vip-soft); border-radius: var(--radius-sm); padding: 12px 16px; }

/* ---------- Карточки и сетки ---------- */
.page { padding-top: 20px; padding-bottom: 40px; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 14px; }
.section-title h2 { margin: 0; }
.cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cat-tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 104px;
  padding: 14px; border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.cat-tile:hover { color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.cat-tile .i { width: 34px; height: 34px; color: var(--primary); }
.cat-tile b { font-size: 14.5px; line-height: 1.25; font-weight: 700; max-width: 100%; overflow-wrap: anywhere; hyphens: auto; }
@media (min-width: 640px) { .cats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cats { grid-template-columns: repeat(6, minmax(0, 1fr)); } .cat-tile { min-height: 120px; } .cat-tile b { font-size: 15.5px; } }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); color: var(--text); transition: box-shadow .15s; }
.card:hover { box-shadow: var(--shadow-lg); color: var(--text); }
.card.is-hl { background: var(--hl); }
.card.is-vip { outline: 2px solid var(--vip); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: #EEF1F5; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-dots { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; gap: 4px; justify-content: center; opacity: 0; transition: opacity .15s; }
.card:hover .card-dots { opacity: 1; }
.card-dots i { width: 18px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .55); }
.card-dots i.on { background: #fff; }
.card-hover { position: absolute; inset: 0; display: flex; }
.card-hover span { flex: 1; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-price { font-weight: 800; font-size: 17px; }
.card-title { font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--primary); }
.card:hover .card-title { color: var(--primary-dark); }
.card-meta { margin-top: auto; padding-top: 4px; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 1px; }
.fav-btn { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); z-index: 2; box-shadow: var(--shadow); }
.fav-btn:hover { color: var(--danger); }
.fav-btn.on { color: var(--danger); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.badge-vip { background: var(--vip); color: #1d1400; }
.badge-ok { background: var(--success-soft); color: #0B6B35; }
.badge-warn { background: var(--vip-soft); color: #8A5A00; }
.badge-danger { background: var(--danger-soft); color: #A12118; }
.badge-info { background: var(--primary-soft); color: #0A4FB8; }
.card-badges { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; z-index: 2; }

/* Вид «списком» */
.list .card { flex-direction: row; }
.list .card-media { width: 38%; max-width: 260px; aspect-ratio: 4 / 3; flex: none; }
.list.grid { grid-template-columns: 1fr; }
.list .card-title { font-size: 16.5px; -webkit-line-clamp: 2; }
.list .card-desc { display: block; }
.card-desc { display: none; font-size: 14px; color: var(--muted); line-height: 1.4; -webkit-line-clamp: 2; overflow: hidden; display: none; }
@media (min-width: 700px) { .list .card-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; } }
/* Карточка без фото: без заглушки — цена, заголовок и начало описания; сердечко в углу. */
.card.no-photo .card-body { padding: 14px 14px 12px; gap: 6px; }
.card.no-photo .card-price { padding-right: 40px; }
.card.no-photo .card-title { -webkit-line-clamp: 3; font-size: 17px; line-height: 1.3; font-weight: 700; }
.list .card.no-photo .card-title { font-size: 19px; }
.card.no-photo .card-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.card.no-photo .fav-btn { top: 6px; right: 6px; background: var(--surface-2); z-index: 2; }
.list .card.no-photo .card-desc { -webkit-line-clamp: 3; }

/* ---------- Каталог ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs span::before { content: "›"; margin-right: 6px; color: var(--faint); }
.catalog { display: grid; gap: 20px; }
@media (min-width: 1000px) { .catalog { grid-template-columns: 270px 1fr; align-items: start; } }
.filters { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.filters h3 { margin-bottom: 10px; }
.filter-group + .filter-group { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.filter-label { font-weight: 700; font-size: 14.5px; margin-bottom: 8px; display: block; }
.subcats { list-style: none; padding: 0; margin: 0; }
.subcats li a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; color: var(--text); font-size: 14.5px; }
.subcats li a:hover { color: var(--primary); }
.subcats .n { color: var(--faint); }
.price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters-toggle { display: inline-flex; }
@media (max-width: 999px) {
  .filters { position: fixed; inset: 0; z-index: 70; border-radius: 0; overflow-y: auto; transform: translateX(-105%); transition: transform .2s; padding-bottom: 90px; }
  .filters.open { transform: none; }
  .filters-close { display: flex; }
}
@media (min-width: 1000px) { .filters-toggle, .filters-close { display: none !important; } }
.filters-close { display: none; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar h1 { margin: 0; font-size: 24px; }
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.view-toggle a { display: flex; align-items: center; padding: 8px 10px; color: var(--muted); }
.view-toggle a.on { background: var(--primary-soft); color: var(--primary); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-bottom: 14px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }
.chip:hover { color: var(--primary); }
.empty { text-align: center; padding: 48px 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty .i { width: 48px; height: 48px; color: var(--faint); margin: 0 auto 12px; }
.pager { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 24px; }
.pager a, .pager span { min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px;
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.pager .cur { background: var(--primary); color: #fff; }
.pager .gap { background: none; box-shadow: none; }

/* ---------- Объявление ---------- */
.ad-layout { display: grid; gap: 20px; }
@media (min-width: 1000px) { .ad-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .ad-side { position: sticky; top: var(--sticky-top); } }
.add-photo-hint { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.add-photo-hint .i { flex: none; color: var(--primary); }
.gallery { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.gallery-main { position: relative; aspect-ratio: 4 / 3; background: #0F131A; display: flex; align-items: center; justify-content: center; cursor: zoom-in; }
.gallery-main { overflow: hidden; }
.gallery-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track .slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; }
.gallery-track img { width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; user-select: none; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9);
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.gallery-nav.prev { left: 10px; } .gallery-nav.next { right: 10px; }
.gallery-nav[hidden] { display: none; }
.gallery-main, .gallery-nav, .thumbs button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.gallery-count { position: absolute; right: 12px; bottom: 12px; background: rgba(0, 0, 0, .6); color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.thumbs { position: relative; display: flex; gap: 8px; padding: 10px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs button { flex: none; width: 78px; height: 58px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: #eee; }
.thumbs button.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.thumbs button:not(.on) img { opacity: .75; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.ad-head h1 { font-size: 24px; margin-bottom: 6px; }
.ad-price { font-size: 30px; font-weight: 850; letter-spacing: -.01em; margin: 4px 0 14px; }
.ad-price-side { margin-top: 0; }
.ad-price.is-empty { font-size: 22px; font-weight: 750; color: var(--muted); }
@media (min-width: 1000px) { .ad-price-main { display: none; } }
@media (max-width: 999px) { .ad-price-side { display: none; } }
.ad-section + .ad-section { margin-top: 26px; }
.ad-section h2 { font-size: 20px; margin: 0 0 10px; }
.ad-place { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.ad-place .i { flex: none; margin-top: 3px; color: var(--muted); }
.ad-tools { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.ask h3 { margin: 0 0 12px; }
.ask-form { position: relative; margin: 0; }
.ask-form .input { padding-right: 48px; background: var(--surface-2); }
.ask-send { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: none; color: var(--primary); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ask-send:hover { background: var(--primary-soft); }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ask-chips .chip { border: 0; font: inherit; font-size: 14px; cursor: pointer; background: var(--surface-2); box-shadow: none; }
.ask-chips .chip:hover { background: var(--primary-soft); color: var(--primary); }
.ad-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.ad-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ad-meta .i { width: 16px; height: 16px; }
.ad-body { white-space: pre-line; word-wrap: break-word; line-height: 1.6; }
.attrs { display: grid; grid-template-columns: 1fr; gap: 6px 24px; margin: 0; }
@media (min-width: 640px) { .attrs { grid-template-columns: 1fr 1fr; } }
.attrs div { display: flex; gap: 8px; font-size: 15px; }
.attrs dt { color: var(--muted); }
.attrs dd { margin: 0; font-weight: 600; }
.seller { display: flex; gap: 12px; align-items: center; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.side-actions { display: grid; gap: 10px; }
.ad-sticky { position: fixed; left: 0; right: 0; bottom: 64px; z-index: 45; background: var(--surface); border-top: 1px solid var(--line);
  padding: 10px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; box-shadow: 0 -6px 16px rgba(16, 24, 40, .08); }
@media (min-width: 1000px) { .ad-sticky { display: none; } }
body.has-sticky { padding-bottom: 136px; }
@media (min-width: 900px) { body.has-sticky { padding-bottom: 0; } }
.lightbox { position: fixed; inset: 0; background: rgba(5, 8, 12, .94); z-index: 100; display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox .gallery-track { position: absolute; inset: 0; }
.lightbox .gallery-track img { max-width: 96vw; max-height: 90vh; width: auto; height: auto; }
.lightbox .close-x, .lightbox .gallery-nav { z-index: 2; }
.lightbox .gallery-count { z-index: 2; left: 50%; right: auto; transform: translateX(-50%); bottom: 18px; }
.lightbox .close-x { position: absolute; top: 14px; right: 14px; color: #fff; background: none; border: 0; cursor: pointer; }
.lightbox .gallery-nav { background: rgba(255, 255, 255, .15); color: #fff; }
.lightbox .gallery-track { touch-action: pan-x pinch-zoom; }
.lightbox .close-x, .lightbox .gallery-nav, .lightbox .gallery-count { transition: opacity .15s; }
.lightbox.dragging .close-x, .lightbox.dragging .gallery-nav, .lightbox.dragging .gallery-count { opacity: 0; }

/* ---------- Формы ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span, .label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 4px; display: block; }
.input, .select, .textarea { width: 100%; height: 46px; padding: 0 14px; border: 1px solid #CDD3DD; border-radius: var(--radius-sm); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 150px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.has-error .input, .has-error .select, .has-error .textarea { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: 13.5px; margin-top: 4px; display: block; }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; padding: 4px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.radio-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pills label { cursor: pointer; }
.radio-pills input { position: absolute; opacity: 0; }
.radio-pills span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid #CDD3DD; font-size: 14.5px; }
.radio-pills input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.form-grid { display: grid; gap: 0 16px; }
@media (min-width: 700px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }

/* Подача */
.submit-layout { display: grid; gap: 20px; }
@media (min-width: 1000px) { .submit-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } .submit-aside { position: sticky; top: var(--sticky-top); } }
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps span.on { background: var(--primary); }
.step-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.step-title b { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.cat-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 700px) { .cat-picker { grid-template-columns: repeat(3, 1fr); } }
.cat-picker button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14.5px; }
.cat-picker button:hover { border-color: var(--primary); }
.cat-picker .i { color: var(--primary); width: 26px; height: 26px; }
.cat-path { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.cat-path button { background: var(--primary-soft); color: var(--primary); border: 0; border-radius: 999px; padding: 5px 12px; font-weight: 600; cursor: pointer; font-size: 14px; }
.cat-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 360px; overflow: auto; }
.cat-list li button { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 15px; }
.cat-list li:last-child button { border-bottom: 0; }
.cat-list li button:hover { background: var(--surface-2); }
.cat-selected { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--primary-soft); }
.photos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 700px) { .photos-grid { grid-template-columns: repeat(5, 1fr); } }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: #EEF1F5; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile .rm { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.photo-tile .rm .i { width: 16px; height: 16px; }
.photo-tile .cover { position: absolute; left: 4px; bottom: 4px; }
.photo-add { aspect-ratio: 1; border: 2px dashed #C4CCD8; border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600; text-align: center; background: var(--surface); }
.photo-add:hover { border-color: var(--primary); color: var(--primary); }
.photo-add input { display: none; }
.suggest { position: relative; }
.suggest-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 30; list-style: none; margin: 0; padding: 6px 0; max-height: 320px; overflow: auto; }
.suggest-list li { padding: 9px 14px; cursor: pointer; }
.suggest-list li:hover, .suggest-list li.on { background: var(--surface-2); }
.suggest-list small { color: var(--muted); }

/* ---------- Модальные окна ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: flex-end; justify-content: center; background: rgba(10, 14, 20, .5); }
.modal.open { display: flex; }
.modal-box { background: var(--surface); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 20px; }
@media (min-width: 700px) { .modal { align-items: center; } .modal-box { border-radius: 18px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 19px; }
.icon-x { background: none; border: 0; cursor: pointer; padding: 6px; color: var(--muted); }
.region-list { columns: 2; column-gap: 16px; list-style: none; margin: 10px 0 0; padding: 0; font-size: 14.5px; }
.region-list li { padding: 4px 0; break-inside: avoid; }
.region-pop { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

/* ---------- Кабинет ---------- */
.account { display: grid; gap: 20px; }
@media (min-width: 1000px) { .account { grid-template-columns: 240px 1fr; align-items: start; } }
.acc-nav { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; display: flex; gap: 4px; overflow-x: auto; }
@media (min-width: 1000px) { .acc-nav { flex-direction: column; } }
.acc-nav a, .acc-nav button { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; font-size: 15px; background: none; border: 0; cursor: pointer; text-align: left; }
.acc-nav a.active { background: var(--primary-soft); color: var(--primary); }
.acc-nav a:hover { background: var(--surface-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { flex: none; padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--text); border-bottom-color: var(--primary); }
.tabs .n { color: var(--faint); font-weight: 500; margin-left: 4px; }
.my-ad { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.my-ad:last-child { border-bottom: 0; }
.my-ad .thumb { width: 96px; height: 72px; border-radius: 10px; overflow: hidden; background: #EEF1F5; }
.my-ad .thumb img { width: 100%; height: 100%; object-fit: cover; }
.my-ad-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.my-ad-actions form { display: inline; }
@media (min-width: 700px) { .my-ad { grid-template-columns: 140px 1fr; } .my-ad .thumb { width: 140px; height: 105px; } }

/* ---------- Услуги ---------- */
.services { display: grid; gap: 12px; }
@media (min-width: 800px) { .services { grid-template-columns: repeat(3, 1fr); } }
.service { border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface); }
.service h3 { display: flex; align-items: center; gap: 8px; }
.service-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 8px; cursor: pointer; }
.service-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.service-opt input { accent-color: var(--primary); }

/* ---------- Таблицы (кабинет/админка) ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.table tr:hover td { background: #FAFBFC; }
.table input.input, .table select.select { height: 36px; }

/* ---------- Админка ---------- */
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-nav a { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); }
.admin-nav a.active { background: var(--primary); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stat b { display: block; font-size: 28px; font-weight: 800; }
.stat span { color: var(--muted); font-size: 14px; }
.mod-item { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
@media (min-width: 900px) { .mod-item { grid-template-columns: 220px 1fr 220px; } }
.mod-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.mod-photos img { aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.mod-text { white-space: pre-line; max-height: 220px; overflow: auto; font-size: 14.5px; background: var(--surface-2); padding: 10px; border-radius: 8px; }

/* ---------- Статьи и прочее ---------- */
.prose { max-width: 780px; line-height: 1.7; }
.prose img { height: auto; border-radius: 10px; margin: 12px 0; }
.prose h2 { margin-top: 1.4em; }
.hero { background: linear-gradient(120deg, #0B6CFF 0%, #3D8BFF 60%, #6AA7FF 100%); color: #fff; border-radius: var(--radius); padding: 22px 20px; display: grid; gap: 14px; margin-top: 16px; }
.hero h1 { font-size: 24px; margin: 0; }
.hero p { margin: 0; opacity: .92; }
.hero .btn { background: #fff; color: var(--primary); }
@media (min-width: 800px) { .hero { grid-template-columns: 1fr auto; align-items: center; padding: 26px 30px; } .hero h1 { font-size: 28px; } }
.company-card { display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; color: var(--text); }
.company-card:hover { color: var(--text); box-shadow: var(--shadow-lg); }
.company-card .avatar { border-radius: 12px; }
.company-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .company-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .company-grid { grid-template-columns: repeat(4, 1fr); } }

.footer { background: #121722; color: #AEB6C4; padding: 36px 0 28px; margin-top: 40px; font-size: 14.5px; }
.footer a { color: #DDE3EC; }
.footer a:hover { color: #fff; }
.footer-cols { display: grid; gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 899px) { .footer-cols > :first-child { grid-column: 1 / -1; } }
@media (min-width: 900px) { .footer-cols { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer h4 { color: #fff; margin: 0 0 10px; font-size: 15px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { padding: 3px 0; }
.footer-bottom { border-top: 1px solid #262D3B; margin-top: 24px; padding-top: 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: #161B26; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 120; box-shadow: var(--shadow-lg); font-weight: 500; max-width: 92vw; }
.error-page { text-align: center; padding: 60px 16px; }
.error-page .code { font-size: 72px; font-weight: 900; color: var(--primary); line-height: 1; }

/* Шапка на средних экранах: только иконки у ссылок */
/* Шапка в одну строку: у ссылок только иконки (подпись — в подсказке), кроме «Войти» */
.top-link:not(.top-link-text) { font-size: 0; gap: 0; padding: 10px; }
.top-link:not(.top-link-text) .i { width: 22px; height: 22px; }
.city-btn { max-width: 170px; }
@media (min-width: 900px) and (max-width: 1179px) {
  .cat-btn { width: 44px; padding: 0; }
  .cat-btn span, .hide-md { display: none; }
  .top-link-text { font-size: 0; gap: 0; padding: 10px; }
  .top-link-text .i { width: 22px; height: 22px; }
  .city-btn { max-width: 130px; }
}

/* Одноколоночные гриды не должны растягиваться по ширине содержимого (картинки, длинные слова) */
.ad-layout, .catalog, .account, .submit-layout { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
  .ad-layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .catalog { grid-template-columns: 270px minmax(0, 1fr); }
  .account { grid-template-columns: 240px minmax(0, 1fr); }
  .submit-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
h1, .card-title, .ad-body { overflow-wrap: anywhere; }

/* ---------- Счётчики, сообщения, поиски ---------- */
.center { text-align: center; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #E5352B; color: #fff; font-size: 12px; font-weight: 700; line-height: 1; margin-left: 4px; }
.top-link .count { margin-left: 2px; }
.acc-nav a .count { margin-left: auto; }
.tab-ico { position: relative; display: inline-flex; }
.tab-ico .count { position: absolute; top: -6px; right: -12px; min-width: 18px; height: 18px; font-size: 11px; margin: 0; }
@media (min-width: 900px) and (max-width: 1179px) { .top-link .count { font-size: 11px; } }

.threads { padding: 0; overflow: hidden; }
.thread-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; color: var(--text); border-bottom: 1px solid var(--line); }
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: var(--surface-2); color: var(--text); }
.thread-row .thumb { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: #EEF1F5; }
.thread-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.thread-main { display: grid; gap: 2px; min-width: 0; }
.thread-top { display: flex; gap: 8px; align-items: baseline; }
.thread-peer { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-time { margin-left: auto; flex: none; color: var(--faint); font-size: 13px; }
.thread-ad, .thread-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.thread-ad { color: var(--muted); }
.thread-row.unread .thread-last { font-weight: 700; }

.chat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 460px; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-head .thumb { flex: none; width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: #EEF1F5; }
.chat-head .thumb img { width: 100%; height: 100%; object-fit: cover; }
.chat-head-text { min-width: 0; flex: 1; }
.chat-head-text .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head form { margin: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); }
.chat-day { align-self: center; font-size: 12.5px; color: var(--muted); background: var(--surface); padding: 3px 10px; border-radius: 999px; margin: 8px 0 4px; }
.msg { max-width: min(78%, 560px); align-self: flex-start; background: var(--surface); border-radius: 16px 16px 16px 4px; padding: 8px 12px 6px; box-shadow: 0 1px 1px rgba(16,24,40,.06); }
.msg.mine { align-self: flex-end; background: var(--primary-soft); border-radius: 16px 16px 4px 16px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.45; }
.msg-meta { font-size: 11.5px; color: var(--faint); text-align: right; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form .textarea { flex: 1; min-height: 44px; height: 44px; max-height: 160px; resize: none; padding-top: 10px; }
.chat-form .btn { flex: none; width: 44px; padding: 0; }
.chat-safety { padding: 0 14px 12px; margin: 0; }
@media (max-width: 999px) {
  body:has(.chat) .acc-nav, body:has(.chat) .footer { display: none; }
  .chat { height: calc(100dvh - 190px); }
}
@media (min-width: 1000px) { .chat-back { display: none; } }

.search-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.search-row:last-child { border-bottom: 0; }
.search-main { min-width: 0; flex: 1 1 280px; }
.search-row .my-ad-actions { margin-top: 0; }
.save-search-form { margin: 0; }
.save-search.on { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
@media (max-width: 599px) { .save-search span { display: none; } .save-search { width: 40px; padding: 0; } }
.quick-replies { margin: 0 0 4px; }
.quick-replies .chip { cursor: pointer; border: 0; font: inherit; font-size: 14px; }

/* Шапка каталога на телефоне: название, под ним число объявлений, ниже — одна строка кнопок */
@media (max-width: 999px) {
  .toolbar { column-gap: 8px; row-gap: 10px; }
  .toolbar h1 { flex: 1 1 100%; font-size: 22px; }
  .toolbar .toolbar-count { flex: 1 1 100%; order: 1; margin-top: -8px; font-size: 14px; }
  .toolbar .spacer { display: none; }
  .toolbar .filters-toggle { order: 2; flex: 1 1 auto; }
  .toolbar .save-search-form, .toolbar > .save-search { order: 3; flex: none; }
  .toolbar .view-toggle { order: 4; flex: none; }
  .toolbar .view-toggle a { padding: 0 10px; height: 34px; }
}

/* ---------- Вход по коду из письма ---------- */
.code-email { color: var(--text); overflow-wrap: anywhere; }
.code-input { height: 60px; text-align: center; font-size: 30px; font-weight: 800; letter-spacing: .35em; padding-left: .35em; font-variant-numeric: tabular-nums; }
.code-input::placeholder { color: var(--faint); letter-spacing: .3em; }
.code-more { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.code-more form { margin: 0; }
.code-more .link-btn, .code-more a { font-size: 15px; white-space: nowrap; text-align: left; }

/* ---------- Оплата через СБП ---------- */
.sbp-head { display: flex; gap: 14px; align-items: center; }
.sbp-head h1 { margin: 0 0 2px; font-size: 22px; }
.sbp-logo { flex: none; width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px; letter-spacing: .02em; color: #fff; background: linear-gradient(135deg, #5B57A2, #1D9BE4 55%, #F6A21E); }
.sbp-amount { font-size: 34px; font-weight: 850; margin: 18px 0 16px; }
.sbp-qr { margin: 18px 0 6px; text-align: center; }
.sbp-qr-box { position: relative; width: 240px; height: 240px; margin: 0 auto 8px; }
.sbp-qr-box > img { display: block; width: 100%; height: 100%; border-radius: 14px; border: 1px solid var(--line); background: #fff; box-sizing: border-box; }
/* 36% ширины кода: полностью закрывает значок «QR» Точки, код при этом читается (проверено до 40%). */
.sbp-qr-logo { position: absolute; left: 50%; top: 50%; width: 36%; height: 36%; transform: translate(-50%, -50%);
  background: #fff; border-radius: 24%; padding: 3%; box-sizing: border-box; display: flex; }
.sbp-qr-logo img { width: 100%; height: 100%; display: block; }
.sbp-status { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 16px 0 6px; padding: 12px; border-radius: 12px; background: var(--surface-2); font-weight: 600; }
.sbp-status.is-paid { background: var(--success-soft); color: var(--success); }
.sbp-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--primary); animation: sbp-spin .9s linear infinite; }
.sbp-status.is-paid .sbp-spinner { display: none; }
@keyframes sbp-spin { to { transform: rotate(360deg); } }
/* На телефоне главное — кнопка банка; на компьютере — QR-код. */
@media (min-width: 700px) { .sbp-hint-mobile { display: none; } }
@media (max-width: 699px) { .sbp-qr-box { width: 200px; height: 200px; } }
.inline-form { display: inline-block; margin: 0; }
.table-middle td { vertical-align: middle; }
.order-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* Активация объявления: выбор срока размещения */
.activate-head { text-align: center; margin: 8px 0 16px; }
.activate-head h1 { margin: 8px 0 4px; }
.activate-ok { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.activate-ok .i { width: 28px; height: 28px; }
.activate-ad { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.activate-ad img { width: 96px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.activate-ad-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.activate-ad-text b { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.activate-h2 { font-size: 18px; margin: 0 0 12px; }
.plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .plans { grid-template-columns: repeat(4, 1fr); } }
.plan { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 8px 12px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.plan:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.plan-flag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 1px 8px; border-radius: 999px; background: var(--success); color: #fff; font-size: 11px; font-weight: 700; }
.plan-term { font-weight: 600; }
.plan-price { font-size: 22px; font-weight: 800; line-height: 1.2; }
.plan-sub { font-size: 12px; color: var(--muted); }
.plan-off { color: #0B6B35; font-weight: 700; }
.activate-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.activate-perks li { display: flex; gap: 10px; align-items: flex-start; }
.activate-perks .i { flex: none; color: var(--primary); margin-top: 3px; }
@media (max-width: 479px) { .hide-xs { display: none; } }
/* Узкий телефон: в шапке только знак логотипа — больше места поиску */
@media (max-width: 479px) { .topbar .logo span { display: none; } .topbar-in { gap: 8px; } }
