/* Объявления iji.by — mobile-first, Avito-like, not a trademark copy */
:root {
  --bg: #ffffff;
  --bg-soft: #f3f4f6;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --text: #141414;
  --muted: #6b6b6b;
  --primary: #6d28d9;
  --primary-dark: #5b21b6;
  --primary-soft: #f1eaff;
  --link: #6d28d9;
  --accent: #ff6a00;
  --danger: #dc2626;
  --border: #e7e7e7;
  --shadow: 0 1px 2px rgba(17,17,17,.04), 0 10px 28px rgba(17,17,17,.06);
  --header-bg: #ffffff;
  --search-bg: #f2f3f5;
  --search-focus: #ffffff;
  --chip: #f3f4f6;
  --chip-hover: #e8e9eb;
  --tile: #f3f4f6;
  --tabbar: #ffffff;
  --on-primary: #ffffff;
  --input-bg: #ffffff;
  --active-bg: #141414;
  --active-fg: #ffffff;
  --fav-bg: rgba(255,255,255,.92);
  --fav-fg: #222;
  --ok-bg: #ecfdf5;
  --ok-fg: #065f46;
  --err-bg: #fef2f2;
  --err-fg: #991b1b;
  --map-label: #3b176d;
  --radius: 16px;
  --radius-sm: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, Cantarell, sans-serif;
  --max: 1320px;
  --tab-h: 58px;
}
html[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f3f4f6;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --text: #141414;
  --muted: #6b6b6b;
  --primary: #6d28d9;
  --primary-dark: #5b21b6;
  --primary-soft: #f1eaff;
  --link: #6d28d9;
  --accent: #ff6a00;
  --danger: #dc2626;
  --border: #e7e7e7;
  --shadow: 0 1px 2px rgba(17,17,17,.04), 0 10px 28px rgba(17,17,17,.06);
  --header-bg: #ffffff;
  --search-bg: #f2f3f5;
  --search-focus: #ffffff;
  --chip: #f3f4f6;
  --chip-hover: #e8e9eb;
  --tile: #f3f4f6;
  --tabbar: #ffffff;
  --on-primary: #ffffff;
  --input-bg: #ffffff;
  --active-bg: #141414;
  --active-fg: #ffffff;
  --fav-bg: rgba(255,255,255,.92);
  --fav-fg: #222;
  --ok-bg: #ecfdf5;
  --ok-fg: #065f46;
  --err-bg: #fef2f2;
  --err-fg: #991b1b;
  --map-label: #3b176d;
  --radius: 16px;
  --radius-sm: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, Cantarell, sans-serif;
  --max: 1320px;
  --tab-h: 58px;
}
html[data-theme="dark"] {
  --bg: #0e0e10;
  --bg-soft: #1a1a1e;
  --bg-elev: #17171b;
  --card: #17171b;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --primary: #a78bfa;
  --primary-dark: #8b5cf6;
  --primary-soft: rgba(167,139,250,.18);
  --link: #c4b5fd;
  --accent: #ff6a00;
  --danger: #f87171;
  --border: #2c2c33;
  --shadow: 0 8px 24px rgba(0,0,0,.28);
  --header-bg: rgba(14,14,16,.94);
  --search-bg: #2a2a30;
  --search-focus: #34343c;
  --chip: #2a2a30;
  --chip-hover: #3a3a42;
  --tile: #2a2a30;
  --tabbar: rgba(14,14,16,.96);
  --on-primary: #ffffff;
  --input-bg: #1c1c22;
  --active-bg: #f4f4f5;
  --active-fg: #111111;
  --fav-bg: rgba(0,0,0,.45);
  --fav-fg: #ffffff;
  --ok-bg: #052e26;
  --ok-fg: #a7f3d0;
  --err-bg: #3f1212;
  --err-fg: #fecaca;
  --map-label: #f3e8ff;
  --radius: 16px;
  --radius-sm: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, Cantarell, sans-serif;
  --max: 1320px;
  --tab-h: 58px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
img { max-width: 100%; }
.wrap { width: min(var(--max), calc(100% - 24px)); margin: 0 auto; }
.main-content { padding: 12px 0 28px; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg);
  padding-top: var(--safe-t);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0 12px; flex-wrap: wrap;
}
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; color: var(--text);
  font-size: 1.05rem; letter-spacing: -.03em; text-decoration: none;
}
.logo:hover { text-decoration: none; color: var(--text); }
.logo-mark {
  width: 22px; height: 22px; border-radius: 7px;
  background:
    radial-gradient(circle at 30% 35%, #fff 0 22%, transparent 23%),
    linear-gradient(145deg, #8b5cf6, #6d28d9);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
  position: relative;
}
.logo-mark::after {
  content: "";
  position: absolute; right: -2px; bottom: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff6a00; border: 2px solid #fff;
}
.logo-domain { color: var(--muted); font-weight: 650; font-size: .82rem; }
.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.header-search {
  flex: 1 1 auto;
  display: flex; align-items: center; min-width: 0;
  background: var(--search-bg);
  border-radius: 16px;
  border: 1px solid transparent;
  min-height: 48px;
}
.header-search:focus-within {
  background: var(--search-focus);
  border-color: var(--border);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, .14);
}
.search-ico { display: flex; color: var(--muted); padding-left: 14px; }
.header-search input {
  flex: 1; border: 0; background: transparent;
  padding: 12px 10px; font-size: 16px; outline: none; color: var(--text);
  min-width: 0; font-family: inherit;
}
.search-filter {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; color: var(--muted); flex: none;
}
.search-filter:hover { color: var(--text); }
.desktop-only { display: none; }
.header-nav { display: none; gap: 4px; align-items: center; }
.header-nav a, .header-nav .nav-disabled {
  padding: 8px 10px; border-radius: 10px;
  color: var(--text); font-weight: 650; font-size: .95rem;
}
.header-nav a.is-active { background: var(--bg-soft); }
.header-nav a:hover { background: var(--bg-soft); text-decoration: none; }
.nav-disabled { color: #b0b0b0 !important; cursor: not-allowed; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  padding: 12px 18px; border-radius: 12px; font-weight: 700;
  cursor: pointer; font-size: 1rem; text-decoration: none; font-family: inherit;
}
.btn:hover { text-decoration: none; background: var(--bg-soft); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--on-primary); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-lg { width: 100%; padding: 16px; font-size: 1.05rem; border-radius: 14px; }

.hero { padding: 6px 0 2px; }
.hero h1 {
  margin: 0 0 4px;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 800; letter-spacing: -.03em; line-height: 1.2;
}
.hero-sub { margin: 0; color: var(--muted); }

.region-panel {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0; margin: 14px 0 8px;
  box-shadow: var(--shadow);
}
.region-panel > summary {
  list-style: none; cursor: pointer;
  padding: 14px 16px; font-weight: 750; min-height: 48px;
  display: flex; align-items: center; justify-content: space-between;
}
.region-panel > summary::-webkit-details-marker { display: none; }
.region-panel > summary::after { content: "▾"; color: var(--muted); font-weight: 500; }
.region-panel[open] > summary { border-bottom: 1px solid var(--border); }
.region-body { padding: 14px 16px 16px; }
.region-panel-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.region-panel-head h2 { margin: 0; font-size: 1.05rem; }
.region-search {
  width: 100%; padding: 12px 14px; font-size: 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-soft); font-family: inherit;
}
.region-search:focus { outline: none; border-color: var(--primary); background: var(--input-bg); }
.region-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.region-tab {
  padding: 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-soft); font-weight: 700; font-size: .98rem;
  cursor: pointer; font-family: inherit; color: var(--text); min-height: 46px;
}
.region-tab.active { background: var(--active-bg); color: var(--active-fg); border-color: var(--active-bg); }
.region-pane { display: none; }
.region-pane.active { display: block; }
.by-map-wrap { display: none; margin-bottom: 12px; }
.by-map { width: 100%; height: auto; max-height: 280px; }
.map-region path, .map-region circle { fill: var(--primary-soft); stroke: var(--primary-dark); stroke-width: 2; }
.map-region:hover path, .map-region:hover circle, .map-region:focus path { fill: #ddd6fe; }
.map-minsk circle { fill: var(--accent); stroke: #c2410c; }
.map-region text { fill: #3b176d; font-size: 13px; font-weight: 700; pointer-events: none; font-family: var(--font); }
.map-minsk .minsk-label { fill: #fff; font-size: 12px; }
.map-hint { margin: 0 0 10px; font-size: .92rem; }
.region-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.region-chip, .subcat-chip {
  display: inline-flex; align-items: center;
  padding: 10px 14px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid transparent;
  color: var(--text); font-weight: 650; font-size: .92rem; min-height: 40px;
}
.region-chip.active, .subcat-chip.active { background: var(--active-bg); color: var(--active-fg); }
.region-chip:hover, .subcat-chip:hover { text-decoration: none; background: var(--chip-hover); }
.region-chip.active:hover, .subcat-chip.active:hover { background: var(--active-bg); color: var(--active-fg); }
.district-block { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; background: var(--bg-elev); }
.district-block summary {
  padding: 12px 14px; font-weight: 700; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; min-height: 46px;
}
.district-block summary::-webkit-details-marker { display: none; }
.district-block[open] summary { border-bottom: 1px solid var(--border); background: var(--chip); }
.district-block .region-list { padding: 12px; }
.badge { background: var(--bg-soft); border-radius: 999px; padding: 2px 8px; font-size: .8rem; color: var(--muted); }
.active-region { margin: 12px 0 0; }
.link-clear { margin-left: 8px; font-weight: 700; }
.region-list li.hidden, .district-block.hidden { display: none; }

.section-title { margin: 18px 0 10px; font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }

.cat-scroll {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: 96px;
  gap: 12px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 32px 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  touch-action: pan-x;
  cursor: grab;
  margin: 0 -2px 6px;
}
.cat-scroll.is-dragging { cursor: grabbing; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text); text-align: center; text-decoration: none; min-width: 0;
}
.cat-chip:hover { text-decoration: none; }
.cat-ico {
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--tile);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.55rem; line-height: 1;
}
.cat-chip:hover .cat-ico { background: var(--primary-soft); }
.cat-name { font-size: .75rem; font-weight: 650; line-height: 1.2; letter-spacing: -.01em; }

.ad-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 10px;
}
.ad-card { position: relative; min-width: 0; }
.ad-card > a { color: inherit; display: block; text-decoration: none; }
.ad-card > a:hover { text-decoration: none; }
.ad-thumb {
  background: var(--bg-soft);
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-thumb.no-img { color: #b0b0b0; font-size: 1.6rem; }
.ad-thumb.large { aspect-ratio: 4 / 3; min-height: 180px; }
.ad-body { padding: 8px 2px 0; display: flex; flex-direction: column; gap: 2px; }
.ad-title {
  font-weight: 650; font-size: .92rem; line-height: 1.3; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ad-price { font-weight: 800; font-size: 1rem; letter-spacing: -.02em; color: var(--text); }
.ad-price.big { font-size: 1.7rem; margin-bottom: 6px; }
.ad-meta { color: var(--muted); font-size: .8rem; }
.fav-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--fav-bg); color: var(--fav-fg);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #222; padding: 0;
}
.fav-btn svg { fill: none; stroke: currentColor; stroke-width: 2; }
.fav-btn.is-on { color: #e11d48; }
.fav-btn.is-on svg { fill: currentColor; stroke: currentColor; }
.fav-inline { position: static; margin-left: 8px; box-shadow: none; border: 1px solid var(--border); }

.subcat-grid { display: grid; gap: 8px; margin: 8px 0 16px; }
.subcat-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-soft); color: var(--text);
  border-radius: 14px; padding: 14px 16px; min-height: 52px;
  font-weight: 700; text-decoration: none;
}
.subcat-card:hover { background: var(--chip-hover); text-decoration: none; }
.subcat-card .chev { color: #9a9a9a; font-weight: 500; }
.subcat-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.crumbs {
  color: var(--muted); font-size: .88rem; margin: 4px 0 10px;
  display: flex; flex-wrap: wrap; gap: 4px 0;
}
.crumbs a { font-weight: 650; color: var(--text); }
.crumbs .sep { margin: 0 6px; color: #c4c4c4; }

.main-content > h1, .ad-info h1 {
  margin: 0 0 12px; font-size: clamp(1.3rem, 4vw, 1.75rem);
  font-weight: 800; letter-spacing: -.03em; line-height: 1.25;
}
.ad-detail { display: grid; gap: 16px; }
.ad-gallery { display: grid; gap: 8px; }
.ad-gallery img { width: 100%; border-radius: 16px; max-height: 480px; object-fit: cover; background: var(--bg-soft); }
.ad-props { list-style: none; padding: 0; margin: 0 0 14px; }
.ad-props li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.ad-props span { color: var(--muted); }
.ad-desc { white-space: pre-wrap; line-height: 1.55; margin-bottom: 14px; }
.price-row { display: flex; align-items: center; }

.filters {
  display: grid; gap: 8px; margin: 8px 0 16px;
}
.filters input, .filters select, .post-form input, .post-form select, .post-form textarea {
  width: 100%; padding: 13px 14px; font-size: 16px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--input-bg); color: var(--text); font-family: inherit;
}
.filters input:focus, .filters select:focus, .post-form input:focus, .post-form select:focus, .post-form textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(109,40,217,.15);
}
.post-form { display: grid; gap: 14px; max-width: 720px; }
.post-form label { display: grid; gap: 6px; font-weight: 700; }
.category-picker { display: grid; gap: 8px; }
.field { display: grid; gap: 6px; }
.field-label { font-weight: 700; }
.category-tree {
  display: block; max-height: 420px; overflow-x: hidden; overflow-y: auto;
  padding: 8px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-soft);
}
.category-group {
  display: block; position: static; transform: none;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--bg-elev); margin: 0 0 6px;
}
.category-group > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; min-height: 40px; padding: 8px 12px; font-weight: 750;
  position: static; transform: none; line-height: 1.3; color: var(--text);
}
.category-group > summary::-webkit-details-marker { display: none; }
.category-group > summary::after { content: "▾"; color: var(--muted); font-weight: 500; }
.category-group:not([open]) > summary::after { content: "▸"; }
.category-options {
  display: flex; flex-direction: column; gap: 4px;
  position: static; transform: none; height: auto;
  padding: 0 8px 8px; overflow: visible;
}
.category-option {
  display: flex; align-items: center; position: static; transform: none;
  float: none; top: auto; left: auto; right: auto;
  width: 100%; height: 40px; min-height: 40px; max-height: 40px;
  margin: 0; padding: 0 12px; box-sizing: border-box;
  border: 0; border-radius: 8px;
  background: #3b2170; color: #f7f5ff; font: inherit; font-size: .92rem;
  font-weight: 650; line-height: 40px; text-align: left; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.category-option:hover { background: #4c2d8a; color: #fff; }
.category-option.is-selected { background: #ff6a00; color: #fff; }
.category-option[hidden], .category-group[hidden], .spec-panel[hidden] { display: none !important; }
.category-empty { margin: 4px; color: var(--muted); text-align: center; }
.category-selected { margin: 0; color: var(--muted); font-size: .86rem; font-weight: 650; }
.upload-progress {
  display: grid; gap: 6px; margin-top: 8px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft);
}
.upload-progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; color: var(--text); }
.upload-progress progress { width: 100%; height: 10px; accent-color: var(--primary); }
.upload-progress-status { margin: 0; color: var(--muted); font-size: .82rem; font-weight: 500; }
.form-row { display: grid; gap: 10px; }
.alert { padding: 14px 16px; border-radius: 12px; margin-bottom: 14px; }
.alert.ok { background: var(--ok-bg); color: var(--ok-fg); }
.alert.err { background: var(--err-bg); color: var(--err-fg); }
.empty { color: var(--muted); padding: 28px 0; text-align: center; }
.muted { color: var(--muted); }
.profile-card, .note-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin: 10px 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 16px; color: var(--muted); font-size: .88rem;
}
.site-footer a { color: var(--muted); font-weight: 650; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--tabbar);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 4px 2px calc(4px + var(--safe-b));
  min-height: calc(var(--tab-h) + var(--safe-b));
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10px; font-weight: 650; color: var(--muted);
  text-decoration: none; padding: 4px 0 2px; line-height: 1.15;
}
a.tab:hover { text-decoration: none; color: var(--text); }
.tab.is-active { color: var(--text); }
.tab-ico { width: 24px; height: 24px; display: flex; }
.tab-ico svg { width: 24px; height: 24px; }
.tab-post .tab-plus {
  width: 28px; height: 28px; border-radius: 10px;
  background: var(--primary); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
}
.tab-post.is-active .tab-plus { background: var(--primary-dark); }
.tab-disabled { opacity: .38; cursor: not-allowed; }

