/* ============================================================
   Auto Marketplace — page styles
   ============================================================ */

/* ── App loader (startup overlay) ─────────────────────────── */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(80% 60% at 50% -10%, color-mix(in srgb, var(--mesh-a) 72%, transparent) 0%, transparent 68%),
    radial-gradient(70% 60% at 100% 50%, color-mix(in srgb, var(--mesh-d) 68%, transparent) 0%, transparent 70%),
    radial-gradient(70% 60% at 0% 100%, color-mix(in srgb, var(--mesh-c) 64%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--mesh-e) 100%);
  -webkit-backdrop-filter: blur(calc(var(--blur-2) * 0.9)) saturate(180%);
  backdrop-filter: blur(calc(var(--blur-2) * 0.9)) saturate(180%);
  transition: opacity 220ms ease, transform 220ms ease;
  transform: translateY(0);
}
.app-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 520px at 50% 35%,
      color-mix(in srgb, var(--brand-500) 16%, transparent) 0%,
      transparent 62%),
    radial-gradient(780px 460px at 65% 55%,
      color-mix(in srgb, var(--accent-500) 10%, transparent) 0%,
      transparent 60%);
  pointer-events: none;
  opacity: 0.9;
}
.app-loader.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}
/* Loader moved to styles/loader.css */

/* ── App shell layout ─────────────────────────────────────── */
.app {
  height: 100vh;
  display: grid;
  grid-template-rows: 56px 1fr;
  position: relative;
  overflow: hidden;
}
.main-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px clamp(24px, 4vw, 64px) 120px;
}
.main-scroll::-webkit-scrollbar { width: 12px; }

/* ── Top bar ───────────────────────────────────────────────── */
.topbar {
  padding: 8px 16px 0;
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  display: flex; align-items: center; gap: 16px;
  height: 48px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 0.5px solid var(--stroke-2);
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(var(--blur-3)) saturate(200%);
  backdrop-filter: blur(var(--blur-3)) saturate(200%);
  box-shadow: inset 0 0.5px 0 var(--sheen), var(--sh-2);
}
.traffic { display:flex; gap:6px; padding-right:4px; }
.traffic .dot { width:11px; height:11px; border-radius:50%; }
.dot-r { background:#ff5f57; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.15); }
.dot-y { background:#febc2e; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.15); }
.dot-g { background:#28c840; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.15); }

.brand { display:flex; align-items:center; gap:8px; background:transparent; border:0; padding:4px 8px; border-radius:8px; }
.brand:hover { background: var(--glass-1); }
.brand-mark { display:flex; }
.brand-name { font-family: var(--font-display); font-weight:700; font-size:15px; letter-spacing:-0.02em; }
.brand-name i { font-style: normal; color: var(--brand-500); }

.menubar { display:flex; gap:2px; padding-left:8px; border-left: 0.5px solid var(--stroke-1); margin-left:4px; }
.menu-item {
  background: transparent; border:0;
  padding: 6px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--fg-muted);
}
.menu-item:hover { background: var(--glass-1); color: var(--fg); }
.menu-item.is-active { background: var(--glass-3); color: var(--fg); }

.topbar-search {
  flex: 1; max-width: 480px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--glass-1);
  border: 0.5px solid var(--stroke-1);
}
.topbar-search-input {
  flex:1; background:transparent; border:0; outline:0;
  font-size:13px; color:var(--fg);
}
.topbar-search-input::placeholder { color: var(--fg-faint); }
.kbd {
  font-family: var(--font-mono); font-size:10px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--glass-2); color: var(--fg-faint);
  border: 0.5px solid var(--stroke-1);
}

.topbar-tools { display:flex; align-items:center; gap:8px; margin-left:auto; }
.icon-btn {
  position: relative;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0.5px solid transparent;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-muted);
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--glass-2); color: var(--fg); border-color: var(--stroke-1); }
.icon-btn.is-on { color: var(--brand-500); }
.badge-dot { position: absolute; top: 8px; right: 9px; width:6px; height:6px; border-radius:50%; background: var(--brand-500); border: 1.5px solid var(--bg-0); }

