/* ============================================================
   AUTOMOST — Base & shared component styles
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { min-height: 100vh; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); }

/* keyboard focus ring (a11y) — mouse users never see it */
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 5px; }
button:focus-visible, a:focus-visible { position: relative; z-index: 1; }

/* scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* ---- Typography helpers ---- */
.display { font-size: clamp(40px, 5.2vw, 70px); line-height: 0.98; font-weight: 800; letter-spacing: -0.035em; color: var(--ink-0); }
.h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.04; font-weight: 800; letter-spacing: -0.03em; color: var(--ink-0); }
.h2 { font-size: 28px; line-height: 1.12; font-weight: 800; letter-spacing: -0.022em; color: var(--ink-0); }
.h3 { font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); white-space: nowrap;
}
.eyebrow::before {
  content: ""; width: 18px; height: 1.5px; background: var(--accent); border-radius: 5px; flex: none;
}
.lead { font-size: 18px; line-height: 1.5; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 22px;
  border-radius: 5px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary { background: var(--accent); color: white; box-shadow: var(--sh-accent); }
.btn-primary:hover { background: var(--accent-press); transform: translateY(-1px); }

.btn-dark { background: var(--ink); color: white; }
.btn-dark:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }

.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink-4); }

.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover { background: var(--accent-softer); }

.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-xs { height: 34px; padding: 0 13px; font-size: 13px; gap: 7px; }
.btn-xs svg { width: 15px; height: 15px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; }
.btn-icon { width: 46px; padding: 0; border-radius: 5px; }
.btn-icon.btn-sm { width: 38px; }
.btn-icon.btn-xs { width: 34px; }
.btn-block { width: 100%; }

/* ============================================================
   Chips / pills / badges
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border-radius: 5px;
  background: var(--surface); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px; font-weight: 600;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.chip:hover { box-shadow: inset 0 0 0 1px var(--ink-4); color: var(--ink); }
.chip.active { background: var(--ink); color: white; box-shadow: none; }
.chip svg { width: 16px; height: 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px;
  border-radius: 5px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.01em;
}
.badge svg { width: 13px; height: 13px; }
.badge-premium { background: var(--gold-soft); color: var(--gold-ink); }
.badge-trust { background: var(--trust-soft); color: var(--trust-ink); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge-new { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }

/* ============================================================
   Card
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 1px 2px oklch(0.4 0.03 283 / 0.03);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

/* ---- Photo placeholder (no real images) ---- */
.photo {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, oklch(0.95 0.01 255) 0 14px, oklch(0.93 0.012 255) 14px 28px);
  display: flex; align-items: flex-end;
}
.photo .photo-tag {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); white-space: nowrap;
  background: oklch(1 0 0 / 0.82); backdrop-filter: blur(4px);
  padding: 4px 9px; border-radius: 5px; margin: 10px;
  letter-spacing: 0.02em;
}
.photo .photo-glyph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: oklch(0.78 0.01 255);
}
.photo .photo-glyph svg { width: 40px; height: 40px; }
/* real photo fades in over the gradient placeholder once it truly loads —
   a broken/slow image never flashes its alt text */
.photo > img { transition: opacity .35s var(--ease); }

/* gallery prev/next arrows — float outside the scaled image, stay tappable */
.gal-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 42px; height: 42px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  background: oklch(1 0 0 / 0.92); color: var(--ink); backdrop-filter: blur(6px);
  box-shadow: var(--sh-2); transition: background .18s var(--ease), transform .18s var(--ease);
}
.gal-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.gal-arrow:active { transform: translateY(-50%) scale(0.96); }

/* ============================================================
   Reliability meter — the gamified deal-trust system
   ============================================================ */
.reliability {
  background: var(--surface);
  border-radius: 5px;
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.rel-head { padding: 20px 22px 16px; }
.rel-track {
  height: 10px; border-radius: 5px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden; position: relative;
}
.rel-fill {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--trust), oklch(0.7 0.15 165));
  transition: width 0.9s var(--ease-out);
  position: relative;
}
.rel-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, oklch(1 0 0 / 0.45), transparent);
  transform: translateX(-100%);
  animation: relshine 2.6s var(--ease) infinite;
}
@keyframes relshine { 0% { transform: translateX(-100%); } 60%,100% { transform: translateX(220%); } }

.rel-step {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  border-top: 1px solid var(--line-2);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.rel-step:hover { background: var(--surface-2); }
.rel-check {
  width: 26px; height: 26px; border-radius: 5px; flex: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: all var(--dur) var(--ease);
}
.rel-check svg { width: 14px; height: 14px; opacity: 0; transform: scale(0.5); transition: all var(--dur) var(--ease); }
.rel-step.done .rel-check { background: var(--trust); box-shadow: none; color: white; }
.rel-step.done .rel-check svg { opacity: 1; transform: scale(1); }
.rel-step.done .rel-label { color: var(--ink-3); }

/* ============================================================
   Inputs
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: -0.01em; }
.input, .select, .textarea {
  height: 48px; padding: 0 15px;
  border-radius: 5px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px; color: var(--ink);
  transition: box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
  width: 100%;
}
.textarea { height: auto; padding: 13px 15px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface);
}
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8499' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
  padding-right: 40px;
}

/* ============================================================
   Misc utility & animation
   ============================================================ */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.gap-6 { gap: 6px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; } .gap-18 { gap: 18px; } .gap-20 { gap: 20px; }
.spread { justify-content: space-between; }
.center { align-items: center; justify-content: center; }
.grow { flex: 1; }
.hidden { display: none !important; }
[data-noscore] .card-rel, [data-noscore] .card-trust { display: none; }

/* ---- Card trust strip: three honest axes (авто / продавец / сделка) ---- */
.card-trust { flex: none; }
.ct-dot {
  width: 26px; height: 26px; border-radius: 5px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink-4);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.ct-dot.on { background: var(--trust-soft); color: var(--trust-ink); box-shadow: inset 0 0 0 1px oklch(0.62 0.14 158 / 0.22); }

/* ---- Listing: location map placeholder ---- */
.loc-map {
  position: relative; height: 168px; overflow: hidden;
  background:
    radial-gradient(circle at 64% 42%, oklch(0.95 0.045 18 / 0.5), transparent 60%),
    linear-gradient(160deg, oklch(0.965 0.008 200), oklch(0.94 0.012 230));
}
.loc-map-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(oklch(0.4 0.03 250 / 0.06) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0.4 0.03 250 / 0.06) 1px, transparent 1px);
  background-size: 30px 30px;
}
.loc-pin {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 5px; rotate: -45deg;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; box-shadow: var(--sh-2);
}
.loc-pin svg { rotate: 45deg; }
.loc-map-note {
  position: absolute; right: 10px; bottom: 9px;
  font-size: 11px; color: var(--ink-3);
  background: oklch(1 0 0 / 0.82); backdrop-filter: blur(4px);
  padding: 3px 8px; border-radius: 5px;
}
.buyer-action { transition: background .16s var(--ease); }
.buyer-action:hover { background: var(--surface-2); }

