/* ============================================================
   Учалы Объявления — Design System
   Токены → OKLCH, 8px ритм, один акцент
   ============================================================ */

/* ---------- Токены ---------- */
:root {
  /* Акцент (синий) */
  --accent:       oklch(55% 0.19 250);
  --accent-hi:    oklch(48% 0.22 250);
  --accent-soft:  oklch(96% 0.04 250);
  --accent-ring:  oklch(55% 0.19 250 / .22);

  /* Нейтральная шкала */
  --gray-0:  oklch(99%  0   0);
  --gray-1:  oklch(97%  .003 250);
  --gray-2:  oklch(94%  .005 250);
  --gray-3:  oklch(89%  .007 250);
  --gray-4:  oklch(80%  .009 250);
  --gray-5:  oklch(65%  .010 250);
  --gray-6:  oklch(50%  .010 250);
  --gray-7:  oklch(36%  .010 250);
  --gray-8:  oklch(22%  .010 250);
  --gray-9:  oklch(14%  .008 250);

  /* Семантика */
  --bg:          var(--gray-0);
  --surface:     var(--gray-0);
  --surface2:    var(--gray-1);
  --border:      var(--gray-3);
  --border-soft: var(--gray-2);
  --text:        var(--gray-9);
  --text-muted:  var(--gray-6);
  --text-faint:  var(--gray-5);

  /* Состояния */
  --danger:        oklch(52% 0.22 22);
  --danger-soft:   oklch(97% 0.02 22);
  --danger-border: oklch(88% 0.08 22);
  --success:       oklch(54% 0.17 145);
  --success-soft:  oklch(96% 0.03 145);

  /* Тени */
  --shadow-xs: 0 1px 3px oklch(14% .01 250 / .08);
  --shadow-sm: 0 2px 8px oklch(14% .01 250 / .09);
  --shadow-md: 0 6px 20px oklch(14% .01 250 / .11);
  --shadow-lg: 0 16px 48px oklch(14% .01 250 / .16);

  /* Радиусы */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-full: 9999px;
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box }
html, body { margin: 0; padding: 0 }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit }
input, select, textarea { font: inherit; color: inherit }
img { display: block; max-width: 100% }
h1 { font-size: 28px; font-weight: 700; margin: 0 0 16px; letter-spacing: -.3px }
h2 { font-size: 21px; font-weight: 700; margin: 0 0 12px }

/* ---------- Утилиты ---------- */
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 24px }
.wrap.narrow { max-width: 560px }
.muted  { color: var(--text-muted) }
.muted-link { color: var(--text-muted) }
.muted-link:hover { color: var(--text) }
.sm  { font-size: 13px }
.xs  { font-size: 12px }
.lg  { font-size: 19px }
.mt0{margin-top:0}.mt8{margin-top:8px}.mt12{margin-top:12px}.mt14{margin-top:14px}
.mt16{margin-top:16px}.mt20{margin-top:20px}.mt22{margin-top:22px}.mt26{margin-top:26px}
.mt28{margin-top:28px}.mt32{margin-top:32px}.mt34{margin-top:34px}.mt40{margin-top:40px}
.mb12{margin-bottom:12px}.mb20{margin-bottom:20px}.mb26{margin-bottom:26px}
.w100 { width: 100% }
.center { text-align: center }
.grow { flex: 1; min-width: 0 }
.pos-rel { position: relative }
.link { color: var(--accent) }
.link:hover { text-decoration: underline }
.pre { white-space: pre-line; max-width: 680px }
.hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden }

/* ---------- ШАПКА ---------- */
.hdr {
  position: sticky; top: 0; z-index: 60;
  background: oklch(99% 0 0 / .88);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 var(--border-soft), var(--shadow-xs);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.hdr-in {
  display: flex; align-items: center; gap: 12px; height: 68px;
}

/* Лого */
.logo {
  font-size: 20px; font-weight: 800; white-space: nowrap;
  letter-spacing: -.5px; color: var(--text); flex-shrink: 0;
}
.logo span { font-weight: 400; color: var(--text-muted) }

/* Город */
.city-btn {
  display: flex; align-items: center; gap: 5px;
  color: var(--accent); font-weight: 500; font-size: 13.5px;
  white-space: nowrap; padding: 6px 8px; border-radius: var(--r-md);
  flex-shrink: 0;
}
.city-btn:hover { background: var(--accent-soft) }
.caret { font-size: 10px; opacity: .7 }

/* Поиск */
.search {
  display: flex; flex: 1; min-width: 260px; height: 42px;
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring) }
.search .cat-sel {
  border: 0; border-right: 1.5px solid var(--border); padding: 0 10px;
  background: var(--surface2); outline: 0; max-width: 170px; cursor: pointer; font-size: 13.5px;
}
.search input { flex: 1; border: 0; outline: 0; padding: 0 12px; min-width: 60px; font-size: 14px }
.search .go {
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
  padding: 0 18px; border-radius: calc(var(--r-md) - 3px); margin: 3px;
  transition: background .15s;
}
.search .go:hover { background: var(--accent-hi) }

