/* ============================================================
   АвтоТочка 2.0 — премиальная дизайн-система
   Токены → светлая/тёмная темы → компоненты → адаптив
   ============================================================ */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/public/fonts/inter-cyrillic-400.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/public/fonts/inter-cyrillic-500.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/public/fonts/inter-cyrillic-600.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/public/fonts/inter-cyrillic-700.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('/public/fonts/inter-cyrillic-800.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/public/fonts/inter-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/public/fonts/inter-latin-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/public/fonts/inter-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/public/fonts/inter-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('/public/fonts/inter-latin-800.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; }

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  --bg: #f6f7f9;
  --bg-soft: #eef0f4;
  --card: #ffffff;
  --text: #0f1420;
  --text-2: #3d4657;
  --muted: #68718a;
  --line: #e6e9f0;
  --line-soft: #f0f2f6;

  --accent: #2450e0;
  --accent-hover: #1c41c0;
  --accent-soft: #edf1fe;
  --accent-ring: rgba(36, 80, 224, .28);
  --gold: #d99a06;
  --gold-soft: #fdf3dc;
  --green: #0c9d61;
  --green-soft: #e3f6ee;
  --red: #d92d20;
  --red-soft: #fdeceb;
  --warn: #b58103;
  --warn-soft: #fdf6e3;

  --r-xl: 20px; --r-lg: 16px; --r-md: 12px; --r-sm: 9px;
  --sh-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 12px rgba(16, 24, 40, .06);
  --sh-md: 0 2px 4px rgba(16, 24, 40, .05), 0 12px 28px rgba(16, 24, 40, .10);
  --sh-lg: 0 4px 8px rgba(16, 24, 40, .06), 0 20px 44px rgba(16, 24, 40, .16);
  --tr: .18s cubic-bezier(.4, 0, .2, 1);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    color-scheme: dark;
  }
}
html[data-theme='dark'] {
  color-scheme: dark;
    --bg: #0b0e14;
    --bg-soft: #10141c;
    --card: #151a23;
    --text: #eaedf3;
    --text-2: #c3c9d6;
    --muted: #8b93a7;
    --line: #242b38;
    --line-soft: #1c222d;
    --accent: #6d92f8;
    --accent-hover: #85a3fa;
    --accent-soft: #1b2440;
    --accent-ring: rgba(109, 146, 248, .35);
    --gold: #e8b431;
    --gold-soft: #2e2617;
    --green: #37c489;
    --green-soft: #12291f;
    --red: #f26557;
    --red-soft: #33201e;
    --warn: #e0ac3e;
    --warn-soft: #2e2612;
    --sh-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --sh-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 12px rgba(0, 0, 0, .35);
    --sh-md: 0 2px 4px rgba(0, 0, 0, .4), 0 12px 28px rgba(0, 0, 0, .5);
    --sh-lg: 0 4px 8px rgba(0, 0, 0, .45), 0 20px 44px rgba(0, 0, 0, .6);
}