/* ---- Dealer workspace ---- */
.dealer-funnel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dealer-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.dealer-tool { display: flex; flex-direction: column; align-items: flex-start; text-align: left; cursor: pointer; }
.dealer-tool:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.dealer-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) {
  .dealer-funnel { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
  .dealer-tools, .dealer-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .dealer-tools, .dealer-stats { grid-template-columns: 1fr; }
}

/* ---- Cabinets v2 (review fixes U1–U5, D1–D5) ---- */

/* account switcher + menu */
.acct-btn { background: var(--surface) !important; }
.acct-item:hover { background: var(--surface-2); }

/* user: verified facts */
.facts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .facts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .facts-grid { grid-template-columns: 1fr; } }

/* user: buying tab grids */
.saved-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.saved-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.deal-doc:hover { background: var(--surface-3, var(--surface-2)); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 880px) { .saved-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .saved-grid { grid-template-columns: 1fr; } }
.garage-tabs, .dealer-subnav { overflow-x: auto; scrollbar-width: none; }
.garage-tabs::-webkit-scrollbar, .dealer-subnav::-webkit-scrollbar { display: none; }

/* dealer overview two-column */
.dealer-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mgr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .dealer-2col, .mgr-grid { grid-template-columns: 1fr; } }
.health-row:hover { background: var(--surface-3, oklch(0.95 0.005 285)) !important; }