/* Навигация шапки — ОДНА строка */
.hdr-nav {
  display: flex; align-items: center; gap: 2px;
  font-size: 13.5px; flex-shrink: 0;
}
.hdr-nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 10px; border-radius: var(--r-md);
  white-space: nowrap; color: var(--text); font-weight: 500;
  transition: background .13s, color .13s;
}
.hdr-nav-link:hover { background: var(--surface2); color: var(--accent) }
.hdr-nav-icon { font-size: 15px; line-height: 1 }
.hdr-nav-user { gap: 7px }
.hdr-ava {
  width: 28px; height: 28px; border-radius: var(--r-full);
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.badge {
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: var(--r-full);
  padding: 1px 5px; line-height: 1.4;
}

/* CTA-кнопка */
.btn-post {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
  padding: 9px 16px; border-radius: var(--r-md); white-space: nowrap;
  transition: background .15s, transform .1s;
}
.btn-post:hover { background: var(--accent-hi); transform: translateY(-1px) }
.btn-post:active { transform: translateY(0) }
.btn-post-plus { font-size: 18px; font-weight: 400; line-height: 1 }

/* Бургер */
.burger { display: none; font-size: 21px; padding: 6px 8px; border-radius: var(--r-md) }
.burger:hover { background: var(--surface2) }

/* Моб. меню */
.mob-menu { border-top: 1px solid var(--border-soft); background: var(--surface); padding: 8px 0 12px }
.mob-menu a { display: block; padding: 11px 24px; font-size: 15px }
.mob-menu a:hover { background: var(--accent-soft); color: var(--accent) }

/* ---------- Dropdown ---------- */
.dd {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 70;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 6px; min-width: 200px; max-height: 320px; overflow: auto;
}
.dd a { display: block; padding: 9px 12px; border-radius: var(--r-sm); white-space: nowrap; font-size: 14px }
.dd a:hover { background: var(--accent-soft); color: var(--accent) }

/* ---------- Навигация категорий ---------- */
.catnav { border-bottom: 1px solid var(--border-soft); background: var(--surface) }
.catnav-in { display: flex; gap: 4px; overflow-x: auto; padding: 12px 0; scrollbar-width: none }
.catnav-in::-webkit-scrollbar { display: none }
.cat-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  border-radius: var(--r-lg); white-space: nowrap; font-size: 13.5px;
  transition: background .13s;
}
.cat-item:hover { background: var(--surface2) }
.ci {
  width: 38px; height: 38px; border-radius: var(--r-full);
  display: grid; place-items: center; font-size: 18px; flex: none;
}

/* ---------- Кнопки ---------- */
.btn-primary {
  display: inline-block; background: var(--accent); color: #fff;
  font-weight: 600; padding: 11px 20px; border-radius: var(--r-md);
  white-space: nowrap; text-align: center; transition: background .15s;
}
.btn-primary:hover { background: var(--accent-hi) }
.btn-lg { padding: 14px 28px; font-size: 16px }
.btn-ghost {
  display: inline-block; border: 1.5px solid var(--border); padding: 10px 18px;
  border-radius: var(--r-md); font-weight: 500; text-align: center;
  background: var(--surface); transition: border-color .13s, color .13s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent) }