/* ---------- база ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 15px/1.55 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent-ring); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

h1, h2, h3 { letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(24px, 3vw, 32px); margin: 14px 0 16px; }
h2 { font-size: clamp(18px, 2.2vw, 21px); margin: 0 0 14px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 clamp(14px, 2.5vw, 24px); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.link { color: var(--accent); font-weight: 500; }
.link:hover { text-decoration: underline; }
.txt-green { color: var(--green); }
.txt-red { color: var(--red); }
.txt-warn { color: var(--warn); }
.empty { background: var(--card); border-radius: var(--r-lg); padding: clamp(28px, 5vw, 48px); text-align: center; color: var(--muted); box-shadow: var(--sh-xs); }
.notice { border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 18px; font-weight: 500; border: 1px solid transparent; }
.notice-ok { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.notice-err { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.notice-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.breadcrumbs { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 16px; }
.breadcrumbs a:hover { color: var(--accent); }

/* ---------- шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  border-bottom: 1px solid var(--line-soft);
}
.header-in { display: flex; align-items: center; gap: clamp(10px, 2vw, 28px); height: 64px; }
.logo { display: flex; align-items: center; gap: 9px; font-size: 20px; letter-spacing: -.03em; font-weight: 500; white-space: nowrap; }
.logo b { color: var(--accent); font-weight: 800; }
.logo:hover svg { transform: rotate(90deg); }
.logo svg { transition: transform var(--tr); }
.logo-footer { font-size: 18px; margin-bottom: 8px; }
.nav { display: flex; gap: 2px; margin-right: auto; }
.nav a { padding: 9px 13px; border-radius: var(--r-sm); font-weight: 550; font-size: 14px; color: var(--text-2); transition: var(--tr); }
.nav a:hover { background: var(--accent-soft); color: var(--accent); }
.nav a.on { color: var(--accent); background: var(--accent-soft); }
.header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.user-menu { display: flex; align-items: center; gap: 6px; }
.user-name { font-weight: 650; color: var(--text-2); padding: 8px 10px; border-radius: var(--r-sm); max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-name:hover, .user-name.on { color: var(--accent); background: var(--accent-soft); }
.icon-link { position: relative; padding: 9px; border-radius: var(--r-sm); font-size: 17px; line-height: 1; color: var(--text-2); transition: var(--tr); }
.icon-link:hover, .icon-link.on { background: var(--accent-soft); }
.icon-btn { width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); font-size: 16px; line-height: 1; cursor: pointer; transition: var(--tr); }
.icon-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.fav-badge { display: inline-block; min-width: 19px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; text-align: center; line-height: 19px; vertical-align: 2px; }
.inline-form { display: inline; }
.burger { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); cursor: pointer; padding: 0 10px; flex-direction: column; justify-content: center; gap: 5px; }
.burger span { display: block; height: 2px; border-radius: 2px; background: var(--text-2); transition: var(--tr); }
.mobile-panel { display: none; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 10px 18px; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: var(--tr); background: none; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(180deg, #3d67f0, var(--accent)); color: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.12), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-primary:hover { background: linear-gradient(180deg, var(--accent-hover), var(--accent-hover)); box-shadow: var(--sh-sm); }
.btn-outline { border-color: var(--line); background: var(--card); color: var(--text-2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-soft); }
.btn-lg { padding: 13px 26px; font-size: 15.5px; border-radius: var(--r-md); }
.btn-block { width: 100%; }

/* ---------- формы ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: .01em; }
input, select, textarea {
  font: inherit; font-weight: 500; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--card); color: var(--text); width: 100%;
  transition: border-color var(--tr), box-shadow var(--tr);
}
input::placeholder { color: var(--muted); font-weight: 400; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { flex-direction: row; align-items: center; gap: 9px; color: var(--text); font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.profile-form { display: flex; flex-direction: column; gap: 12px; }

/* ---------- главная / hero ---------- */
.hero {
  color: #fff;
  padding: clamp(40px, 7vw, 76px) 0 clamp(48px, 7vw, 84px);
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(93, 140, 255, .5), transparent 60%),
    radial-gradient(700px 380px at 88% 8%, rgba(56, 88, 214, .45), transparent 60%),
    linear-gradient(128deg, #0a1128 0%, #14275e 52%, #1d3d8f 100%);
}
.hero-in { max-width: 920px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: clamp(28px, 4.6vw, 44px); font-weight: 800; letter-spacing: -.035em; margin: 0 0 10px; }
.hero-sub { opacity: .82; margin: 0 0 28px; font-size: clamp(15px, 1.6vw, 17.5px); }
.search-card {
  background: var(--card); color: var(--text);
  border-radius: var(--r-xl); padding: clamp(16px, 2.5vw, 22px);
  box-shadow: var(--sh-lg);
  display: flex; flex-direction: column; gap: 15px;
}
.search-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }

.section { margin: clamp(28px, 4vw, 44px) 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.brand-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.brand-chip {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 17px; font-weight: 600; font-size: 14px;
  box-shadow: var(--sh-xs); transition: var(--tr);
}
.brand-chip b { color: var(--muted); font-weight: 550; font-size: 12.5px; background: var(--bg-soft); border-radius: 999px; padding: 1px 8px; }
.brand-chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); box-shadow: var(--sh-sm); }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how-card { background: var(--card); border-radius: var(--r-lg); padding: clamp(18px, 2vw, 24px); box-shadow: var(--sh-sm); border: 1px solid var(--line-soft); }
.how-num { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 13px; font-size: 16px; }
.how-card p { color: var(--muted); margin: 0; font-size: 14px; }