/* dealer CRM */
.dot-stage { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.crm-board { display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.crm-col { background: var(--surface-2); border-radius: 10px; padding: 10px; min-width: 190px; }
.crm-col-head { margin-bottom: 10px; padding: 2px 4px; }
.crm-card { box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 10px; }
.crm-card-wide { max-width: none; }
.crm-empty { text-align: center; color: var(--ink-4); font-size: 12.5px; padding: 18px 0; }
@media (max-width: 1040px) { .crm-board { grid-template-columns: repeat(5, 200px); } }

/* dealer inventory table */
.dealer-select { height: 38px; border-radius: 5px; border: none; background: var(--surface-2); padding: 0 12px; font-size: 13.5px; font-weight: 600; font-family: inherit; color: var(--ink-0); cursor: pointer; }
.inv-table { width: 100%; }
.inv-row { display: grid; grid-template-columns: 40px minmax(0, 2.4fr) 1.1fr 1fr 0.6fr 0.8fr 0.6fr 0.9fr 0.9fr; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.inv-row:last-child { border-bottom: none; }
.inv-head { background: var(--surface-2); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); padding: 11px 16px; }
.inv-row:not(.inv-head):hover { background: var(--surface-2); }
.inv-sel { background: var(--accent-softer) !important; }
.inv-num { text-align: right; }
.inv-check { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.inv-check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.inv-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.inv-flag.warn { background: var(--gold-soft); color: var(--gold-ink); }
.inv-flag.bad  { background: var(--accent-soft); color: var(--accent-ink); }
.inv-flag.gold { background: var(--gold-soft); color: var(--gold-ink); }
@media (max-width: 860px) {
  .inv-row { grid-template-columns: 36px minmax(0, 2.2fr) 1fr 0.6fr 0.6fr 0.8fr; gap: 8px; padding: 10px 12px; }
  .inv-hide { display: none !important; }
}

/* dealer billing */
.bill-top { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.bill-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bill-roi { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface-2); border-radius: 8px; padding: 14px 16px; }
.bill-roi-step { display: flex; flex-direction: column; gap: 1px; }
.bill-roi-step .num { font-weight: 800; font-size: 18px; }
.bill-roi-step .muted { font-size: 11.5px; }
.bill-kpi { flex: 1 1 130px; background: var(--surface-2); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 1px; }
.bill-kpi .num { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.bill-kpi .muted { font-size: 12px; }
@media (max-width: 820px) { .bill-top, .bill-cols { grid-template-columns: 1fr; } }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* Reveal animation must never gate visibility: base state is fully visible.
   The entrance only plays when motion is allowed, so reduced-motion / stalled
   environments always see the content (esp. the primary search). */
.fade-up { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .fade-up { animation: fadeUp 0.5s var(--ease-out) both; }
}

/* Lift the profile header above later cards while the account dropdown is open,
   so the menu never gets painted under the facts/privacy cards below it. */
.garage-head { position: relative; }
.garage-head:has(.acct-menu) { z-index: 40; }

@keyframes pop { 0% { transform: scale(0.7); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.pop { animation: pop 0.4s var(--ease) both; }

.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--line-2) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: 5px; }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ============================================================
   Feed: auto-load / show-more controls
   ============================================================ */
.am-spin { width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2.5px solid var(--line); border-top-color: var(--accent);
  animation: amspin 0.7s linear infinite; }
@keyframes amspin { to { transform: rotate(360deg); } }

.feed-bar { display: flex; flex-direction: column; align-items: center; gap: 16px;
  margin-top: 30px; padding-top: 4px; }
.feed-meter { width: 100%; max-width: 320px; }
.feed-track { height: 5px; width: 100%; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.feed-fill { height: 100%; border-radius: 5px; background: var(--accent);
  transition: width 0.5s var(--ease-out); }
.feed-skel-card { border-radius: 5px; overflow: hidden; box-shadow: var(--sh-1);
  background: var(--surface-0, #fff); }
.feed-skel-card .skel { border-radius: 5px; }

.feed-top { position: fixed; right: 22px; bottom: 22px; z-index: 70;
  width: 50px; height: 50px; border-radius: 5px; display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff; box-shadow: var(--sh-3);
  opacity: 0; transform: translateY(12px) scale(0.9); pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease); }
.feed-top.on { opacity: 1; transform: none; pointer-events: auto; }
.feed-top:hover { transform: translateY(-2px); }

/* ============================================================
   Hero search — lightweight, filled/borderless system
   ============================================================ */
.hero-search {
  border: none !important;
  box-shadow: 0 1px 2px oklch(0.4 0.03 283 / 0.05), 0 16px 44px oklch(0.36 0.03 283 / 0.09) !important;
  padding: 10px 22px 18px !important;
}
/* filled, borderless fields — shared by the hero search and other page forms */
.hero-search .input,
.hero-search .select,
.form-soft .input,
.form-soft .select,
.form-soft .textarea {
  background-color: var(--surface-2);
  border: none;
  box-shadow: none;
}
.hero-search .input,
.hero-search .select { height: 50px; }
.hero-search .input,
.hero-search .select,
.form-soft .input,
.form-soft .select { font-weight: 600; }
.hero-search .input::placeholder,
.form-soft .input::placeholder,
.form-soft .textarea::placeholder { color: var(--ink-4); font-weight: 500; }
.hero-search .input:hover,
.hero-search .select:hover,
.form-soft .input:hover,
.form-soft .select:hover,
.form-soft .textarea:hover { background-color: oklch(0.955 0.006 283); }
.hero-search .input:focus,
.hero-search .select:focus,
.form-soft .input:focus,
.form-soft .select:focus,
.form-soft .textarea:focus { background-color: var(--surface); box-shadow: inset 0 0 0 1.6px var(--accent); }
.hero-search .field > label,
.form-soft .field > label {
  font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: 0;
}
/* free-text search bar inside the main filter */
.hs-q-wrap {
  display: flex; align-items: center; gap: 11px;
  height: 52px; padding: 0 7px 0 16px;
  background: var(--surface); border-radius: 11px;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background .18s var(--ease), box-shadow .18s var(--ease);
}
.hs-q-wrap:hover { box-shadow: inset 0 0 0 1px var(--ink-4); }
.hs-q-wrap.focus { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.hs-q-ico { color: var(--ink-4); flex: none; transition: color .18s var(--ease); }
.hs-q-wrap.focus .hs-q-ico { color: var(--ink-2); }
.hs-q-input {
  flex: 1; min-width: 0; height: 100%; border: none; background: none; outline: none;
  font-size: 15.5px; font-weight: 600; color: var(--ink-0); letter-spacing: -0.01em;
}
.hs-q-input::placeholder { color: var(--ink-4); font-weight: 500; }
.hs-q-input:focus-visible { outline: none; box-shadow: none; }
.hs-q-clear {
  flex: none; width: 30px; height: 30px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-4); transition: background .15s var(--ease), color .15s var(--ease);
}
.hs-q-clear:hover { background: var(--surface-2); color: var(--ink-2); }
.hs-q-go { flex: none; height: 40px; padding: 0 20px; font-size: 14.5px; }
/* suggestions dropdown */
.hs-q-menu {
  position: absolute; left: 4px; right: 4px; top: calc(100% - 4px); z-index: 40;
  padding: 6px; box-shadow: var(--sh-3);
  animation: pop .18s var(--ease) both;
}
.hs-q-sec { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); padding: 8px 10px 5px; }
.hs-q-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 10px; border-radius: 8px; font-size: 14.5px; font-weight: 600; color: var(--ink-1, var(--ink));
  transition: background .14s var(--ease);
}
.hs-q-item:hover { background: var(--surface-2); }
.hs-q-item-ico { width: 28px; height: 28px; border-radius: 5px; flex: none; background: var(--surface-2); color: var(--accent-ink); }
.hs-q-item:hover .hs-q-item-ico { background: var(--accent-softer); }
.hs-q-item-tag { flex: none; font-size: 11.5px; font-weight: 700; color: var(--ink-4); }
@media (max-width: 560px) {
  .hs-q-go { padding: 0 14px; }
  .hs-q-input { font-size: 15px; }
}

/* category tabs (replace outlined chips) */
.hs-tabrow { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.hs-tab svg { color: var(--ink-4); transition: color .2s var(--ease); }
.hs-tab:hover svg { color: var(--ink-2); }
.hs-tab.active svg { color: var(--accent); }
.hs-tab {
  position: relative; height: 44px; padding: 0 1px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: var(--ink-3);
  transition: color .2s var(--ease); white-space: nowrap;
}
.hs-tab:hover { color: var(--ink); }
.hs-tab.active { color: var(--ink-0); font-weight: 700; }
.hs-tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2.5px; border-radius: 5px; background: var(--accent);
}
.hs-tab .hs-count { font-size: 12.5px; font-weight: 600; color: var(--ink-4); }
.hs-tab-temp { font-size: 7px; color: var(--ink-4); margin-left: -3px; align-self: flex-start; margin-top: 9px; }

/* full-catalog toggle — styled to match the category tabs on the same row */
.hs-catalog-btn {
  position: relative; align-self: stretch;
  display: inline-flex; align-items: center; gap: 8px; height: 44px;
  padding: 0 2px 0 18px; margin-left: 2px;
  background: transparent; box-shadow: none; border-radius: 5px;
  border-left: 1px solid var(--line-2);
  font-size: 15px; font-weight: 600; color: var(--ink-3);
  white-space: nowrap;
  transition: color .2s var(--ease);
}
.hs-catalog-btn svg { color: var(--ink-4); transition: color .2s var(--ease), transform .2s var(--ease); }
.hs-catalog-btn:hover { color: var(--ink); }
.hs-catalog-btn:hover svg { color: var(--ink-2); }
.hs-catalog-btn.open { color: var(--ink-0); font-weight: 700; }
.hs-catalog-btn.open svg:first-child { color: var(--accent); }
.hs-catalog-btn.open::after {
  content: ""; position: absolute; left: 18px; right: 0; bottom: 0;
  height: 2.5px; border-radius: 5px; background: var(--accent);
}
.hs-catalog-btn .chev { transition: transform .2s var(--ease); }
.hs-catalog-btn.open .chev { transform: rotate(180deg); color: var(--ink-2); }

/* full catalog panel */
.hs-catalog-panel {
  margin: 0 4px 4px; padding: 14px 16px 16px; border-radius: 5px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2);
  transform-origin: top;
  animation: catPanelIn .24s var(--ease) both;
}
@keyframes catPanelIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.hs-catalog-panel .hs-cat-group:first-of-type .eyebrow { margin-top: 8px !important; }
.hs-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 760px) { .hs-cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .hs-cat-grid { grid-template-columns: 1fr; } }
.hs-cat-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px 9px 11px;
  border-radius: 5px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer; text-align: left; min-width: 0;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.hs-cat-item:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1.5px var(--ink-4); }
.hs-cat-item.active { box-shadow: inset 0 0 0 1.5px var(--accent); }
.hs-cat-ico {
  width: 34px; height: 34px; border-radius: 5px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink-2);
}
.hs-cat-item.active .hs-cat-ico { background: var(--accent-soft); color: var(--accent-ink); }
.hs-cat-name { font-size: 13.5px; font-weight: 600; color: var(--ink-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-cat-count { font-size: 12px; color: var(--ink-4); }
.hs-cat-pin {
  flex: none; width: 30px; height: 30px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-4); background: transparent;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.hs-cat-pin:hover { background: var(--surface-2); color: var(--ink-2); }
.hs-cat-pin.on { color: var(--accent); }
.hs-cat-pin.on:hover { background: var(--accent-softer); color: var(--accent); }
/* iOS-style segmented */
.hs-seg-track { display: flex; background: var(--surface-2); border-radius: 5px; padding: 3px; }
.hs-seg {
  flex: 1; height: 36px; border-radius: 5px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  transition: color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.hs-seg.on { background: var(--surface); color: var(--ink-0); font-weight: 700; box-shadow: var(--sh-1); }
/* lightweight popular pills */
.hs-pop {
  height: 32px; padding: 0 13px; border-radius: 5px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 13px; font-weight: 600; transition: background .18s var(--ease), color .18s var(--ease);
}
.hs-pop:hover { background: var(--accent-soft); color: var(--accent-ink); }

/* ---- catalog facet chips (КПП / привод / топливо / кузов) ---- */
.facet-chip {
  height: 34px; padding: 0 13px; border-radius: 5px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: all .16s var(--ease); white-space: nowrap;
}
.facet-chip:hover { box-shadow: inset 0 0 0 1.5px var(--ink-4); color: var(--ink); }
.facet-chip.on { background: var(--accent); color: #fff; box-shadow: none; }
.facet-ct { font-family: var(--font-mono); font-size: 10.5px; opacity: .5; margin-left: 6px; }
.facet-chip.on .facet-ct { opacity: .85; }
.facet-chip.off { opacity: .38; cursor: not-allowed; }
.facet-chip.off:hover { box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-3); }

/* ---- reworked catalog filter panel ---- */
.filter-head { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 13px; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.filter-reset { font-size: 13px; color: var(--accent-ink); font-weight: 600; }
.filter-body { padding: 0 20px; }
.filter-foot { position: sticky; bottom: 0; z-index: 4; display: flex; gap: 10px; padding: 12px 20px;
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 18px oklch(0.4 0.03 283 / 0.06); }
.filter-show { flex: 1; }
.catalog-filters-close-inline { display: none; }

.select-wrap { position: relative; }
.select-lead { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.select-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.filter-select { width: 100%; height: 44px; padding-left: 38px !important; padding-right: 34px !important;
  appearance: none; -webkit-appearance: none; cursor: pointer; }

.filter-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: 5px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-3); }
.filter-search input { border: none; background: transparent; outline: none; flex: 1; min-width: 0;
  font-size: 13.5px; font-weight: 600; color: var(--ink-0); font-family: inherit; }
.filter-search input::placeholder { color: var(--ink-4); font-weight: 500; }
.filter-search-clr { color: var(--ink-3); display: inline-flex; }
.filter-search-clr:hover { color: var(--ink); }

.filter-more { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700;
  color: var(--accent-ink); margin-top: 9px; }
.filter-more:hover { color: var(--accent); }
.filter-sub { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.filter-sublabel { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-3); margin-bottom: 9px; }

.range-field { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.range-field .input { height: 42px; }
.range-dash { color: var(--ink-4); font-weight: 700; }

.price-hist { display: flex; align-items: flex-end; gap: 2px; height: 40px; margin-bottom: 11px; }
.price-hist i { flex: 1; background: var(--surface-3); border-radius: 1.5px 1.5px 0 0; transition: background .2s var(--ease); }
.price-hist i.on { background: var(--accent); }

/* ============================================================
   Services page layout
   ============================================================ */
.svc-split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 28px; align-items: start; }
.svc-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.svc-guard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.svc-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.svc-stat { flex: 1; min-width: 150px; }
@media (max-width: 1000px) {
  .svc-split { grid-template-columns: 1fr; }
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
  .svc-guard { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .svc-flow { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .svc-flow, .svc-grid, .svc-guard { grid-template-columns: 1fr; }
}

/* ============================================================
   Calculators — light, refined
   ============================================================ */
.calc-card {
  padding: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  align-items: stretch;
  gap: 32px;
}
.calc-card .h2 { letter-spacing: -0.02em; }

/* sunken "receipt" result panel — tonal separation instead of a 2nd card */
.calc-result {
  background: var(--surface-2);
  border-radius: 5px;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
}
.calc-hero {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 5px;
}
.calc-hero .big {
  font-size: clamp(34px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.calc-hero .unit {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent-ink);
  opacity: 0.62;
}
.calc-rows { display: flex; flex-direction: column; margin: 20px 0 4px; }
.calc-rows .calc-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; font-size: 14px;
}
.calc-rows .calc-row + .calc-row { border-top: 1px solid var(--line-2); }
.calc-rows .calc-row .lab { color: var(--ink-2); }
.calc-rows .calc-row .val { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.calc-rows .calc-row.total { margin-top: 2px; border-top: 1px solid var(--line); }
.calc-rows .calc-row.total .lab { color: var(--ink-0); font-weight: 700; }
.calc-rows .calc-row.total .val { font-weight: 800; color: var(--ink-0); }
.calc-note {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  font-size: 12px; color: var(--ink-3); margin: 12px 0 0; text-align: center;
}

/* refined range slider */
.am-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; background: transparent; cursor: pointer;
  --pct: 50%;
}
.am-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 5px;
  background: linear-gradient(to right, var(--accent) var(--pct), var(--line) var(--pct));
}
.am-range::-moz-range-track { height: 6px; border-radius: 5px; background: var(--line); }
.am-range::-moz-range-progress { height: 6px; border-radius: 5px; background: var(--accent); }
.am-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 19px; height: 19px; margin-top: -6.5px; border-radius: 5px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--accent), 0 2px 5px oklch(0.4 0.03 283 / 0.20);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.am-range::-moz-range-thumb {
  width: 19px; height: 19px; border: 2px solid var(--accent); border-radius: 5px;
  background: var(--surface); box-shadow: 0 2px 5px oklch(0.4 0.03 283 / 0.20);
}
.am-range:hover::-webkit-slider-thumb { transform: scale(1.1); }
.am-range:active::-webkit-slider-thumb {
  transform: scale(0.97);
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 6px var(--accent-soft);
}
.am-range:focus-visible { outline: none; }
.am-range:focus-visible::-webkit-slider-thumb {
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 6px var(--accent-soft);
}
/* trust-green variant (reliability filter) */
.am-range.trust::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--trust) var(--pct), var(--line) var(--pct));
}
.am-range.trust::-moz-range-progress { background: var(--trust); }
.am-range.trust::-webkit-slider-thumb {
  box-shadow: inset 0 0 0 2px var(--trust), 0 2px 5px oklch(0.4 0.03 283 / 0.20);
}
.am-range.trust::-moz-range-thumb { border-color: var(--trust); }
.am-range.trust:active::-webkit-slider-thumb {
  box-shadow: inset 0 0 0 2px var(--trust), 0 0 0 6px var(--trust-soft);
}
.am-range.trust:focus-visible::-webkit-slider-thumb {
  box-shadow: inset 0 0 0 2px var(--trust), 0 0 0 6px var(--trust-soft);
}
@media (max-width: 1000px) {
  .calc-card { padding: 22px; gap: 22px; }
}