/* ---------- Герой ---------- */
.hero {
  border-radius: var(--r-xl); overflow: hidden; margin: 20px 0; min-height: 280px;
  display: flex; align-items: center;
  background: linear-gradient(110deg, oklch(18% .06 250) 0%, oklch(24% .08 235) 35%, oklch(30% .10 170) 65%, oklch(40% .09 145) 100%);
}
.hero-in {
  display: flex; justify-content: space-between; width: 100%;
  gap: 24px; padding: 44px; align-items: center; flex-wrap: wrap;
}
.hero h1 { color: #fff; font-size: 36px; margin: 0 0 10px; letter-spacing: -.5px }
.hero p { color: oklch(88% .02 250); font-size: 16px; margin: 0 0 24px; max-width: 340px }
.hero-card { background: oklch(10% .01 250 / .72); border-radius: var(--r-lg); padding: 20px; max-width: 320px }
.hero-card h3 { color: #fff; margin: 0 0 8px; font-size: 16px }
.hero-card p { color: oklch(80% .02 250); font-size: 13.5px; margin: 0 0 14px }
.stores { display: flex; gap: 10px; flex-wrap: wrap }
.store {
  display: flex; align-items: center; gap: 9px; min-width: 138px;
  background: oklch(8% .005 250); border: 1px solid oklch(40% .01 250);
  border-radius: var(--r-sm); padding: 7px 10px; color: #fff;
  transition: background .15s, transform .15s;
}
.store:hover { background: oklch(16% .01 250); transform: translateY(-1px) }
.store svg { width: 24px; height: 28px; flex: none }
.store-apple { fill: #fff }
.store b { display: block; font-size: 15px; line-height: 1.1; letter-spacing: -.2px }
.store small { display: block; font-size: 9px; opacity: .85; letter-spacing: .1px }

/* ---------- Layout ---------- */
.cols { display: grid; grid-template-columns: 1fr 400px; gap: 26px; align-items: start }
.sec-title { font-size: 20px; font-weight: 700; margin: 8px 0 16px }
.card {
  border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  padding: 20px; background: var(--surface);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px }

/* ---------- Карточки товаров ---------- */
.grid5 { display: grid; grid-template-columns: repeat(5,1fr); gap: 16px }
.grid4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px }
.prod { position: relative }
.prod .ph {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  aspect-ratio: 1/.85; background: var(--surface2);
}
.prod .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s }
.prod:hover .ph img { transform: scale(1.04) }
.fav-form { position: absolute; top: 10px; right: 10px; z-index: 3 }
.fav {
  width: 32px; height: 32px; border-radius: var(--r-full);
  background: oklch(100% 0 0 / .9); display: grid; place-items: center;
  box-shadow: var(--shadow-xs); transition: transform .15s;
}
.fav:hover { transform: scale(1.1) }
.fav.on { color: var(--danger) }
.prod h4 { font-size: 14.5px; font-weight: 400; margin: 10px 0 4px }
.prod .price { font-size: 16px; font-weight: 700; margin-bottom: 6px }
.prod .meta { font-size: 12.5px; color: var(--text-muted) }
.showmore {
  display: block; width: 100%; border: 1.5px solid var(--border);
  border-radius: var(--r-md); padding: 13px; color: var(--accent);
  font-weight: 600; margin-top: 20px; text-align: center; background: var(--surface);
  transition: border-color .13s, background .13s;
}
.showmore:hover { background: var(--accent-soft); border-color: var(--accent) }

/* ---------- Услуги ---------- */
.srv { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-radius: var(--r-md) }
.srv:hover { background: var(--surface2) }
.srv .ci { width: 42px; height: 42px; font-size: 18px }
.srv b { display: block; font-size: 14.5px; font-weight: 600 }
.srv small { color: var(--text-muted); font-size: 13px }
.srv .arw { margin-left: auto; color: var(--text-faint) }

/* ---------- Лента объявлений ---------- */
.fresh { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); align-items: flex-start }
.fresh-link { display: flex; gap: 14px; flex: 1; min-width: 0 }
.fresh:hover h4 { color: var(--accent) }
.fresh img { width: 104px; height: 78px; object-fit: cover; border-radius: var(--r-sm); flex: none }
.fresh h4 { margin: 0 0 5px; font-size: 14.5px; font-weight: 500 }
.fresh .price { font-weight: 700; font-size: 15.5px; margin-bottom: 5px }
.fresh .meta { font-size: 12.5px; color: var(--text-muted) }
.fv { color: var(--text-faint); padding: 4px; font-size: 16px }
.fv.on { color: var(--danger) }