.avatar {
  width:34px; height:34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--accent-500));
  border: 0.5px solid var(--stroke-2);
  color: white; font-weight:600; font-size: 12px;
  display:flex; align-items:center; justify-content:center;
}

/* ── Dock ──────────────────────────────────────────────────── */
.dock-wrap {
  position: fixed; bottom: 18px; left: 0; right: 0;
  display: flex; justify-content: center; pointer-events: none;
  z-index: 40;
}
.dock {
  pointer-events: auto;
  display: flex; align-items: center; gap: 4px;
  padding: 8px 10px;
  border-radius: 22px;
}
.dock-item {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 14px; border: 0;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-muted);
  transition: transform 0.12s, background 0.12s, color 0.12s;
}
.dock-item:hover { transform: scale(1.15) translateY(-4px); background: var(--glass-1); color: var(--fg); }
.dock-item.is-active { color: var(--brand-500); background: var(--glass-2); }
.dock-dot {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--brand-500);
}

/* ── Generic screen ───────────────────────────────────────── */
.screen { max-width: 1480px; margin: 0 auto; }
.section { margin-top: 56px; }
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 20px;
}
.grad-text {
  background: linear-gradient(135deg, var(--brand-400) 0%, var(--brand-600) 60%, var(--accent-500) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Home: hero ───────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  padding-top: 32px;
  align-items: center;
  min-height: 620px;
}
.hero-text { max-width: 720px; }

.hero-search {
  margin-top: 40px;
  padding: 16px;
  border-radius: var(--r-2xl);
}
.hsearch-tabs {
  display: flex; gap: 4px;
  padding: 4px;
  background: var(--glass-1);
  border-radius: var(--r-pill);
  width: fit-content;
  margin-bottom: 16px;
}
.hsearch-tab {
  display:inline-flex; align-items:center; gap:6px;
  border:0; background:transparent;
  padding: 6px 14px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--fg-muted);
}
.hsearch-tab.is-on { background: var(--glass-3); color: var(--fg); box-shadow: inset 0 0.5px 0 var(--sheen); }
.hsearch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.hsearch-field { display: flex; flex-direction: column; gap: 6px; }
.hsearch-field label { font-size: 11px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.hsearch-go { white-space: nowrap; }

.hero-deck {
  position: relative;
  height: 520px;
}
.deck-card {
  position: absolute;
  padding: 14px;
  width: 320px;
  border-radius: var(--r-xl);
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.deck-card:nth-child(1) { top: 20px; right: 40px; transform: rotate(-2deg); }
.deck-2 { top: 280px; right: -10px; width: 240px; transform: rotate(3deg); z-index: 2; }
.deck-3 { top: 380px; left: 60px; width: 200px; transform: rotate(-3deg); z-index: 3; }

/* ── Home: categories ─────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}
.cat-card {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  min-height: 140px;
  padding: 16px;
  border-radius: var(--r-lg);
  text-align: left;
  cursor: pointer;
  border: 0.5px solid var(--stroke-1);
  transition: transform 0.15s, background 0.15s;
}
.cat-card:hover { transform: translateY(-2px); background: var(--glass-2); }
.cat-icon { font-size: 32px; line-height: 1; margin-bottom: 8px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }
.cat-name { font-weight: 600; font-size: 14px; }
.cat-count { font-size: 11px; margin-top: 4px; font-variant-numeric: tabular-nums; }

@media (max-width: 1280px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Card grid ────────────────────────────────────────────── */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── Listing card ─────────────────────────────────────────── */
.card {
  display: flex; flex-direction: column;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--glass-1);
  border: 0.5px solid var(--stroke-1);
  -webkit-backdrop-filter: blur(var(--blur-1)) saturate(180%);
  backdrop-filter: blur(var(--blur-1)) saturate(180%);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--stroke-3);
  box-shadow: var(--sh-3);
}
.card-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.card-photo-shade {
  position:absolute; inset:0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.25) 100%);
  pointer-events: none;
}
.card-tag {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 10px;
  font-size: 11px; font-weight: 600;
  border-radius: var(--r-pill);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  backdrop-filter: blur(8px) saturate(180%);
  z-index: 2;
}
.tag-new { background: var(--brand-500); color: white; }
.tag-badge { background: rgba(255,255,255,0.15); color: white; border: 0.5px solid rgba(255,255,255,0.2); top: 10px; left: auto; right: 50px; }
.card-fav {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0.5px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.4);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: white;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
}
.card-fav.is-on { background: var(--brand-500); border-color: var(--brand-600); }
.card-pager {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 3px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: var(--r-pill);
  z-index: 2;
}
.pdot { width: 16px; height: 3px; background: rgba(255,255,255,0.3); border: 0; border-radius: 2px; cursor: pointer; }
.pdot.is-on { background: white; }