/* ============================================================
   Hero responsive
   ============================================================ */
@media (max-width: 1040px) {
  .hero-top { grid-template-columns: 1fr !important; gap: 30px !important; }
  .hero-spotlight { max-width: 460px; }
}
@media (max-width: 600px) {
  .hero-spotlight { display: none; }
}

/* ============================================================
   Header — keep everything on screen at any width
   ============================================================ */
.header-bar { flex-wrap: nowrap; min-width: 0; }
.header-left, .header-right { flex: none; }
.header-nav { white-space: nowrap; }
.header-search { flex: 1 1 auto; }

/* Tighten as the viewport narrows so nothing clips off-screen */
@media (max-width: 1180px) {
  .header-left { gap: 18px !important; }
  .header-nav { gap: 18px !important; }
}
@media (max-width: 1040px) {
  .header-search { display: none !important; }
  .header-bar { justify-content: space-between; }
}
@media (max-width: 860px) {
  .header-cta-label { display: none; }
  .header-cta { width: 40px; padding: 0 !important; }
  .header-right { gap: 2px !important; }
  .btn-icon { width: 40px; }
  .header-expert { padding: 0 !important; width: 40px; height: 40px; justify-content: center; box-shadow: none !important; }
  .header-expert .col { display: none; }
  .country-label { display: none; }
  .country-div { display: none; }
}
@media (max-width: 680px) {
  .header-nav { display: none !important; }
  .wrap { padding: 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::after, *::before { animation-duration: 0.001ms !important; transition-duration: 0.06s !important; }
}

/* header icon buttons — subtle hover feedback */
header .btn-icon { border-radius: 5px; transition: background .18s var(--ease), color .18s var(--ease); }
header .btn-icon:hover { background: var(--surface-2); color: var(--ink) !important; }

/* ============================================================
   Stories rail + viewer + expert drawer
   ============================================================ */
.story-rail-wrap {
  padding-top: 12px; padding-bottom: 12px;
}
.story-rail { scrollbar-width: none; -ms-overflow-style: none; scroll-snap-type: x proximity; }
.story-rail::-webkit-scrollbar { display: none; }
.story-cell { scroll-snap-align: start; }

/* story preview cards */
.story-card {
  position: relative; flex: none; overflow: hidden;
  border-radius: 5px; padding: 0; text-align: left;
  display: flex; flex-direction: column; justify-content: flex-end;
  box-shadow: 0 1px 2px oklch(0.2 0.02 283 / 0.06), inset 0 0 0 1px oklch(1 0 0 / 0.06);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
  cursor: pointer;
}
.story-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px oklch(0.2 0.04 283 / 0.18); }
.story-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.story-cover {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.story-card-shade {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, oklch(0 0 0 / 0) 38%, oklch(0.16 0.02 283 / 0.78) 100%);
}
.story-badge {
  position: absolute; top: 9px; left: 9px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  max-width: calc(100% - 18px);
  box-shadow: 0 1px 3px oklch(0.2 0.02 283 / 0.18);
}
.story-headline {
  position: relative; z-index: 2;
  padding: 0 11px 11px; color: #fff;
  font-size: 13px; font-weight: 700; line-height: 1.22;
  text-shadow: 0 1px 6px oklch(0.1 0.02 283 / 0.4);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.story-cap {
  position: relative; z-index: 2;
  padding: 0 11px 11px; color: #fff;
  font-size: 13px; font-weight: 700;
}
.story-card-add {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1.5px var(--line); justify-content: center;
}
.story-card-add:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }

/* ============================================================
   Returning-user home: quick search + saved searches
   ============================================================ */
.qs-bar {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1fr auto;
  gap: 12px; align-items: end;
  padding: 16px; row-gap: 14px;
}
.qs-go { height: 50px; min-width: 200px; }
.qs-allfilters {
  grid-column: 1 / -1; justify-self: end;
  font-size: 14px; font-weight: 700; color: var(--accent-ink);
  margin-top: -2px;
}
@media (max-width: 760px) {
  .qs-bar { grid-template-columns: 1fr 1fr; }
  .qs-go { grid-column: 1 / -1; }
}

.saved-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .saved-grid { grid-template-columns: 1fr; } }
.saved-card {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; border-radius: 5px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  cursor: pointer;
}
.saved-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.saved-ico {
  width: 44px; height: 44px; border-radius: 5px; flex: none;
  background: var(--accent-soft); color: var(--accent-ink);
}
.saved-fresh {
  flex: none; height: 20px; padding: 0 8px; border-radius: 5px;
  background: var(--trust-soft); color: var(--trust-ink);
  font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; white-space: nowrap;
}

/* ============================================================
   Collapsible stories (mini circles) + compact home blocks
   ============================================================ */
.story-collapsed { padding-top: 12px; padding-bottom: 12px; }
.story-mini { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: none; width: 68px; }
.story-mini-ring {
  width: 46px; height: 46px; border-radius: 5px; padding: 1.5px;
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: transform .2s var(--ease);
}
.story-mini-ring.dashed { padding: 0; border: 1.5px dashed var(--line); background: transparent !important; border-radius: 5px; }
.story-mini:hover .story-mini-ring { transform: translateY(-2px); }
.story-mini-inner {
  width: 100%; height: 100%; border-radius: 5px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--bg);
}
.story-mini-ring:not(.dashed) .story-mini-inner { background: var(--surface); box-shadow: inset 0 0 0 2px var(--bg); }
.story-mini-live {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px;
  border-radius: 5px; background: var(--trust); box-shadow: 0 0 0 2px var(--bg);
}
.story-mini-label {
  font-size: 10.5px; font-weight: 500; color: var(--ink-3); line-height: 1.2; letter-spacing: -0.01em;
  max-width: 68px; text-align: center; overflow-wrap: normal; word-break: keep-all; hyphens: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.5em;
}
.story-expand {
  flex: none; align-self: center; width: 34px; height: 34px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center; margin-left: 4px;
  color: var(--ink-4); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.story-expand:hover { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }

/* safety net: once revealed, never let a reveal animation hold content hidden */
html.anim-done .fade-up { animation: none !important; opacity: 1 !important; transform: none !important; }

/* trust proof strip — sits right under the search, raises the value prop above the fold */
.trust-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border-radius: 5px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden;
}
.trust-strip-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; min-width: 0;
  border-left: 1px solid var(--line-2);
}
.trust-strip-item:first-child { border-left: none; }
.trust-strip-ico {
  width: 36px; height: 36px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--trust-soft); color: var(--trust-ink);
}
.trust-strip-t { font-size: 13.5px; font-weight: 700; color: var(--ink-0); letter-spacing: -0.01em; line-height: 1.2; }
.trust-strip-d { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
@media (max-width: 900px) { .trust-strip { grid-template-columns: repeat(2, 1fr); }
  .trust-strip-item:nth-child(3) { border-left: none; }
  .trust-strip-item:nth-child(n+3) { border-top: 1px solid var(--line-2); } }
@media (max-width: 520px) { .trust-strip { grid-template-columns: 1fr; }
  .trust-strip-item { border-left: none; }
  .trust-strip-item + .trust-strip-item { border-top: 1px solid var(--line-2); } }

/* full-bleed tinted band — gives the long home feed some vertical rhythm */
.home-band {
  background: var(--surface);
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  margin-top: 64px; padding-bottom: 60px;
}
.home-band > section { margin-top: 0 !important; padding-top: 52px; }

/* compact hero band */
.compact-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 36px;
  padding-top: 22px; flex-wrap: wrap;
}
.compact-hero-copy { display: flex; flex-direction: column; gap: 8px; max-width: 600px; }
.compact-hero-title { font-size: clamp(23px, 2.7vw, 31px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.04; color: var(--ink-0); }
.compact-hero-sub { font-size: 13.5px; line-height: 1.45; color: var(--ink-3); max-width: 500px; }
.compact-hero-stats {
  display: flex; gap: 26px; flex-wrap: wrap; flex: none;
  padding: 14px 20px; border-radius: 5px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2);
}
.compact-hero-stats .num { white-space: nowrap; font-size: 17px !important; }
.compact-hero-stats .col { min-width: 64px; gap: 0 !important; }
.compact-hero-stats .muted { font-size: 11.5px !important; }
@media (max-width: 720px) { .compact-hero-stats { gap: 20px; padding: 12px 16px; } }
@media (max-width: 720px) { .compact-hero-stats { gap: 22px; } }