/* ---------- Популярные категории ---------- */
.popbox { background: var(--surface2); border: 1px solid var(--border-soft); border-radius: var(--r-xl); padding: 24px }
.pop-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px }
.cat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px }
.pop { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md); min-width: 0 }
.pop:hover { background: var(--surface); box-shadow: var(--shadow-xs) }
.pop > span:last-child { min-width: 0 }
.pop b { display: block; font-weight: 600; line-height: 1.2 }
.pop small { display: block; color: var(--text-muted); white-space: nowrap; margin-top: 2px; font-size: 12px }

/* ---------- Подвал ---------- */
.ftr {
  background: var(--surface2); border-top: 1px solid var(--border-soft);
  margin-top: 56px; padding: 44px 0 22px;
}
.ftr-grid { display: grid; grid-template-columns: repeat(4,1fr) 200px; gap: 24px }
.ftr h5 { font-size: 14px; font-weight: 700; margin: 0 0 14px; color: var(--text) }
.ftr a { display: block; color: var(--text-muted); font-size: 13.5px; padding: 4px 0 }
.ftr a:hover { color: var(--accent) }
.soc { display: flex; gap: 10px; margin-top: 8px }
.soc a {
  width: 40px; height: 40px; border-radius: var(--r-full);
  display: grid; place-items: center; color: #fff; padding: 0;
  box-shadow: var(--shadow-xs); transition: transform .15s, box-shadow .15s;
}
.soc a:hover { transform: translateY(-2px); box-shadow: var(--shadow-md) }
.soc svg { width: 22px; height: 22px; fill: currentColor }
.soc-vk  { background: oklch(52% .19 260) }
.soc-ok  { background: oklch(64% .17 55) }
.soc-tg  { background: oklch(58% .16 225) }
.ftr-bot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  border-top: 1px solid var(--border-soft); margin-top: 32px; padding-top: 18px;
  color: var(--text-muted); font-size: 13px;
}

/* ---------- Хлебные крошки ---------- */
.crumbs { max-width: 1360px; margin: 0 auto; padding: 16px 24px; color: var(--text-muted); font-size: 13px }
.crumbs a:hover { color: var(--accent) }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 20px }

/* ---------- Фильтры ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px }
.filters select, .filters input {
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  padding: 9px 12px; background: var(--surface); outline: 0; font-size: 14px;
}
.filters input[type=number] { width: 110px }
.filters select:focus, .filters input:focus { border-color: var(--accent) }

/* ---------- Чипсы / Пагинация ---------- */
.chip {
  display: inline-block; border: 1.5px solid var(--border); border-radius: var(--r-full);
  padding: 6px 15px; background: var(--surface); font-size: 13.5px; cursor: pointer;
  transition: border-color .13s, color .13s, background .13s;
}
.chip:hover { border-color: var(--accent); color: var(--accent) }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 24px }
.empty { text-align: center; padding: 64px 20px; color: var(--text-muted) }
.empty div:first-child { font-size: 48px; margin-bottom: 12px }
.article { max-width: 720px; font-size: 16px; color: var(--gray-7) }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 }