.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.card-info, .card-bottom { display: contents; }
.card-tags { display: none; }
.card-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-title { font-size: 15px; font-weight: 600; line-height: 1.25; margin: 0; letter-spacing: -0.012em; }
.card-price { font-size: 16px; font-weight: 700; white-space: nowrap; letter-spacing: -0.015em; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; align-items: center; }
.dot-sep { color: var(--fg-faint); }
.card-foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; }
.card-loc { display:inline-flex; gap:4px; align-items:center; }
.card-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; border-top: 0.5px solid var(--stroke-1); }
.card-seller { font-size: 11px; max-width: 50%; display:inline-flex; align-items:center; gap:4px; }
.chip-on, .chip[data-on="true"] { background: var(--brand-500); color: white; border-color: var(--brand-600); }

/* ── List row ─────────────────────────────────────────────── */
.list-rows { display:flex; flex-direction: column; gap: 12px; }
.lrow {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 16px;
  padding: 12px;
  border-radius: var(--r-lg);
  background: var(--glass-1);
  border: 0.5px solid var(--stroke-1);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.lrow:hover { background: var(--glass-2); border-color: var(--stroke-2); }
.lrow-photo {
  aspect-ratio: 4 / 3; min-height: 120px;
  border-radius: var(--r-md);
  position: relative; overflow: hidden;
}
.lrow-body { display:flex; flex-direction: column; gap: 8px; min-width: 0; }
.lrow-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.lrow-foot { display:flex; flex-wrap: wrap; gap: 12px; align-items:center; font-size:12px; margin-top:auto; padding-top: 6px; }
.lrow-side { display:flex; flex-direction: column; gap: 8px; align-items: center; }

/* ── Catalog ──────────────────────────────────────────────── */
.catalog { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.sidebar {
  position: sticky; top: 16px;
  padding: 16px 10px 16px 16px;        /* правый padding меньше — место под scrollbar */
  border-radius: var(--r-lg);
  display: flex; flex-direction: column; gap: 16px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  /* Стилизация прокрутки внутри sidebar — тонкая, не выходит за границы */
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--fg-ghost) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; margin: 12px 0; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--fg-ghost);
  border-radius: 999px;
  border: none;
  background-clip: padding-box;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--fg-faint); }
.sidebar-head { display:flex; justify-content:space-between; align-items: center; }
.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-label {
  display:flex; justify-content:space-between; align-items:center;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600; color: var(--fg-muted);
}
.cat-pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pill-list .chip { cursor: pointer; }

.dual-range { position: relative; height: 24px; }
.dual-range input { position: absolute; left:0; right:0; width:100%; pointer-events: none; -webkit-appearance: none; appearance: none; background: transparent; }
.dual-range input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  pointer-events: auto;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--brand-500); border: 1.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.dual-range::before {
  content:""; position:absolute; left:0; right:0; top:50%; height:3px;
  background: var(--stroke-2); border-radius: 999px;
  transform: translateY(-50%);
}