/* compact category strip */
.cat-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 1000px) { .cat-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .cat-strip { grid-template-columns: repeat(2, 1fr); } }
.cat-chip {
  display: flex; align-items: center; gap: 11px; text-align: left;
  padding: 11px 13px; border-radius: 5px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  cursor: pointer; min-width: 0;
}
.cat-chip:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.cat-chip-ico { width: 38px; height: 38px; border-radius: 5px; flex: none; background: var(--surface-2); color: var(--ink); }
.cat-chip-title {
  font-size: 14px; font-weight: 700; color: var(--ink-0); letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.cat-chip-dot { width: 6px; height: 6px; border-radius: 5px; background: var(--trust); flex: none; }
.cat-chip-sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* primary (pinned) tiles — highlighted */
.cat-chip-primary .cat-chip-ico { background: var(--accent-soft); color: var(--accent-ink); }
.cat-chip-primary { box-shadow: inset 0 0 0 1px var(--line); }

/* "Настроить" button */
.cat-config-btn { font-size: 13px; font-weight: 700; color: var(--ink-3); transition: color .15s var(--ease); }
.cat-config-btn:hover { color: var(--ink); }

/* edit-mode tiles with pin toggle */
.cat-chip-edit { position: relative; }
.cat-chip-edit.on { box-shadow: inset 0 0 0 1.6px var(--accent); background: var(--accent-softer); }
.cat-chip-edit.on .cat-chip-ico { background: var(--accent-soft); color: var(--accent-ink); }
.cat-pin {
  flex: none; width: 24px; height: 24px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink-4); box-shadow: inset 0 0 0 1px var(--line);
  transition: all .15s var(--ease);
}
.cat-pin.on { background: var(--accent); color: #fff; box-shadow: none; }

/* collapsed secondary categories — compact chips */
.cat-mini-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.cat-mini-label { font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin-right: 2px; }
.cat-mini {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  height: 36px; padding: 0 13px; border-radius: 5px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), color .15s var(--ease);
}
.cat-mini svg { color: var(--ink-3); }
.cat-mini:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1.5px var(--ink-4); color: var(--ink); }
.cat-mini:hover svg { color: var(--ink); }