/* ---------- Страница объявления ---------- */
.ad-title { margin: 0 0 6px }
.item { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start }
.gal { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--surface2) }
.gal img { width: 100%; aspect-ratio: 4/3; object-fit: cover }
.gal-arrow {
  position: absolute; top: 50%; z-index: 2; width: 46px; height: 46px; margin-top: -23px;
  border-radius: var(--r-full); display: grid; place-items: center;
  background: oklch(14% .01 250 / .65); color: #fff; font-size: 36px; line-height: 1;
  box-shadow: var(--shadow-md); transition: background .15s;
}
.gal-arrow:hover { background: oklch(14% .01 250 / .82) }
.gal-prev { left: 16px } .gal-next { right: 16px }
.gal-count {
  position: absolute; right: 14px; bottom: 12px; z-index: 2;
  background: oklch(14% .01 250 / .68); color: #fff;
  border-radius: var(--r-full); padding: 4px 10px; font-size: 12.5px; font-weight: 600;
}
.thumbs {
  display: flex; gap: 8px; margin-top: 10px; flex-wrap: nowrap;
  overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin;
}
.thumbs a, .thumb-del {
  width: 80px; height: 60px; border-radius: var(--r-sm); overflow: hidden;
  border: 2px solid transparent; position: relative; display: block;
}
.thumbs a.on { border-color: var(--accent) }
.thumbs img, .thumb-del img { width: 100%; height: 100%; object-fit: cover }
.thumb-del form { margin: 0 }
.thumb-del button {
  position: absolute; top: 2px; right: 2px;
  background: oklch(14% .01 250 / .65); color: #fff;
  width: 20px; height: 20px; border-radius: var(--r-full);
  display: grid; place-items: center; font-size: 14px;
}
.saved-photo-list{display:flex;gap:10px;overflow-x:auto;padding:3px 2px 9px}.saved-photo{position:relative;flex:0 0 104px;height:82px;border:2px solid transparent;border-radius:10px;overflow:hidden;background:var(--surface2);cursor:grab;box-shadow:var(--shadow-xs)}.saved-photo:active{cursor:grabbing}.saved-photo:hover{border-color:var(--accent)}.saved-photo img{display:block;width:100%;height:100%;object-fit:cover}.saved-photo-number{position:absolute;left:6px;top:6px;display:grid;place-items:center;min-width:22px;height:22px;padding:0 5px;border-radius:999px;background:rgb(20 31 48 / 78%);color:#fff;font-size:12px;font-weight:700}.saved-photo-delete{position:absolute;right:5px;top:5px;width:22px;height:22px;border:0;border-radius:999px;background:rgb(20 31 48 / 78%);color:#fff;font-size:18px;line-height:20px;cursor:pointer}.saved-photo-delete:hover{background:#d33}.photo-save-state{display:block;min-height:18px;margin-top:4px;color:var(--text-muted);font-size:12px}.mb8{margin-bottom:8px}
.sidebox { border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: 22px; position: sticky; top: 88px }
.big-price { font-size: 30px; font-weight: 800; margin: 0 0 16px }
.stack { display: flex; flex-direction: column; gap: 10px }
.stack form { margin: 0 }
.phone-box {
  background: var(--accent-soft); border: 1.5px solid oklch(85% .06 250);
  border-radius: var(--r-md); padding: 13px; text-align: center;
  font-size: 21px; font-weight: 800; color: var(--accent);
}
.seller { display: flex; gap: 12px; align-items: center; margin: 18px 0; padding-top: 18px; border-top: 1px solid var(--border-soft) }
.ava {
  width: 46px; height: 46px; border-radius: var(--r-full);
  background: var(--accent-soft); display: grid; place-items: center;
  font-weight: 700; color: var(--accent); flex: none;
}
.ava.lg { width: 62px; height: 62px; font-size: 22px }
.spec { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; font-size: 14.5px; max-width: 680px }
.spec div:nth-child(odd) { color: var(--text-muted) }

/* ---------- Формы ---------- */
.form { max-width: 720px }
.card-form { border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: 28px; background: var(--surface) }
.field { margin-bottom: 18px }
.field label { display: block; font-weight: 600; margin-bottom: 7px; font-size: 14px }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-md);
  padding: 11px 14px; outline: 0; background: var(--surface);
  transition: border-color .13s, box-shadow .13s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.field small { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; display: block }
.field label.radio { font-weight: 400; display: flex; align-items: center; gap: 8px; margin-bottom: 8px }
.field label.radio input { width: auto }