.catalog-main { display: flex; flex-direction: column; gap: 24px; }
.catalog-toolbar {
  position: sticky; top: 16px; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 4px;
  border-radius: var(--r-lg);
}
.seg-toggle {
  display:flex;
  background: var(--glass-1);
  border: 0.5px solid var(--stroke-1);
  border-radius: var(--r-md);
  padding: 2px;
}
.seg-toggle button {
  width: 32px; height: 28px;
  border: 0; background: transparent;
  border-radius: var(--r-sm);
  display:flex; align-items:center; justify-content:center;
  color: var(--fg-muted);
}
.seg-toggle button.is-on { background: var(--glass-3); color: var(--fg); box-shadow: inset 0 0.5px 0 var(--sheen); }

/* ── Map view ─────────────────────────────────────────────── */
.map-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 16px; height: calc(100vh - 200px); }
.map-canvas { position:relative; overflow: hidden; border-radius: var(--r-lg); }
.map-bg {
  position:absolute; inset:0;
  background:
    radial-gradient(circle at 30% 30%, rgba(124, 92, 247, 0.18), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(74, 140, 255, 0.18), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 60px),
    var(--bg-1);
}
.map-canvas::before {
  content:""; position:absolute; inset:0;
  background:
    linear-gradient(180deg, transparent 30%, var(--bg-2) 90%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 80px);
  pointer-events: none;
}
.map-pin {
  position: absolute; transform: translate(-50%, -50%);
  background: var(--glass-3);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  color: var(--fg);
  border: 0.5px solid var(--stroke-2);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--sh-2);
  z-index: 2;
}
.map-pin.is-active { background: var(--brand-500); color: white; border-color: var(--brand-600); z-index: 3; transform: translate(-50%, -50%) scale(1.1); }
.map-popover {
  position: absolute; transform: translate(-50%, calc(-100% - 16px));
  width: 240px;
  padding: 12px;
  z-index: 5;
  border-radius: var(--r-lg);
}
.map-pop-photo { aspect-ratio: 4/3; border-radius: var(--r-md); }
.map-side { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-right: 4px; }
.map-side-row {
  display:flex; gap: 10px; padding: 8px;
  border-radius: var(--r-md);
  cursor:pointer;
}
.map-side-row:hover { background: var(--glass-2); }
.map-side-photo { width: 70px; height: 56px; border-radius: var(--r-sm); flex-shrink: 0; }

/* ── Trust strip ──────────────────────────────────────────── */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; }
.trust-card { display:flex; gap: 16px; padding: 20px; border-radius: var(--r-lg); align-items: flex-start; }

/* ── Footer ───────────────────────────────────────────────── */
.footer { margin-top: 80px; padding-bottom: 24px; }
.footer-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px; padding: 28px 32px; border-radius: var(--r-xl);
  margin-bottom: 48px; flex-wrap: wrap;
}
.footer-cta-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-phone {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 16px;
  border-radius: var(--r-md); background: var(--glass-1);
  border: 0.5px solid var(--stroke-1);
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 48px;
  padding: 0 8px 32px; border-bottom: 0.5px solid var(--stroke-1);
}
.footer-brand-col { display: flex; flex-direction: column; }
.footer-social { display: flex; gap: 8px; margin-top: 18px; }
.footer-soc-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0.5px solid var(--stroke-2); background: var(--glass-1);
  color: var(--fg-muted);
  -webkit-backdrop-filter: blur(var(--blur-1)); backdrop-filter: blur(var(--blur-1));
  transition: background .12s, color .12s, border-color .12s, transform .08s;
}
.footer-soc-btn:hover { background: var(--glass-3); color: var(--fg); border-color: var(--stroke-3); }
.footer-soc-btn:active { transform: scale(0.94); }
.footer-apps { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.footer-app {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-radius: var(--r-md); border: 0.5px solid var(--stroke-2);
  background: var(--glass-1); color: var(--fg);
  -webkit-backdrop-filter: blur(var(--blur-1)); backdrop-filter: blur(var(--blur-1));
}
.footer-app:hover { background: var(--glass-2); }
.footer-col-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-muted); margin-bottom: 14px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--fg-muted); font-size: 13px; transition: color .12s; }
.footer-col a:hover { color: var(--fg); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 8px 0; gap: 16px; flex-wrap: wrap;
}
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: var(--fg-faint); font-size: 12px; transition: color .12s; }
.footer-bottom-links a:hover { color: var(--fg); }