/* service-type chips — visually distinct from browse categories */
.cat-mini-service {
  background: var(--accent-softer); color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}
.cat-mini-service svg { color: var(--accent-ink); }
.cat-mini-service .cat-mini-arrow { opacity: 0.55; margin-left: 1px; }
.cat-mini-service:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent-ink); }
.cat-mini-service:hover svg { color: var(--accent-ink); }
.cat-mini-service:hover .cat-mini-arrow { opacity: 1; }

/* ============================================================
   Services block — uniform cards, one featured (expert)
   ============================================================ */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .svc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .svc-grid { grid-template-columns: 1fr; } }
.svc-card {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 18px 20px; border-radius: 5px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease); cursor: pointer;
}
.svc-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.svc-ico {
  width: 46px; height: 46px; border-radius: 5px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink);
}
.svc-title {
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink-0);
  display: flex; align-items: center; gap: 7px;
}
.svc-sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.svc-live { width: 7px; height: 7px; border-radius: 5px; background: var(--trust); flex: none; box-shadow: 0 0 0 3px var(--trust-soft); }
.svc-arrow { color: var(--ink-4); flex: none; transition: transform .18s var(--ease), color .18s var(--ease); }
.svc-card:hover .svc-arrow { color: var(--ink-2); transform: translateX(2px); }
/* featured (expert) service */
.svc-card-featured { background: var(--accent-softer); box-shadow: inset 0 0 0 1.5px var(--accent-soft); }
.svc-card-featured .svc-ico { background: var(--accent); color: #fff; }
.svc-card-featured .svc-title { color: var(--accent-ink); }
.svc-card-featured .svc-arrow { color: var(--accent-ink); }

/* saved searches row (pills) */
.saved-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.saved-row::-webkit-scrollbar { display: none; }
.saved-pill {
  display: flex; align-items: center; gap: 11px; text-align: left; flex: none;
  min-width: 248px; padding: 11px 14px; border-radius: 5px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease); cursor: pointer;
}
.saved-pill:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.saved-pill-ico { width: 36px; height: 36px; border-radius: 5px; flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.saved-pill-ico-add { background: var(--surface-2); color: var(--ink-3); }
.saved-pill-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-pill-sub { font-size: 12px; white-space: nowrap; }
.saved-pill-add { min-width: 0; }

/* expert presence chip in the header */
.expert-chip {
  display: inline-flex; align-items: center; gap: 9px;
  height: 42px; padding: 0 14px 0 6px; border-radius: 5px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), background .2s var(--ease);
  white-space: nowrap;
}
.expert-chip:hover { box-shadow: inset 0 0 0 1.5px var(--accent); transform: translateY(-1px); }

.expert-prompt:hover { box-shadow: inset 0 0 0 1.5px var(--accent) !important; background: var(--accent-softer) !important; }

/* live-expert promo band on Home */
.expert-band {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 22px; border-radius: 5px;
  background: linear-gradient(120deg, var(--accent-softer), var(--surface) 70%);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}
.expert-band-cta { flex: none; }
@media (max-width: 640px) {
  .expert-band { flex-direction: column; align-items: flex-start; }
  .expert-band-cta { width: 100%; }
}

@keyframes storyfill { from { width: 0%; } to { width: 100%; } }

.story-nav { z-index: 92; }
@media (max-width: 600px) { .story-nav { display: none; } }