/* Загрузка файлов */
.drop {
  display: block; border: 2px dashed var(--border); border-radius: var(--r-md);
  padding: 32px; text-align: center; color: var(--text-muted); cursor: pointer; font-weight: 400;
  transition: border-color .13s, background .13s;
}
.drop:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft) }
.photo-preview { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin }
.photo-preview[hidden] { display: none }
.photo-preview-item { position: relative; flex: 0 0 112px; margin: 0 }
.photo-preview-item img {
  width: 112px; height: 84px; object-fit: cover; border-radius: var(--r-md);
  border: 1px solid var(--border-soft); background: var(--surface2); box-shadow: var(--shadow-xs);
}
.photo-preview-item figcaption {
  margin-top: 4px; color: var(--text-muted); font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-preview-num {
  position: absolute; top: 5px; left: 5px; min-width: 22px; height: 22px;
  background: var(--accent); color: #fff; border-radius: var(--r-full);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}

/* ---------- Профиль ---------- */
.profile-card { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 24px }
.stats { display: flex; gap: 24px; margin-left: auto }
.stats > div { text-align: center }
.stats b { display: block; font-size: 20px; font-weight: 700 }
.stats small { font-size: 12px; color: var(--text-muted) }
.my-list { display: flex; flex-direction: column; gap: 1px }
.my-ad {
  display: flex; align-items: center; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}
.my-ad img { width: 96px; height: 72px; object-fit: cover; border-radius: var(--r-sm); flex: none }
.my-title { font-weight: 500; font-size: 15px; display: block; margin-bottom: 4px }
.my-title:hover { color: var(--accent) }
.my-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0 }

/* ---------- Алерты / тосты ---------- */
.alert { padding: 13px 16px; border-radius: var(--r-md); margin-bottom: 18px; font-size: 14.5px }
.alert.ok  { background: var(--success-soft); border: 1px solid oklch(78% .08 145); color: oklch(34% .14 145) }
.alert.err { background: var(--danger-soft);  border: 1px solid var(--danger-border); color: oklch(38% .18 22) }
.toast-box { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 10px }
.toast {
  background: var(--gray-9); color: #fff; padding: 13px 18px; border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); font-size: 14px; max-width: 320px;
  animation: slideup .25s ease; pointer-events: none;
}
.toast.err { background: var(--danger) }
@keyframes slideup { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* ---------- Статусы ---------- */
.status { font-size: 12.5px; font-weight: 500; padding: 2px 8px; border-radius: var(--r-full) }
.status.active     { background: var(--success-soft); color: oklch(40% .14 145) }
.status.moderation { background: oklch(97% .04 80); color: oklch(44% .14 70) }
.status.archived   { background: var(--surface2); color: var(--text-muted) }
.status.rejected   { background: var(--danger-soft); color: oklch(40% .18 22) }

/* ---------- Детали / danger zone ---------- */
details.card > summary { cursor: pointer; list-style: none; padding: 4px 0 }
details.card > summary::-webkit-details-marker { display: none }
details.card[open] > summary { margin-bottom: 16px }
.danger-zone { border-color: var(--danger-border) }
.btn-danger {
  display: inline-block; background: var(--danger); color: #fff;
  font-weight: 600; padding: 10px 20px; border-radius: var(--r-md);
  border: 0; cursor: pointer; font-size: 14.5px; transition: background .13s;
}
.btn-danger:hover { background: oklch(44% .22 22) }

/* ---------- Phone-wrap & Pass-wrap ---------- */
.phone-wrap {
  display: flex; align-items: stretch;
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; background: var(--surface);
  transition: border-color .13s, box-shadow .13s;
}
.phone-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring) }
.phone-prefix {
  padding: 0 12px; font-weight: 600; font-size: 15px;
  color: var(--text); border-right: 1.5px solid var(--border);
  background: var(--surface2); display: flex; align-items: center; flex-shrink: 0;
}
.phone-wrap input { border: none !important; box-shadow: none !important; border-radius: 0 !important; flex: 1; min-width: 0 }
.pass-wrap { position: relative; display: flex }
.pass-wrap input { flex: 1; padding-right: 46px !important }
.pass-toggle {
  position: absolute; right: 0; top: 0; height: 100%; width: 44px;
  background: none; border: none; cursor: pointer;
  display: grid; place-items: center; font-size: 17px; opacity: .45;
  transition: opacity .13s;
}
.pass-toggle:hover { opacity: .85 }

/* ---------- Галерея загрузки ---------- */
.upload-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px }
.upload-item {
  position: relative; width: 110px; height: 82px;
  border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border-soft);
}
.upload-item img { width: 100%; height: 100%; object-fit: cover }
.upload-del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: var(--r-full);
  background: oklch(14% .01 250 / .7); color: #fff;
  display: grid; place-items: center; font-size: 13px;
}

/* ---------- Сообщения ---------- */
.msg-list { display: flex; flex-direction: column; gap: 1px }
.msg-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border-soft) }
.msg-item:hover { background: var(--surface2); margin: 0 -12px; padding: 13px 12px; border-radius: var(--r-md) }
.msg-unread { font-weight: 600 }
.msg-bubble { display: flex; flex-direction: column; gap: 14px }
.msg-out { align-items: flex-end }
.msg-in  { align-items: flex-start }
.bubble {
  max-width: 68%; padding: 10px 14px; border-radius: var(--r-lg);
  font-size: 14.5px; line-height: 1.45;
}
.msg-out .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: var(--r-sm) }
.msg-in  .bubble { background: var(--surface2); border-bottom-left-radius: var(--r-sm) }
.bubble-time { font-size: 11.5px; opacity: .65; margin-top: 4px }