@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
.trust-ic {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  background: var(--glass-2);
  display:flex; align-items:center; justify-content:center;
  flex-shrink: 0;
}

/* ── Detail screen ───────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }

.gallery { padding: 8px; border-radius: var(--r-xl); }
.gal-main {
  position:relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.gal-grad { position:absolute; inset:0; background: radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.18), transparent 60%); pointer-events: none; }
.gal-badge {
  position:absolute; left:16px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: white;
  font-size: 12px; font-weight: 500;
  border-radius: var(--r-pill);
  border: 0.5px solid rgba(255,255,255,0.15);
}
.gal-counter {
  position:absolute; bottom:16px; right:16px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: white;
  font-size: 12px;
  border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}
.gal-nav {
  position:absolute; top:50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 0.5px solid rgba(255,255,255,0.15);
  color: white; font-size: 20px;
  display:flex; align-items:center; justify-content:center;
}
.gal-prev { left: 16px; } .gal-next { right: 16px; }
.gal-thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 8px 0 0; }
.gal-thumb {
  aspect-ratio: 4/3;
  border: 0; border-radius: var(--r-sm);
  cursor: pointer;
  border: 1.5px solid transparent;
}
.gal-thumb.is-on { border-color: var(--brand-500); }
.gal-thumb-empty {
  background: var(--glass-1);
  border: 0.5px dashed var(--stroke-2);
  display:flex; align-items:center; justify-content:center;
}

.d-tabs {
  display:flex; gap: 4px;
  padding: 4px;
  border-radius: var(--r-md);
  width: fit-content;
}
.d-tab {
  padding: 8px 16px;
  border: 0; background: transparent;
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500;
  color: var(--fg-muted);
}
.d-tab.is-on { background: var(--glass-3); color: var(--fg); box-shadow: inset 0 0.5px 0 var(--sheen); }

.d-card { padding: 20px; border-radius: var(--r-lg); }
.specs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; }
.spec-row { display:flex; justify-content: space-between; padding: 8px 0; border-bottom: 0.5px solid var(--stroke-1); font-size: 13px; }
.vin-box {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding: 12px 14px;
  background: var(--glass-1);
  border: 0.5px solid var(--stroke-1);
  border-radius: var(--r-md);
}

.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hist-row { display:flex; gap: 14px; align-items: center; padding: 10px; border-radius: var(--r-md); background: var(--glass-1); }
.hist-ic { width: 36px; height: 36px; border-radius: var(--r-sm); display:flex; align-items:center; justify-content:center; flex-shrink: 0; }

.credit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.credit-grid input[type="range"] {
  width: 100%; margin: 12px 0 0;
  accent-color: var(--brand-500);
}
.credit-result {
  display:flex; justify-content: space-between; align-items: center;
  margin-top: 24px; padding: 24px;
  background: var(--glass-1);
  border-radius: var(--r-lg);
  border: 0.5px solid var(--stroke-1);
}

.seller-row { display:flex; gap: 12px; align-items: center; }
.seller-avatar {
  width: 48px; height: 48px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand-400), var(--accent-500));
  color:white; font-weight:600;
  display:flex; align-items:center; justify-content:center;
}
.seller-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-top: 16px; padding: 12px;
  background: var(--glass-1);
  border-radius: var(--r-md);
  border: 0.5px solid var(--stroke-1);
}
.mini-map {
  position:relative;
  aspect-ratio: 4/3;
  border-radius: var(--r-md);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(124, 92, 247, 0.16), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 30px),
    var(--bg-1);
}
.mini-pin { position:absolute; transform: translate(-50%, -100%); }

/* ── Create ───────────────────────────────────────────────── */
.create-head { display:flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.stepper {
  display:flex; padding: 12px 16px;
  border-radius: var(--r-pill);
  margin-bottom: 24px;
}
.step { flex:1; display:flex; align-items:center; gap: 10px; cursor: pointer; opacity: 0.5; }
.step.is-on { opacity: 1; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 0.5px solid var(--stroke-2);
  display:flex; align-items:center; justify-content:center;
  font-size: 12px; font-weight: 600;
  background: var(--glass-1);
}
.step.is-on .step-dot { background: var(--brand-500); color: white; border-color: var(--brand-600); }
.step.is-done .step-dot { background: var(--green-500); border-color: var(--green-500); }
.step-label { font-size: 13px; font-weight: 500; }
.step + .step::before {
  content:""; flex:1; height: 0.5px; background: var(--stroke-2); margin-right: 10px;
}

.create-body { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.create-form { padding: 32px; border-radius: var(--r-xl); }
.create-preview { padding: 20px; border-radius: var(--r-xl); position: sticky; top: 16px; }
.cat-pick { display:grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cat-pick-card {
  display:flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 24px 16px;
  border-radius: var(--r-lg);
  border: 0.5px solid var(--stroke-1);
  background: var(--glass-1);
  cursor: pointer;
}
.cat-pick-card.is-on { border-color: var(--brand-500); background: rgba(79, 101, 128, 0.12); }
.cat-pick-icon { font-size: 32px; }
.cat-pick-name { font-weight: 500; }

.form-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-field { display:flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 12px; color: var(--fg-muted); font-weight: 500; }
.form-nav { display:flex; justify-content: space-between; margin-top: 32px; padding-top: 24px; border-top: 0.5px solid var(--stroke-1); }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.photo-up {
  aspect-ratio: 4/3;
  border: 1.5px dashed var(--stroke-3);
  border-radius: var(--r-md);
  display:flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; padding: 12px; text-align: center;
}
.photo-up:hover { border-color: var(--brand-500); background: rgba(79, 101, 128, 0.08); }
.photo-slot {
  aspect-ratio: 4/3;
  background: var(--glass-1);
  border: 0.5px solid var(--stroke-1);
  border-radius: var(--r-md);
  position: relative;
}
.photo-num {
  position:absolute; top:8px; left:8px;
  background: var(--bg-2);
  border: 0.5px solid var(--stroke-2);
  width: 22px; height: 22px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-size: 11px; font-weight: 600;
  color: var(--fg-muted);
}
.price-tip {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--r-md);
}
.check-row { display:flex; gap: 8px; align-items: center; margin-top: 8px; cursor: pointer; }
.check-row input { accent-color: var(--brand-500); }

/* ── Profile ──────────────────────────────────────────────── */
.profile-head {
  display:flex; gap: 24px; align-items: center;
  padding: 32px;
  border-radius: var(--r-xl);
  margin-bottom: 24px;
}
.profile-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--accent-500), var(--mesh-d));
  color: white;
  font-size: 36px; font-weight: 700;
  font-family: var(--font-display);
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 8px 30px rgba(79, 101, 128, 0.28);
}
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.pstat { padding: 20px; border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 6px; }
.pstat-ic { color: var(--brand-500); }
.pstat-num { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.pstat-label { font-size: 12px; }

.empty {
  padding: 48px;
  text-align: center;
  border-radius: var(--r-lg);
  display: flex; flex-direction: column; align-items: center;
}
.searches { display: flex; flex-direction: column; gap: 8px; }
.search-row {
  display:flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
}
.my-listing { display: flex; flex-direction: column; gap: 8px; }
.my-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 12px; border-radius: var(--r-md);
}