/* category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
@media (max-width: 1040px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
.cat-tile {
  position: relative; overflow: hidden; text-align: left; cursor: pointer;
  border-radius: 5px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--sh-1); transition: transform .26s var(--ease), box-shadow .26s var(--ease);
  display: flex; flex-direction: column;
}
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--sh-3); }
.cat-banner {
  height: 96px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--ink) 0%, oklch(0.34 0.11 295) 48%, var(--accent) 110%);
  display: flex; align-items: center; justify-content: center;
}
.cat-banner::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 5px;
  background: radial-gradient(circle, oklch(1 0 0 / 0.16), transparent 70%);
}
.cat-tile:hover .cat-ico { transform: scale(1.12) rotate(-4deg); }
.cat-ico { color: #fff; transition: transform .35s var(--ease); }

/* ============================================================
   Responsive: content grids, catalog filter drawer, chat panes
   ============================================================ */
/* card grids reflow */
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1040px) {
  .cards-4 { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 880px) {
  .cards-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .cards-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .pitch-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .specs-grid { grid-template-columns: 1fr 1fr !important; }
  .listing-layout { grid-template-columns: 1fr !important; gap: 24px !important; }
  .create-layout { grid-template-columns: 1fr !important; gap: 20px !important; }
  .garage-cars { grid-template-columns: 1fr !important; }
  .stat-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .garage-head { grid-template-columns: auto 1fr !important; row-gap: 16px !important; }
  .garage-head > :last-child { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
  .search-row-3 { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 560px) {
  .cards-4, .cards-3 { grid-template-columns: 1fr !important; }
  .stat-4 { grid-template-columns: 1fr 1fr !important; }
  .form-2col { grid-template-columns: 1fr !important; }
  .search-row-3 { grid-template-columns: 1fr !important; }
  .search-row-go { grid-template-columns: 1fr !important; }
  .create-stepper .row.grow > button > span:last-child { display: none; }
}

/* listing detail: rail stops being sticky on stack */
@media (max-width: 880px) {
  .listing-layout > .col[style*="sticky"], .create-layout > .col[style*="sticky"] { position: static !important; }
}

/* listing detail: mobile sticky contact bar (rail stacks far below on phones) */
.listing-mobile-cta { display: none; }
@media (max-width: 880px) {
  .listing-mobile-cta {
    display: flex; align-items: center; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: oklch(1 0 0 / 0.92); backdrop-filter: blur(14px) saturate(1.4);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 24px oklch(0.4 0.02 262 / 0.1);
  }
  .listing-mobile-cta .btn { height: 46px; }
}

/* catalog filter drawer */
.catalog-filter-toggle { display: none; }
.catalog-filters-close { display: none; position: absolute; top: 12px; right: 12px; z-index: 2; background: var(--surface-2); }
/* Desktop: the sticky filter rail can be taller than the viewport. Cap it to the
   visible area and let it scroll on its own, so it stays fully reachable while the
   listings scroll — instead of its lower groups only appearing past the feed's end. */
.catalog-filters { max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain; }
.catalog-filters::-webkit-scrollbar { width: 8px; }
.catalog-filters::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; }
.catalog-filters::-webkit-scrollbar-thumb:hover { background: var(--line); }
@media (max-width: 960px) {
  .catalog-layout { grid-template-columns: 1fr !important; }
  .catalog-filter-toggle { display: inline-flex; width: 100%; justify-content: center; margin-bottom: 6px; }
  .catalog-filters {
    position: fixed !important; top: 0 !important; left: 0; bottom: 0; z-index: 95;
    width: min(340px, 87vw); max-height: 100vh; overflow-y: auto;
    border-radius: 5px;
    transform: translateX(-101%); transition: transform .3s var(--ease);
    box-shadow: var(--sh-3);
  }
  .catalog-filters.open { transform: none; }
  .catalog-filters-close { display: flex; }
  .catalog-filters-close-inline { display: inline-flex; }
  .catalog-filters-backdrop { position: fixed; inset: 0; z-index: 94; background: oklch(0.18 0.02 262 / 0.42); backdrop-filter: blur(3px); }
}

/* ============================================================
   ФЗ-152 — cookie banner, legal links, doc viewer
   ============================================================ */
.cookie-banner {
  position: fixed; left: 20px; bottom: 20px; z-index: 88;
  width: min(420px, calc(100vw - 40px));
  display: flex; flex-direction: column; gap: 15px;
  padding: 18px 20px 17px; border-radius: 5px;
  background: oklch(1 0 0 / 0.94); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--sh-3); border: 1px solid var(--line);
  animation: fadeUp 0.45s var(--ease-out) both;
}
.cookie-banner::before {
  content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 3px;
  border-radius: 5px 0 0 5px; background: var(--accent); opacity: 0.9;
}
.cookie-actions { display: flex; flex-direction: column; align-items: stretch; gap: 11px; }
.cookie-act-row { display: flex; align-items: center; gap: 8px; }
.cookie-act-row .btn { flex: 1; }
.cookie-meta { white-space: nowrap; }
.cookie-settings-btn {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 13px; font-weight: 700; color: var(--ink-3);
  transition: color .15s var(--ease);
}
.cookie-settings-btn:hover { color: var(--ink); }
.cookie-settings-btn svg { color: var(--accent); transition: color .15s var(--ease); }
@media (max-width: 520px) {
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; width: auto; }
}
.legal-link {
  color: var(--accent-ink); font-weight: 700; text-decoration: underline;
  text-underline-offset: 2px; text-decoration-thickness: 1px;
  transition: color .15s var(--ease); display: inline; cursor: pointer;
}
.legal-link:hover { color: var(--accent-press); }
.legal-body::-webkit-scrollbar { width: 8px; }
.legal-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }

/* chat: one pane at a time on mobile */
.chat-back { display: none; }
@media (max-width: 720px) {
  .chat-grid { grid-template-columns: 1fr !important; }
  .chat-grid[data-pane="thread"] .chat-list { display: none; }
  .chat-grid[data-pane="list"] .chat-thread { display: none; }
  .chat-list { border-right: none !important; }
  .chat-back { display: flex; width: 38px; height: 38px; }
}