/* ---------- Магазины ---------- */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 18px }
.shop-card { border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 10px }
.shop-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm) }
.shop-logo { width: 56px; height: 56px; border-radius: var(--r-md); object-fit: cover; background: var(--surface2) }

/* ---------- Адмиика ---------- */
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px }
.adm-table th { text-align: left; padding: 10px 14px; border-bottom: 2px solid var(--border); font-size: 13px; color: var(--text-muted) }
.adm-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle }
.adm-table tr:hover td { background: var(--surface2) }

/* ---------- Вспомогательные блоки ---------- */
.sec-block { margin: 32px 0 }
.divider { border: 0; border-top: 1px solid var(--border-soft); margin: 24px 0 }
.tag { display: inline-block; background: var(--surface2); border-radius: var(--r-full); padding: 3px 10px; font-size: 12.5px; color: var(--text-muted) }
.tag:hover { background: var(--accent-soft); color: var(--accent) }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .grid5 { grid-template-columns: repeat(4,1fr) }
  .ftr-grid { grid-template-columns: repeat(3,1fr) }
}
@media (max-width: 1000px) {
  .cols { grid-template-columns: 1fr }
  .item { grid-template-columns: 1fr }
  .grid5 { grid-template-columns: repeat(3,1fr) }
  .grid4 { grid-template-columns: repeat(3,1fr) }
  .hdr-nav .hdr-nav-link:not(.hdr-nav-user):not([href="/favorites.php"]):not([href="/messages.php"]) { display: none }
}
@media (max-width: 768px) {
  .hdr-in { height: 60px; gap: 8px }
  .logo { font-size: 17px }
  .search { min-width: 0; flex: 1 }
  .search .cat-sel { display: none }
  .hdr-nav { display: none }
  .btn-post-text { display: none }
  .btn-post { padding: 9px 12px }
  .btn-post-plus { font-size: 22px }
  .burger { display: block }
  .grid5, .grid4 { grid-template-columns: repeat(2,1fr) }
  .hero-in { padding: 28px 20px }
  .hero h1 { font-size: 26px }
  .ftr-grid { grid-template-columns: repeat(2,1fr) }
  .cat-grid { grid-template-columns: repeat(2,1fr) }
  h1 { font-size: 23px }
}
@media (max-width: 480px) {
  .wrap { padding: 0 16px }
  .grid5, .grid4 { grid-template-columns: repeat(2,1fr); gap: 12px }
  .fresh img { width: 88px; height: 66px }
  .profile-card { flex-direction: column; align-items: flex-start }
  .stats { margin-left: 0 }
  .card-form { padding: 18px }
  .ftr-grid { grid-template-columns: 1fr 1fr }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important }
}