/* ── Chat ─────────────────────────────────────────────────── */
.chat { padding: 0; }
.chat-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  /* CRITICAL: фиксируем строку = всей высоте контейнера, иначе
     grid track авто-расширяется под content и внутренний flex:1+overflow
     перестаёт скроллиться. */
  grid-template-rows: minmax(0, 1fr);
  height: calc(100vh - 140px);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.chat-list {
  border-right: 0.5px solid var(--stroke-1);
  display: flex; flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}
.chat-list-head { display:flex; justify-content: space-between; align-items: center; padding: 18px 16px 12px; }
.chat-search {
  display:flex; align-items: center; gap: 8px;
  margin: 0 12px 8px;
  padding: 0 12px;
  background: var(--glass-1);
  border: 0.5px solid var(--stroke-1);
  border-radius: var(--r-md);
  height: 32px;
}
.chat-item {
  display:flex; gap: 12px;
  padding: 12px 16px;
  border: 0; background: transparent;
  text-align: left;
  border-bottom: 0.5px solid var(--stroke-1);
  cursor: pointer;
}
.chat-item:hover { background: var(--glass-1); }
.chat-item.is-on { background: var(--glass-2); }
.chat-avatar {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--accent-500));
  color: white; font-weight: 600;
  display:flex; align-items:center; justify-content:center;
  flex-shrink: 0;
}
.online-dot {
  position:absolute; bottom: 0; right: 0;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--green-500);
  border: 2px solid var(--bg-2);
}
.unread {
  background: var(--brand-500);
  color: white;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  font-weight: 600;
}