.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-list { display: grid; gap: 10px; }
.admin-item {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px; display: grid; gap: 10px;
  box-shadow: var(--shadow);
}
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (min-width: 640px) {
  .wrap { width: min(var(--max), calc(100% - 40px)); }
  
  .by-map-wrap { display: block; }
  .form-row { grid-template-columns: 1.2fr .8fr .8fr; }
  .filters { grid-template-columns: 1.3fr 1fr .7fr .7fr 1fr auto; align-items: center; }
  .subcat-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .desktop-only { display: inline-flex; }
  .header-nav.desktop-only { display: flex; }
  .tabbar { display: none; }
  body { padding-bottom: 0; }
  .header-inner { flex-wrap: nowrap; padding: 14px 0; gap: 16px; }
  .header-search { flex: 1 1 auto; order: 0; }
  .logo { font-size: 1.15rem; }
  .cat-scroll {
    display: flex;
    flex-wrap: nowrap;
    justify-content: safe center;
    overflow-x: auto;
    overflow-y: hidden;
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-template-columns: none;
    grid-auto-columns: auto;
    gap: 16px 12px;
    padding: 4px 32px 12px;
  }
  .ad-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; }
  .ad-detail { grid-template-columns: 1.2fr .9fr; align-items: start; gap: 28px; }
  .region-panel-head { flex-direction: row; align-items: center; justify-content: space-between; }
  .region-search { max-width: 320px; }
  .site-footer { padding-bottom: 28px; }
}
@media (min-width: 1200px) {
  .ad-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 8px; }
  .cat-scroll { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (min-width: 1400px) {
  :root { --max: 1400px; }
}

.hidden { display: none !important; }
.logo-word { font-weight: 800; letter-spacing: -.07em; font-size: 1.55rem; line-height: 1; color: var(--text); }
.logo-accent { color: var(--primary); }
.logo-mark, .logo-domain { display: none; }
.cat-ico img { width: 68%; height: 68%; object-fit: contain; display: block; }
.header-region {
  display: inline-flex; align-items: center; gap: 6px; max-width: 46vw;
  color: var(--text); font-weight: 700; font-size: .92rem;
  padding: 8px 10px; border-radius: 12px;
}
.header-region span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-region:hover { text-decoration: none; background: var(--chip); }
.search-submit {
  display: none; border: 0; background: var(--primary); color: var(--on-primary); font-weight: 750;
  border-radius: 12px; padding: 0 18px; height: 40px; margin-right: 4px; cursor: pointer; font-family: inherit;
}
.all-cats { position: relative; }
.all-cats-btn {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 750; color: var(--text); background: transparent; border: 0; padding: 8px 10px; border-radius: 12px;
}
.all-cats-btn::-webkit-details-marker { display: none; }
.all-cats-menu {
  position: absolute; z-index: 50; top: calc(100% + 8px); left: 0; min-width: 280px;
  background: var(--bg-elev); color: var(--text); border: 1px solid var(--border);
  border-radius: 16px; padding: 8px; box-shadow: var(--shadow); max-height: 70vh; overflow: auto;
}
.all-cats-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); font-weight: 650; }
.all-cats-menu a:hover { background: var(--chip); text-decoration: none; }
.all-cats-menu img { width: 28px; height: 28px; }
.fd-grid, .by-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.fd-card, .by-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 18px;
  padding: 14px 14px 8px; box-shadow: var(--shadow); min-width: 0;
}
.fd-card h3, .by-card h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.fd-card h3 .badge, .by-card h3 .badge { margin-left: auto; }
.fd-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.subject { border-top: 1px solid var(--border); }
.subject summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 9px 2px; font-weight: 680;
}
.subject summary::-webkit-details-marker { display: none; }
.city-pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 10px; }
.city-pill {
  display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px;
  background: var(--chip); color: var(--text); font-size: .8rem; font-weight: 650;
}
.city-pill:hover { background: var(--chip-hover); text-decoration: none; }
.city-pill.active { background: var(--active-bg); color: var(--active-fg); }
.subcat-card.active { outline: 2px solid var(--primary); }
.ad-photo-main { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 18px; background: var(--bg-soft); display: block; }
.ad-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.ad-thumb-btn { border: 0; padding: 0; border-radius: 10px; overflow: hidden; width: 72px; height: 72px; flex: none; cursor: pointer; background: var(--chip); }
.ad-thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.footer-links a { margin: 0 4px; }
.map-region text { fill: var(--map-label); }
@media (max-width: 959px) {
  .ad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .header-region { margin-left: auto; }
  .header-tools { flex: 1 0 100%; order: 8; flex-wrap: nowrap; }
  .header-search { flex: 1 1 auto; min-width: 0; }
  .by-grid { grid-template-columns: 1fr; }
}
@media (min-width: 720px) {
  .fd-grid, .by-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  :root { --max: 100%; }
  .desktop-only { display: flex; }
  details.all-cats.desktop-only { display: block; }
  .mobile-only { display: none !important; }
  .search-submit { display: inline-flex; align-items: center; }
  .tabbar { display: none; }
  body { padding-bottom: 0; }
  .hero { display: none; }
  .main-content { display: flex; flex-direction: column; }
  .cats-section { order: 1; }
  .region-panel { order: 2; background: transparent; border: 0; box-shadow: none; margin-top: 4px; }
  .region-panel > summary { display: none; }
  .region-body { padding: 0; }
  .ads-section { order: 3; }
  .wrap { width: calc(100% - 40px); max-width: none; }
  .header-inner { flex-wrap: nowrap; align-items: center; gap: 12px; }
  .header-search { flex: 1 1 auto; min-height: 52px; border-radius: 14px; }
  .header-search input { padding-left: 16px; }
  .header-region { max-width: 180px; flex: none; margin-left: 0; }
  .header-post { flex: none; white-space: nowrap; }
  .cat-scroll {
    display: flex; flex-wrap: nowrap; justify-content: safe center;
    overflow-x: auto; overflow-y: hidden;
    grid-template-rows: none; gap: 8px; padding: 4px 32px 12px;
  }
  .cat-chip { flex: 0 0 96px; min-width: 96px; }
  .cat-ico { width: 68px; height: 68px; border-radius: 22px; background: var(--tile); }
  .ad-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 8px; }
  .ad-detail { grid-template-columns: minmax(0, 1.25fr) minmax(300px, .85fr); gap: 28px; align-items: start; }
  .ad-info { position: sticky; top: 88px; }
  .ad-photo-main { max-height: 72vh; aspect-ratio: 4/3; }
  .fd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .by-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .region-search { max-width: none; }
}
@media (min-width: 1500px) {
  .fd-grid, .by-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wrap { width: calc(100% - 56px); }
}
@media (min-width: 1600px) and (min-aspect-ratio: 16/9) {
  .ad-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (min-width: 1900px) and (min-aspect-ratio: 16/9) {
  .ad-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (min-width: 1400px) and (min-aspect-ratio: 21/9) {
  .ad-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (min-width: 2200px) and (min-aspect-ratio: 2.2/1) {
  .ad-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .fd-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
/* Region browser: swipeable cards instead of a long district list. */
.region-scroll-hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}
.region-strip,
.fd-grid.region-strip,
.by-grid.region-strip {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 14px;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.by-grid.region-strip > .by-card {
  flex: 0 0 clamp(250px, 78vw, 350px);
  scroll-snap-align: start;
}
.fd-grid.region-strip > .fd-card {
  flex: 0 0 clamp(300px, 86vw, 500px);
  scroll-snap-align: start;
}
.fd-card,
.by-card { align-self: flex-start; height: fit-content; }
.fd-card > h3,
.by-card > h3 { min-height: 28px; }
.subjects {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.subjects > .subject {
  flex: 0 0 clamp(220px, 72vw, 280px);
  min-width: 0;
  align-self: flex-start;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  overflow: hidden;
  scroll-snap-align: start;
}
.subjects > .subject summary {
  min-height: 48px;
  padding: 10px 12px;
  border: 0;
  line-height: 1.25;
}
.subjects > .subject summary span:first-child { min-width: 0; }
.subjects > .subject[open] { background: var(--bg-elev); }
.subjects > .subject .city-pills {
  padding: 0 10px 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
@media (min-width: 960px) {
  .by-grid.region-strip > .by-card { flex-basis: 320px; }
  .fd-grid.region-strip > .fd-card { flex-basis: 440px; }
  .subjects > .subject { flex-basis: 255px; }
}
/* Compact region cards on phones; desktop keeps the readable card sizing above. */
@media (max-width: 959px) {
  .region-strip { gap: 8px; padding: 2px 0 10px; }
  .by-grid.region-strip > .by-card { flex-basis: clamp(210px, 70vw, 270px); }
  .fd-grid.region-strip > .fd-card { flex-basis: clamp(250px, 82vw, 320px); }
  .fd-card,
  .by-card { padding: 8px 9px 5px; border-radius: 12px; }
  .fd-card > h3,
  .by-card > h3 {
    min-height: 22px; margin-bottom: 5px; gap: 5px;
    font-size: .86rem; line-height: 1.15;
  }
  .fd-card > h3 .badge,
  .by-card > h3 .badge { padding: 2px 6px; font-size: .68rem; }
  .city-pills { gap: 4px; padding-bottom: 6px; }
  .city-pill {
    padding: 3px 7px; font-size: .7rem; line-height: 1.15; font-weight: 600;
  }
  .subjects { gap: 6px; padding-bottom: 2px; }
  .subjects > .subject { flex-basis: 200px; border-radius: 10px; }
  .subjects > .subject summary {
    min-height: 38px; padding: 7px 9px; font-size: .8rem; line-height: 1.2;
  }
  .subjects > .subject .city-pills { padding: 7px 8px 8px; }
}

/* Listing detail: keep the gallery compact and give the information column priority. */
.ad-gallery,
.ad-info { min-width: 0; }
.ad-photo-main {
  max-height: 52vh;
  object-fit: contain;
}
@media (min-width: 960px) {
  .ad-detail {
    grid-template-columns: minmax(280px, .82fr) minmax(420px, 1.18fr);
    gap: 28px;
  }
  .ad-photo-main { max-height: 54vh; }
}

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
.cat-ico { color: var(--primary); }
.cat-ico svg, .all-cats-menu svg.cat-svg { width: 62%; height: 62%; }
.all-cats-menu a { color: var(--text); }
.all-cats-menu svg.cat-svg { width: 22px; height: 22px; color: var(--primary); flex: none; }
.header-post {
  display: inline-flex;
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 48px;
  padding: 0 12px;
  font-size: .82rem;
  line-height: 1.1;
}
.header-post-short { display: none; }
.theme-toggle {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.theme-toggle svg { display: block; }
html[data-theme="light"] .theme-ico-sun { display: none; }
html[data-theme="dark"] .theme-ico-moon { display: none; }
@media (max-width: 390px) {
  .header-post { font-size: .72rem; padding: 0 8px; min-height: 44px; }
  .header-search { min-height: 44px; }
}
@media (min-width: 960px) {
  .header-post { font-size: .95rem; padding: 0 16px; min-height: 48px; }
  .header-tools { flex: 1 1 auto; order: 0; }
}
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.admin-nav a {
  display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px;
  background: var(--chip); color: var(--text); font-weight: 700;
}
.admin-nav a.active, .admin-nav a:hover { background: var(--primary); color: var(--on-primary); text-decoration: none; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.stat-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.stat-card b { display: block; font-size: 1.4rem; }
.checkline { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.checkline input { width: auto; }
.admin-item p { margin: 6px 0 0; }
.status-pill { display: inline-flex; padding: 2px 8px; border-radius: 999px; background: var(--chip); font-size: .78rem; font-weight: 700; }

.post-form label.checkline { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.post-form label.checkline input { width: auto; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }


/* Rostelecom-inspired brand finish and compact mobile header. */
.header-post { background: var(--accent); border-color: var(--accent); color: #fff; }
.header-post:hover { background: #ea3d08; border-color: #ea3d08; color: #fff; }
.tab-post .tab-plus { background: var(--accent); color: #fff; }
.tab-post.is-active .tab-plus { background: #ea3d08; }
.search-ico { border: 0; background: transparent; font: inherit; cursor: pointer; }

@media (max-width: 959px) {
  .header-inner { flex-wrap: nowrap; gap: 6px; padding: 8px 0; }
  .logo { order: 1; flex: 1 1 auto; min-width: 0; }
  .header-tools { display: contents; }
  .header-post { display: none; }
  .theme-toggle { order: 2; width: 40px; height: 40px; border-radius: 11px; }
  .header-region { order: 3; flex: 0 1 auto; max-width: 30vw; margin-left: 0; padding: 7px 6px; font-size: .82rem; }
  .header-search { order: 4; flex: 0 0 42px; width: 42px; min-height: 42px; background: transparent; border: 0; border-radius: 11px; }
  .header-search input { display: none; }
  .header-search .search-ico { width: 42px; height: 42px; padding: 0; align-items: center; justify-content: center; color: var(--text); background: var(--chip); border: 1px solid var(--border); border-radius: 11px; }
  .header-search .search-ico:hover { background: var(--chip-hover); }
}


/* One palette, one header, one card — phone, tablet, desktop. */
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
.hero { display: none !important; }
.ad-grid { gap: 10px 8px; }
.ad-thumb { aspect-ratio: 1 / 1; border-radius: 12px; background: var(--bg-soft); }
.ad-title { font-size: .82rem; line-height: 1.25; }
.ad-price { font-size: .9rem; color: var(--link); }
.ad-meta { font-size: .72rem; }
.ad-body { padding: 6px 2px 0; gap: 1px; }
.ad-card .fav-btn, .ad-card .cart-btn {
  width: 30px; height: 30px; top: 6px; border: 0; border-radius: 50%;
  background: var(--fav-bg); color: var(--fav-fg); box-shadow: 0 2px 8px rgba(17,17,17,.12);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; z-index: 2;
}
.ad-card .fav-btn { position: absolute; right: 6px; }
.ad-card .cart-btn { position: absolute; left: 6px; }
.ad-card .fav-btn.is-on { color: #e11d48; }
.ad-card .cart-btn.is-on { color: #ff6a00; }
.ph-ico { display: flex; align-items: center; justify-content: center; width: 38%; max-width: 64px; color: var(--primary); }
.ph-ico svg { width: 100%; height: auto; }
.header-icon {
  position: relative; flex: none; width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; color: var(--primary); background: var(--primary-soft); border: 1px solid var(--border);
}
.header-icon:hover { background: var(--chip-hover); text-decoration: none; }
.header-count {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: #ff6a00; color: #fff; font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.header-count[hidden] { display: none !important; }
.region-pop-wrap { position: relative; }
.region-pop-wrap > summary { list-style: none; cursor: pointer; }
.region-pop-wrap > summary::-webkit-details-marker { display: none; }
.region-pop {
  position: absolute; z-index: 80; top: calc(100% + 8px); right: 0;
  width: min(460px, 94vw); max-height: min(72vh, 680px); overflow: auto;
  background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 12px;
}
.region-pop .by-grid, .region-pop .fd-grid, .region-pop .region-strip, .region-pop .subjects {
  display: block !important; overflow: visible; grid-template-columns: none; padding: 0; flex-wrap: nowrap;
}
.region-pop .by-card, .region-pop .fd-card {
  padding: 8px 2px; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent;
  border-bottom: 1px solid var(--border); height: auto;
}
.region-pop .region-scroll-hint, .region-pop .by-map-wrap { display: none !important; }
.region-pop h2 { margin: 0 0 8px; font-size: 1rem; }
.spec-panel { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--bg-soft); }
.spec-panel legend { font-weight: 800; color: var(--text); padding: 0 6px; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spec-grid label { display: grid; gap: 4px; font-weight: 650; font-size: .88rem; }
.cart-add.is-on { background: #ff6a00; border-color: #ff6a00; color: #fff; }
.price-row { gap: 8px; flex-wrap: wrap; }
@media (max-width: 959px) {
  .site-header { background: var(--header-bg); }
  .header-inner { flex-wrap: wrap; gap: 8px; }
  .header-tools { display: flex; flex: 1 1 100%; order: 8; align-items: center; gap: 8px; }
  .header-post { display: inline-flex; }
  .header-search {
    display: flex; order: 0; flex: 1 1 auto; width: auto; min-height: 44px;
    background: var(--search-bg); border: 0; border-radius: 12px;
  }
  .header-search input { display: block; }
  .header-search .search-ico { display: none; }
  details.all-cats.desktop-only { display: block; }
  .search-submit.desktop-only { display: inline-flex; align-items: center; }
  .header-icon-fav { order: 2; }
  .header-icon-cart { order: 3; }
  .region-pop-wrap { order: 3; }
  .region-pop { position: fixed; left: 8px; right: 8px; top: 64px; width: auto; }
  .ad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .spec-grid { grid-template-columns: 1fr; }
}
@media (min-width: 720px) and (max-width: 959px) {
  .ad-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 719px) {
  .ad-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 190px)) !important;
    justify-content: center;
  }
}
@media (min-width: 720px) and (max-width: 959px) {
  .ad-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 220px)) !important;
    justify-content: center;
  }
}
@media (min-width: 960px) {
  .ad-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
    justify-content: center;
  }
}

html[data-theme="dark"] .ad-card .fav-btn,
html[data-theme="dark"] .ad-card .cart-btn { background: var(--fav-bg); color: var(--fav-fg); }

/* Listing page: gallery + offer. Two columns only on wide screens. */
.field-hint { font-weight: 500; color: var(--muted); font-size: .82rem; }
.ad-layout { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ad-side { display: contents; }
.ad-head { order: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ad-head h1 { margin: 0; flex: 1; font-size: clamp(1.25rem, 4.4vw, 1.7rem); line-height: 1.25; }
.ad-gallery { order: 2; min-width: 0; display: grid; gap: 8px; }
.ad-offer { order: 3; }
.ad-body { order: 4; min-width: 0; }
.ad-similar { order: 5; }
.ad-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: min(62vw, 320px);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-soft);
}
.ad-gallery .ad-photo-main,
.ad-gallery .ad-video-frame {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  display: block;
}
.ad-video-frame { border: 0; background: #140c22; }
.ad-video-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  padding: 16px;
  cursor: pointer;
  color: #fff;
  font: inherit;
  font-weight: 750;
  background: #24143d center/cover no-repeat;
}
.ad-video-play::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(20, 10, 36, .45);
}
.ad-play-icon, .ad-video-play span:last-child { position: relative; z-index: 1; }
.ad-play-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(109, 40, 217, .35);
}
.ad-video-play[hidden],
.ad-video-frame[hidden],
.ad-gallery .ad-photo-main[hidden] { display: none !important; }
.ad-stage-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.ad-stage-empty .ph-ico { width: 72px; max-width: 28%; }
.ad-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.ad-thumbs::-webkit-scrollbar { display: none; width: 0; height: 0; }
.ad-thumb-btn {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 2px solid transparent;
}
.ad-thumb-btn.is-on { border-color: var(--primary); }
.ad-thumb-video {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a1848;
  color: #fff;
}
.ad-offer, .ad-similar {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.ad-price-lg {
  font-size: clamp(1.85rem, 7vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.ad-loc { margin: 8px 0 12px; font-weight: 650; }
.ad-loc a { color: inherit; }
.ad-seller { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.ad-seller-ava {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 800;
}
.ad-seller-name, .ad-seller-role { display: block; }
.ad-seller-name { font-weight: 750; }
.ad-seller-role { color: var(--muted); font-size: .82rem; font-weight: 600; }
.ad-actions { display: grid; gap: 8px; }
.ad-actions .btn { width: 100%; min-height: 48px; }
.ad-block-title { margin: 16px 0 8px; font-size: 1.05rem; font-weight: 800; }
.ad-body .ad-block-title:first-child { margin-top: 0; }
.ad-specs {
  display: flex; flex-wrap: wrap; gap: 8px;
  list-style: none; margin: 0 0 4px; padding: 0;
}
.ad-specs li {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: .86rem;
  font-weight: 650;
}
.ad-specs svg { width: 16px; height: 16px; flex: none; color: var(--primary); }
.ad-spec-k { color: var(--muted); font-weight: 650; }
.ad-desc { line-height: 1.55; }
.ad-similar-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ad-mini {
  display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--bg-soft); color: inherit; text-decoration: none;
}
.ad-mini:hover { text-decoration: none; }
.ad-mini-thumb {
  display: flex; align-items: center; justify-content: center;
  height: 104px; background: var(--bg-elev); overflow: hidden;
}
.ad-mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-mini-thumb .ph-ico { width: 36px; }
.ad-mini-body { display: grid; gap: 4px; padding: 8px 8px 10px; }
.ad-mini-title {
  font-weight: 700; font-size: .86rem; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ad-mini-price { font-weight: 800; font-size: .92rem; }

@media (min-width: 960px) {
  .ad-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, .9fr);
    column-gap: 28px;
    row-gap: 16px;
    align-items: start;
  }
  .ad-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    grid-column: 2;
    grid-row: 1 / span 3;
    position: sticky;
    top: 88px;
    align-self: start;
    min-width: 0;
  }
  .ad-head { grid-column: 1; grid-row: 1; order: 0; }
  .ad-gallery { grid-column: 1; grid-row: 2; order: 0; }
  .ad-body { grid-column: 1; grid-row: 3; order: 0; }
  .ad-offer, .ad-similar { order: 0; }
  .ad-stage { height: min(42vh, 420px); }
  .ad-similar-list { grid-template-columns: 1fr; gap: 0; }
  .ad-mini {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 10px 0;
    border-top: 1px solid var(--border);
  }
  .ad-similar-list .ad-mini:first-child { border-top: 0; padding-top: 0; }
  .ad-mini-thumb { width: 72px; height: 72px; border-radius: 10px; }
  .ad-mini-body { padding: 0; }
}


/* Currency switch, chat, recommendations, install prompt. */
.cur-switch {
  display: inline-flex;
  flex: none;
  align-items: stretch;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
  background: var(--chip);
}
.cur-switch button {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  font-size: .72rem;
  letter-spacing: .01em;
  padding: 0 8px;
  cursor: pointer;
  min-width: 40px;
}
.cur-switch button + button { border-left: 1px solid var(--border); }
.cur-switch button.is-on { background: var(--primary); color: var(--on-primary); }
.ad-chat-note { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.reco-section { margin-top: 8px; }
.install-slot { margin: 0 0 10px; }
.install-slot[hidden] { display: none !important; }
.install-btn { min-height: 40px; }
.install-ios { margin: 0; font-size: .9rem; color: var(--muted); }
.chat-page { display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; }
.chat-head h1 { margin: 4px 0; font-size: 1.25rem; }
.chat-back { font-weight: 700; }
.chat-peer { margin: 0; font-weight: 700; }
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 280px;
  max-height: min(62vh, 640px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-soft);
}
.chat-empty { margin: auto; color: var(--muted); text-align: center; }
.chat-msg { display: flex; }
.chat-msg.is-mine { justify-content: flex-end; }
.chat-bubble {
  max-width: min(78%, 520px);
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-msg.is-mine .chat-bubble { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.chat-time { display: block; margin-top: 4px; font-size: .72rem; opacity: .8; }
.chat-note { margin: 0; color: var(--muted); font-size: .82rem; }
.chat-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.chat-label { flex: 1 0 100%; font-weight: 750; }
.chat-form textarea {
  flex: 1 1 220px;
  min-height: 52px;
  max-height: 160px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  padding: 12px;
  font: inherit;
  font-size: 16px;
}
.chat-form .btn { min-height: 52px; }
.msg-list { display: grid; gap: 8px; }
.msg-row {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elev);
  color: inherit;
  text-decoration: none;
}
.msg-row:hover { text-decoration: none; background: var(--bg-soft); }
.msg-row-title { font-weight: 800; }
.msg-row-peer, .msg-row-time { color: var(--muted); font-size: .82rem; }
.msg-row-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 959px) {
  .cur-switch { order: 2; height: 36px; }
  .cur-switch button { min-width: 36px; padding: 0 6px; font-size: .68rem; }
  .theme-toggle { order: 3; }
  .header-region { order: 4; }
  .chat-page { min-height: calc(100dvh - 168px); }
  .chat-log { max-height: none; flex: 1 1 auto; min-height: 46vh; }
  .chat-bubble { max-width: 90%; }
  .chat-form { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b)); background: var(--bg); padding-top: 8px; }
  .chat-form .btn { flex: 1 1 100%; }
}
@media (min-width: 960px) {
  .chat-page { max-width: 760px; }
  .chat-log { min-height: 420px; }
}


/* Phone listing + recommendations: horizontal snap row. Desktop main grid stays centered. */
.reco-section .ad-strip {
  display: flex !important;
  flex-wrap: nowrap;
  justify-content: safe center;
  align-items: stretch;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  padding: 2px 2px 10px;
}
.reco-section .ad-strip > .ad-card {
  flex: 0 0 200px;
  width: 200px;
  max-width: 200px;
  scroll-snap-align: start;
}
@media (max-width: 767px) {
  .ads-section .ad-strip,
  .reco-section .ad-strip {
    display: flex !important;
    flex-wrap: nowrap;
    justify-content: flex-start !important;
    align-items: stretch;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 2px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0 8px;
  }
  .ads-section .ad-strip::-webkit-scrollbar,
  .reco-section .ad-strip::-webkit-scrollbar {
    display: none;
    height: 0;
    width: 0;
  }
  .ads-section .ad-strip > .ad-card,
  .reco-section .ad-strip > .ad-card {
    flex: 0 0 42%;
    width: 42%;
    max-width: 168px;
    min-width: 132px;
    scroll-snap-align: start;
  }
}


/* App shell on phone widths: fixed tab bar, compact header, no footer chrome. */
@media (max-width: 959px) {
  body {
    padding-bottom: calc(var(--tab-h) + var(--safe-b) + 28px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  .site-header {
    padding-top: var(--safe-t);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    overflow-x: clip;
  }
  .site-footer { display: none !important; }
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: calc(6px + var(--safe-b));
  }
  .main-content {
    padding-top: 8px;
    padding-bottom: 18px;
  }
  .chat-page .chat-form {
    bottom: calc(var(--tab-h) + var(--safe-b) + 10px);
  }
  .site-header .header-inner {
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    min-width: 0;
  }
  .site-header .logo { order: 1; flex: 0 0 auto; min-width: 0; }
  .site-header .logo-word { font-size: 1.2rem; }
  .site-header details.all-cats { display: none !important; }
  .site-header .header-tools { display: contents; }
  .site-header .header-post,
  .site-header .header-icon-fav { display: none !important; }
  .site-header .cur-switch { order: 2; height: 34px; margin-left: auto; }
  .site-header .cur-switch button { min-width: 32px; padding: 0 5px; font-size: .64rem; }
  .site-header .theme-toggle { order: 3; width: 34px; height: 34px; border-radius: 10px; }
  .site-header .region-pop-wrap { order: 4; flex: 0 1 auto; min-width: 0; }
  .site-header .header-region {
    max-width: 18vw;
    margin-left: 0;
    padding: 6px;
    font-size: .78rem;
    gap: 4px;
    min-width: 0;
  }
  .site-header .header-search {
    order: 5;
    flex: 0 0 34px;
    width: 34px;
    min-height: 34px;
    background: transparent;
    border: 0;
    border-radius: 10px;
  }
  .site-header .header-search input,
  .site-header .header-search .search-submit { display: none !important; }
  .site-header .header-search .search-ico {
    display: flex !important;
    width: 34px;
    height: 34px;
    padding: 0;
    align-items: center;
    justify-content: center;
    color: var(--text);
    background: var(--chip);
    border: 1px solid var(--border);
    border-radius: 10px;
  }
  .site-header .header-icon-cart {
    order: 6;
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
}
@media (max-width: 380px) {
  .site-header .header-region span { display: none; }
  .site-header .header-region { max-width: none; padding: 6px 7px; }
}

.app-install {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 8px 8px 10px;
  border-radius: 14px;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  color: var(--text);
}
.app-install[hidden],
#install-btn[hidden],
#install-ios[hidden] { display: none !important; }
.app-install-go {
  flex: 1 1 auto;
  min-height: 40px;
  border-radius: 12px;
  font-weight: 800;
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.install-ios {
  margin: 0;
  flex: 1 1 auto;
  font-size: .92rem;
  font-weight: 750;
  line-height: 1.35;
  color: var(--text);
}
.app-install-dismiss {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
@media (min-width: 960px) {
  .app-install { display: none !important; }
}
@media (display-mode: standalone) {
  .app-install { display: none !important; }
}