/* Saved photo order controls in the ad editor */
.saved-photo-list{display:flex;gap:10px;overflow-x:auto;padding:4px 2px 10px;align-items:flex-start}
.saved-photo{position:relative;flex:0 0 112px;height:92px;border:2px solid transparent;border-radius:10px;overflow:hidden;background:var(--surface2);cursor:grab;box-shadow:var(--shadow-xs)}
.saved-photo:active{cursor:grabbing}.saved-photo:hover{border-color:var(--accent)}
.saved-photo img{display:block;width:100%;height:100%;object-fit:cover}
.saved-photo-number{position:absolute;left:6px;top:6px;display:grid;place-items:center;min-width:24px;height:24px;padding:0 6px;border-radius:999px;background:rgb(20 31 48 / 84%);color:#fff;font-size:13px;font-weight:800;z-index:1}
.saved-photo-main{position:absolute;left:35px;top:7px;background:var(--accent);color:#fff;border-radius:999px;padding:3px 7px;font-size:10px;font-weight:700;z-index:1}
.saved-photo-actions{position:absolute;inset:auto 4px 4px;display:flex;justify-content:flex-end;gap:4px}
.saved-photo-actions button{width:26px;height:26px;border:0;border-radius:7px;background:rgb(20 31 48 / 84%);color:#fff;display:grid;place-items:center;font-size:16px;font-weight:700;line-height:1;cursor:pointer}
.saved-photo-actions .saved-photo-delete{font-size:20px;background:rgb(163 31 41 / 90%)}
.saved-photo-actions button:hover{filter:brightness(1.18)}
.photo-save-state{display:block;min-height:18px;margin-top:4px;color:var(--text-muted);font-size:12px}
@media(max-width:520px){.saved-photo{flex-basis:96px;height:84px}.saved-photo-actions button{width:28px;height:28px}}


/* Messenger: spacious conversation layout and comfortable composer */
.chat{display:grid;grid-template-columns:minmax(250px,310px) minmax(0,1fr);min-height:620px;border:1px solid var(--border-soft);border-radius:var(--r-xl);background:var(--surface);overflow:hidden;box-shadow:var(--shadow-sm)}
.chat-list{border-right:1px solid var(--border-soft);padding:12px;overflow:auto;background:var(--surface2)}
.chat-item{display:flex;align-items:center;gap:12px;padding:12px;border-radius:var(--r-lg);color:var(--text);text-decoration:none;transition:background .15s}
.chat-item:hover,.chat-item.on{background:var(--surface);box-shadow:var(--shadow-xs)}
.chat-avatar{overflow:hidden}.chat-avatar img,.profile-avatar img,.avatar-preview img,.hdr-ava img,.seller-avatar img{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}
.chat-body{display:flex;flex-direction:column;min-width:0;min-height:620px;background:var(--surface)}
.chat-head{display:flex;align-items:center;gap:12px;padding:16px 22px;border-bottom:1px solid var(--border-soft);font-size:16px;min-height:76px}
.chat-avatar-lg{width:42px;height:42px}
.msgs{flex:1;display:flex;flex-direction:column;gap:12px;padding:22px;overflow:auto;min-height:300px;max-height:60vh;background:linear-gradient(180deg,var(--surface),var(--surface2))}
.msg{max-width:min(78%,680px);align-self:flex-start;padding:12px 15px;border:1px solid var(--border-soft);border-radius:16px 16px 16px 5px;background:var(--surface);font-size:15px;line-height:1.55;overflow-wrap:anywhere;box-shadow:var(--shadow-xs)}
.msg.me{align-self:flex-end;background:var(--accent);border-color:var(--accent);color:#fff;border-radius:16px 16px 5px 16px}
.msg-time{font-size:11px;opacity:.68;margin-top:5px;text-align:right}
.chat-input{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:12px;padding:16px 18px;border-top:1px solid var(--border-soft);background:var(--surface)}
.chat-input textarea{display:block;width:100%;min-height:88px;max-height:200px;resize:vertical;padding:14px 16px;border:1.5px solid var(--border);border-radius:14px;background:var(--surface);font:inherit;font-size:15px;line-height:1.5;outline:0;transition:border-color .15s,box-shadow .15s}
.chat-input textarea:focus{border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-ring)}
.chat-send{display:flex;align-items:center;justify-content:center;gap:9px;min-height:50px;padding:0 22px;border-radius:13px}
.profile-avatar{width:86px!important;height:86px!important;overflow:hidden;padding:0!important}
.avatar-upload-card{margin:0 0 22px;padding:18px 20px;border:1px solid var(--border-soft);border-radius:var(--r-lg);background:var(--surface)}
.avatar-upload-preview{display:flex;align-items:center;gap:14px;margin-bottom:12px}
.avatar-preview{width:54px;height:54px;overflow:hidden}
.avatar-file{display:block;max-width:100%;margin:0 0 14px;font-size:13px}
.avatar-pick{cursor:pointer}
.seller-avatar{width:46px;height:46px;overflow:hidden}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:760px){.chat{grid-template-columns:1fr;min-height:0}.chat-list{display:flex;gap:6px;overflow-x:auto;border-right:0;border-bottom:1px solid var(--border-soft);padding:8px}.chat-item{flex:0 0 min(80vw,270px)}.chat-body{min-height:500px}.msgs{min-height:270px;max-height:55vh;padding:14px}.msg{max-width:88%}.chat-head{padding:12px 15px}.chat-input{grid-template-columns:1fr;padding:12px;gap:9px}.chat-input textarea{min-height:90px}.chat-send{width:100%}.profile-card{align-items:flex-start}.profile-avatar{width:70px!important;height:70px!important}}