.chat-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-head { display:flex; gap: 12px; align-items: center; padding: 14px 20px; border-bottom: 0.5px solid var(--stroke-1); }
.thread-listing-pin {
  margin: 12px 20px;
  padding: 10px;
  display: flex; gap: 12px; align-items: center;
  border-radius: var(--r-md);
}
.pin-photo { width: 70px; height: 56px; border-radius: var(--r-sm); flex-shrink: 0; }
.thread-msgs { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.day-divider { display: flex; justify-content: center; margin: 8px 0; }
.day-divider span { font-size: 11px; color: var(--fg-faint); padding: 4px 12px; background: var(--glass-1); border-radius: var(--r-pill); }
.msg { max-width: 65%; display: flex; flex-direction: column; }
.msg-them { align-self: flex-start; align-items: flex-start; }
.msg-me   { align-self: flex-end;   align-items: flex-end; }
.msg-me .t-faint { text-align: right; }
.msg-bubble {
  display: inline-block;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-lg);
  font-size: 14px; line-height: 1.4;
  text-align: left;                  /* всегда слева, чтобы не было «пустоты» внутри bubble */
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;             /* сохраняем переносы строк, оборачиваем длинные слова */
}
.msg-them .msg-bubble {
  background: var(--glass-2);
  border: 0.5px solid var(--stroke-1);
  border-bottom-left-radius: 4px;
}
.msg-me .msg-bubble {
  background: var(--brand-500);
  color: white;
  border-bottom-right-radius: 4px;
}
.thread-input {
  display:flex; gap: 8px; align-items: center;
  padding: 12px 16px;
  border-top: 0.5px solid var(--stroke-1);
}

/* ── Compare ──────────────────────────────────────────────── */
.compare-head { display:flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; }
.compare-table { padding: 20px; border-radius: var(--r-xl); overflow-x: auto; }
.comp-grid { display: grid; gap: 0 16px; min-width: 800px; }
.comp-h-cell { padding-bottom: 16px; }
.comp-photo {
  aspect-ratio: 4/3;
  border-radius: var(--r-md);
  position: relative;
  cursor: pointer;
}
.comp-remove {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 0.5px solid rgba(255,255,255,0.2);
  color: white;
  display:flex; align-items:center; justify-content:center;
}
.comp-row-label {
  padding: 12px 0;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
  color: var(--fg-muted);
  border-top: 0.5px solid var(--stroke-1);
}
.comp-row-cell {
  padding: 12px 0;
  font-size: 14px; font-weight: 500;
  border-top: 0.5px solid var(--stroke-1);
  display: flex; align-items: center; gap: 8px;
}
.comp-row-cell.is-best { color: var(--green-500); font-weight: 600; }
.best-badge { color: var(--green-500); font-size: 12px; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .hero-deck { display: none; }
  .catalog { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .create-body { grid-template-columns: 1fr; }
  .create-preview { position: static; }
  .map-wrap { grid-template-columns: 1fr; height: auto; }
  .chat-grid { grid-template-columns: 280px 1fr; }
  .trust { grid-template-columns: 1fr; }
}