/* ---------- карточки объявлений ---------- */
.listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(230px, 24vw, 264px), 1fr)); gap: clamp(12px, 1.6vw, 18px); }
.card {
  background: var(--card); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--sh-sm); border: 1px solid var(--line-soft);
  transition: transform var(--tr), box-shadow var(--tr);
  display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--sh-md); transform: translateY(-3px); }
.card-img { position: relative; aspect-ratio: 4/3; background: var(--bg-soft); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s cubic-bezier(.2, .6, .2, 1); }
.card:hover .card-img img { transform: scale(1.045); }
.badge {
  position: absolute; left: 10px; top: 10px; border-radius: 7px; padding: 4px 9px;
  font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.badge-new { top: 10px; background: var(--green-soft); color: var(--green); }
.badge-new { background: color-mix(in srgb, var(--green) 88%, #000 0%); color: #fff; }
.badge-vip { background: linear-gradient(120deg, #f7bd2c, #e09a05); color: #33230a; box-shadow: 0 2px 8px rgba(224, 154, 5, .4); }
.badge-xl { background: color-mix(in srgb, var(--accent) 92%, #000); color: #fff; }
.badge-dealer { background: rgba(18, 20, 26, .82); color: #ffd766; right: 84px; left: auto; top: 10px; }
.badge-market { top: 44px; background: color-mix(in srgb, var(--card) 82%, transparent); color: var(--text-2); }
.badge-market.low { background: color-mix(in srgb, var(--green) 16%, var(--card) 84%); color: var(--green); }
.badge-market.high { background: color-mix(in srgb, var(--red) 14%, var(--card) 86%); color: var(--red); }
.badge-market.mid { background: color-mix(in srgb, var(--card) 82%, transparent); color: var(--muted); }
.fav-btn, .cmp-btn {
  position: absolute; top: 9px; width: 35px; height: 35px; border-radius: 11px; border: none;
  background: color-mix(in srgb, var(--card) 88%, transparent); color: var(--muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: var(--tr); font-size: 15px;
}
.fav-btn { right: 9px; }
.cmp-btn { right: 50px; }
.fav-btn svg { fill: currentColor; }
.fav-btn:hover { color: #e0245e; transform: scale(1.06); }
.fav-btn.on { color: #e0245e; }
.cmp-btn:hover { color: var(--accent); transform: scale(1.06); }
.cmp-btn.on { background: var(--accent); color: #fff; }
.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 4px; }
.card-price { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.card-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.card-specs { color: var(--muted); font-size: 13px; }
.card-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; margin-top: 7px; }
.price-drop { color: var(--green); font-weight: 650; font-size: 13px; }
.side-price + .price-drop { font-size: 14px; margin-bottom: 2px; }

/* ---------- каталог ---------- */
.catalog-layout { display: grid; grid-template-columns: 288px 1fr; gap: clamp(14px, 1.8vw, 22px); align-items: start; }
.filters {
  background: var(--card); border-radius: var(--r-lg); padding: 18px;
  position: sticky; top: 80px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--sh-sm); border: 1px solid var(--line-soft);
  max-height: calc(100vh - 96px); overflow-y: auto;
}
.filter-actions { display: flex; gap: 10px; margin-top: 4px; }
.results-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.sort-form label { flex-direction: row; align-items: center; gap: 8px; }
.sort-form select { width: auto; font-weight: 550; }
.pagination { display: flex; gap: 6px; justify-content: center; margin: 28px 0 10px; flex-wrap: wrap; }
.pagination a, .pagination b { padding: 9px 14px; border-radius: var(--r-sm); background: var(--card); box-shadow: var(--sh-xs); font-weight: 600; font-size: 14px; border: 1px solid var(--line-soft); transition: var(--tr); }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination b { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination span { align-self: end; color: var(--muted); }

/* ---------- объявление ---------- */
.listing-head h1 { margin-bottom: 3px; }
.listing-meta { font-size: 13px; }
.listing-layout { display: grid; grid-template-columns: 1fr 348px; gap: clamp(14px, 1.8vw, 22px); align-items: start; }
.gallery-main { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--r-lg); background: var(--bg-soft); }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 9px; overflow-x: auto; padding-bottom: 4px; }
.thumb { flex: 0 0 92px; border: 2px solid transparent; border-radius: var(--r-sm); overflow: hidden; padding: 0; cursor: pointer; background: none; transition: var(--tr); }
.thumb img { width: 92px; height: 68px; object-fit: cover; }
.thumb:hover { border-color: var(--line); }
.thumb.on { border-color: var(--accent); }
.block { background: var(--card); border-radius: var(--r-lg); padding: clamp(16px, 2vw, 22px); margin-top: 16px; box-shadow: var(--sh-sm); border: 1px solid var(--line-soft); }
.specs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 26px; }
.spec { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.spec span { color: var(--muted); }
.spec b { font-weight: 600; text-align: right; }
.desc { white-space: pre-line; margin: 0; color: var(--text-2); }
.side-card { background: var(--card); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-sm); border: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 12px; }
.listing-side > .side-card:first-child { position: sticky; top: 80px; }
.side-price { font-size: 29px; font-weight: 800; letter-spacing: -.03em; }
.market-line { font-size: 14px; }
.phone-reveal { text-align: center; font-size: 18px; font-weight: 700; letter-spacing: .04em; }
.seller-card h3 { margin: 0; }
.seller-type { color: var(--accent); font-weight: 650; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.seller-name { font-size: 17px; font-weight: 650; }
.owner-panel .btn-block { margin-top: 8px; }
.boost-box { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: 4px; }

/* ---------- формы подачи/жалобы ---------- */
.create-form .block { display: flex; flex-direction: column; gap: 12px; }
.vin-row { flex-direction: row; align-items: center; gap: 12px; }
.vin-controls { display: flex; gap: 8px; flex: 1; }
.vin-controls input { text-transform: uppercase; font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 1.5px; font-size: 14px; }
.vin-result { min-height: 18px; }
.vin-result ul { margin: 6px 0; padding-left: 20px; }
.previews { display: flex; flex-wrap: wrap; gap: 10px; }
.preview { position: relative; width: 112px; height: 84px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview button { position: absolute; top: 5px; right: 5px; width: 23px; height: 23px; border-radius: 8px; border: none; background: rgba(10, 12, 18, .65); color: #fff; cursor: pointer; font-size: 12px; transition: var(--tr); }
.preview button:hover { background: var(--red); }
.form-actions { display: flex; align-items: center; gap: 16px; margin: 22px 0 44px; flex-wrap: wrap; }
.complaint-form .block { max-width: 640px; }

/* ---------- кабинет ---------- */
.tab-bar { display: flex; gap: 7px; margin: 16px 0; flex-wrap: wrap; }
.tab { padding: 10px 17px; border-radius: 11px; background: var(--card); box-shadow: var(--sh-xs); border: 1px solid var(--line-soft); font-weight: 600; font-size: 14px; color: var(--text-2); transition: var(--tr); }
.tab:hover { color: var(--accent); border-color: var(--accent); }
.tab.on { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 4px 14px var(--accent-ring); }
.account-summary, .dealer-stats { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.my-listing-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.my-listing-link { font-weight: 600; min-width: 200px; flex: 1; }
.my-listing-link:hover { color: var(--accent); }
.my-listing-price { font-weight: 750; min-width: 100px; letter-spacing: -.01em; }
.my-listing-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.my-listing-actions .btn { padding: 7px 13px; font-size: 13px; }
.wallet-summary { margin-bottom: 18px; }
.wallet-balance { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.wallet-balance span { font-size: 15px; color: var(--muted); font-weight: 500; }

/* ---------- чат / уведомления / диалоги ---------- */
.dialogs { display: flex; flex-direction: column; gap: 10px; }
.dialog-row, .notif-row { background: var(--card); border-radius: var(--r-md); padding: 15px 18px; box-shadow: var(--sh-xs); border: 1px solid var(--line-soft); transition: var(--tr); }
.dialog-row:hover, .notif-row:hover { box-shadow: var(--sh-sm); }
.dialog-row.unread, .notif-row.unread { border-left: 3px solid var(--accent); }
.dialog-title { font-weight: 700; }
.dialog-preview { font-size: 13px; margin-top: 3px; }
.notif-row { display: flex; gap: 13px; align-items: flex-start; }
.notif-icon { font-size: 20px; }
.notif-body { font-weight: 600; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 0 0 var(--r-sm) 0; font-weight: 600; }
.skip-link:focus { left: 0; }
.view-chart { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.view-chart-row { display: grid; grid-template-columns: minmax(90px, 200px) 1fr 46px; gap: 10px; align-items: center; font-size: 13px; }
.view-chart-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.view-chart-bar { height: 10px; border-radius: 5px; background: var(--accent-soft); overflow: hidden; }
.view-chart-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); min-width: 2px; }
.view-chart-num { text-align: right; color: var(--muted); font-weight: 600; }
.chat-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.chat-listing { display: flex; align-items: center; gap: 11px; background: var(--card); border-radius: var(--r-md); padding: 9px 13px; box-shadow: var(--sh-xs); border: 1px solid var(--line-soft); font-weight: 600; }
.chat-listing img { width: 74px; height: 55px; object-fit: cover; border-radius: 7px; }
.chat-box { background: var(--bg-soft); border-radius: var(--r-lg); border: 1px solid var(--line-soft); height: min(52vh, 440px); overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; margin: 14px 0 10px; }
.chat-empty { margin: auto; }
.msg { max-width: 72%; }
.msg.mine { align-self: flex-end; }
.msg-body { background: var(--card); padding: 11px 15px; border-radius: 16px 16px 16px 5px; white-space: pre-line; word-break: break-word; box-shadow: var(--sh-xs); font-weight: 500; }
.msg.mine .msg-body { background: linear-gradient(180deg, #3d67f0, var(--accent)); color: #fff; border-radius: 16px 16px 5px 16px; }
.msg-time { margin-top: 3px; font-size: 11.5px; }
.chat-form { display: flex; gap: 10px; }
.chat-form input { flex: 1; }

/* ---------- сравнение ---------- */
.compare-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.compare-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-sm); border: 1px solid var(--line-soft); }
.compare-table th, .compare-table td { padding: 11px 15px; border-bottom: 1px solid var(--line-soft); text-align: left; min-width: 92px; font-size: 14px; }
.compare-table th { vertical-align: bottom; background: var(--bg-soft); }
.compare-table th img { width: 140px; height: 100px; object-fit: cover; border-radius: var(--r-sm); margin-bottom: 7px; }
.compare-table th a { display: block; font-size: 13px; max-width: 150px; font-weight: 600; }
.compare-table th a:hover { color: var(--accent); }
.cmp-name { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- марки / витрина ---------- */
.brands-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.brand-tile { background: var(--card); border-radius: var(--r-lg); padding: 17px; box-shadow: var(--sh-xs); border: 1px solid var(--line-soft); transition: var(--tr); }
.brand-tile:hover { box-shadow: var(--sh-sm); color: var(--accent); transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.brand-tile-name { font-weight: 750; font-size: 16px; letter-spacing: -.01em; }
.brand-tile-cnt { color: var(--accent); font-weight: 650; margin-top: 7px; font-size: 14px; }
.dealer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.dealer-head h1 { margin: 0 0 5px; }

/* ---------- VIN-отчёт ---------- */
.vin-form { display: flex; gap: 12px; align-items: flex-end; max-width: 640px; margin-bottom: 20px; flex-wrap: wrap; }
.vin-form input { text-transform: uppercase; font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 1.5px; }
.vin-form label { flex: 1; min-width: 220px; }
.report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.report-stat { background: var(--bg-soft); border-radius: var(--r-md); padding: 13px 15px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; border: 1px solid var(--line-soft); }
.report-stat b { font-size: 17px; letter-spacing: -.01em; }

/* ---------- авторизация ---------- */
.auth-wrap { display: flex; justify-content: center; padding: clamp(24px, 6vw, 56px) 0; }
.auth-card { width: 100%; max-width: 430px; background: var(--card); border-radius: var(--r-xl); box-shadow: var(--sh-md); padding: clamp(22px, 3vw, 30px); border: 1px solid var(--line-soft); }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.demo-creds { border-top: 1px solid var(--line-soft); padding-top: 13px; line-height: 1.75; }

/* ---------- админка / таблицы ---------- */
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--r-md); box-shadow: var(--sh-xs); border: 1px solid var(--line-soft); font-size: 14px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); }
.admin-table th, .admin-table td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.admin-table th { background: var(--bg-soft); font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.admin-table tr:hover td { background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.admin-actions { white-space: nowrap; }

/* ---------- подвал ---------- */
.footer { background: #0c0f16; color: #c6ccd8; margin-top: clamp(36px, 6vw, 64px); padding: clamp(28px, 4vw, 40px) 0 26px; }
.footer h4 { margin: 0 0 11px; color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .07em; }
.footer a { display: block; margin-bottom: 7px; color: #c6ccd8; font-size: 14px; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: clamp(20px, 3vw, 36px); }
.copy { color: #78808f; font-size: 13px; margin-top: 30px; border-top: 1px solid #1c212c; padding-top: 18px; }

/* ---------- тосты ---------- */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; padding: 0 14px; width: 100%; max-width: 420px; }
.toast { background: #171b24; color: #fff; border-radius: 12px; padding: 12px 18px; font-weight: 600; font-size: 14px; box-shadow: var(--sh-lg); animation: toast-in .25s cubic-bezier(.2, .8, .3, 1.2); max-width: 100%; text-align: center; }
.toast.ok { background: linear-gradient(180deg, #17a56b, #0c8a59); }
.toast.err { background: linear-gradient(180deg, #e04b3e, #c22818); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

/* ============================================================
   АДАПТИВ: десктоп ≥1024 → планшет 768–1023 → мобайл <768
   ============================================================ */
@media (max-width: 1023px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; overflow: visible; }
  .listing-layout { grid-template-columns: 1fr; }
  .listing-side > .side-card:first-child { position: static; }
  .search-grid { grid-template-columns: repeat(3, 1fr); }
  .how-grid { grid-template-columns: 1fr 1fr; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .specs-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 899px) {
  .nav { display: none; }
  .burger { display: flex; }
  .user-name { display: none; }
  .header-right .btn-ghost { display: none; }
  .header-right > .btn-primary { padding: 10px 14px; font-size: 13.5px; }
  .mobile-panel {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--card); border-bottom: 1px solid var(--line);
    box-shadow: var(--sh-md); padding: 10px 16px 16px;
    flex-direction: column; gap: 2px;
  }
  .header.menu-open .mobile-panel { display: flex; animation: toast-in .18s ease-out; }
  .mobile-panel a { padding: 13px 12px; border-radius: var(--r-sm); font-weight: 600; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; }
  .mobile-panel a:hover, .mobile-panel a.on { background: var(--accent-soft); color: var(--accent); }
  .mobile-panel form { padding: 0 12px; }
  .header.menu-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .header.menu-open .burger span:nth-child(2) { opacity: 0; }
  .header.menu-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 767px) {
  .search-grid, .row2 { grid-template-columns: 1fr; }
  .row3 { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 30px; }
  .search-card button[type="submit"] { width: 100%; }
  .btn-lg { padding: 13px 20px; font-size: 15px; }
  .card-price { font-size: 18px; }
  .specs-grid { grid-template-columns: 1fr; }
  .my-listing-actions { margin-left: 0; width: 100%; }
  .my-listing-actions .btn { flex: 1; }
  .msg { max-width: 86%; }
  .compare-table th img { width: 110px; height: 80px; }
  .pagination a, .pagination b { padding: 11px 15px; }
  .results-bar { font-size: 14px; }
  .btn { min-height: 44px; }
  .fav-btn, .cmp-btn { width: 38px; height: 38px; }
  .badge-dealer { right: 94px; }
  /* iOS/Android: поля ≥16px не дают автозуму при фокусе */
  input, select, textarea { font-size: 16px; }
  .view-chart-row { grid-template-columns: minmax(70px, 1fr) 1fr 40px; font-size: 12px; gap: 8px; }
  .compare-table th a { max-width: 110px; }
  .compare-table th, .compare-table td { min-width: 78px; padding: 9px 11px; }
}

@media (max-width: 374px) {
  .header-right > .btn-primary { display: none; }
  .listings-grid { grid-template-columns: 1fr; }
  .brand-chip { font-size: 13px; padding: 8px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- печать ---------- */
@media print {
  .header, .footer, .fav-btn, .cmp-btn, .pagination, .filters { display: none !important; }
  body { background: #fff; }
  .block, .side-card, .card { box-shadow: none; border: 1px solid #ddd; }
}
