/* ============ Автоподбор — оформление ============ */
:root {
  --bg: #0b1020; --bg2: #0f1630; --card: rgba(22, 30, 58, .72); --card-solid: #161e3a; --card2: rgba(255, 255, 255, .04);
  --line: rgba(148, 163, 214, .16); --line2: rgba(148, 163, 214, .28);
  --text: #e8ecfb; --muted: #94a0c6; --faint: #66729a;
  --accent: #6f7dff; --accent2: #a55cff; --pink: #ff5ca8; --cyan: #22d3ee;
  --good: #22c58b; --warn: #f5a524; --bad: #ff5468; --info: #5aa8ff;
  --good-bg: rgba(34, 197, 139, .12); --warn-bg: rgba(245, 165, 36, .12); --bad-bg: rgba(255, 84, 104, .12); --info-bg: rgba(90, 168, 255, .1);
  --grad: linear-gradient(135deg, #4f8cff 0%, #7c5cff 55%, #ff5ca8 100%);
  --grad-ai: linear-gradient(135deg, #22d3ee 0%, #6f7dff 50%, #a855f7 100%);
  --shadow: 0 10px 40px rgba(0, 0, 0, .35); --shadow-sm: 0 4px 16px rgba(0, 0, 0, .25);
  --r: 18px; --r-sm: 12px; --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f5fb; --bg2: #e9edf8; --card: rgba(255, 255, 255, .86); --card-solid: #ffffff; --card2: rgba(20, 30, 70, .035);
  --line: rgba(30, 41, 90, .1); --line2: rgba(30, 41, 90, .2);
  --text: #121a33; --muted: #5b6687; --faint: #8b94b0;
  --good-bg: rgba(16, 170, 110, .1); --warn-bg: rgba(230, 140, 0, .11); --bad-bg: rgba(230, 50, 75, .09); --info-bg: rgba(40, 120, 240, .08);
  --good: #0e9f6e; --warn: #d98400; --bad: #e23552; --info: #2c7be5;
  --shadow: 0 10px 40px rgba(30, 41, 90, .12); --shadow-sm: 0 4px 14px rgba(30, 41, 90, .08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: background .4s var(--ease), color .4s var(--ease);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
svg.i { width: 20px; height: 20px; flex: none; }
[hidden] { display: none !important; }

/* фон — мягкие плавающие пятна */
#bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
#bg i { position: absolute; width: 50vmax; height: 50vmax; border-radius: 50%; filter: blur(80px); opacity: .28; animation: blob 26s ease-in-out infinite alternate; }
#bg i:nth-child(1) { background: #4f8cff; top: -18vmax; left: -12vmax; }
#bg i:nth-child(2) { background: #a55cff; bottom: -22vmax; right: -14vmax; animation-delay: -8s; }
#bg i:nth-child(3) { background: #ff5ca8; top: 30%; left: 45%; width: 30vmax; height: 30vmax; opacity: .14; animation-delay: -15s; }
:root[data-theme="light"] #bg i { opacity: .16; }
:root[data-theme="light"] #bg i:nth-child(3) { opacity: .08; }
@keyframes blob { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vmax, 4vmax) scale(1.1); } 100% { transform: translate(-4vmax, 7vmax) scale(.95); } }

/* ============ каркас ============ */
.shell { display: grid; grid-template-rows: auto 1fr; min-height: 100vh; }
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 12px max(16px, env(safe-area-inset-left)) 12px;
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; text-decoration: none; color: var(--text); }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 18px rgba(124, 92, 255, .45); }
.brand .logo svg { width: 22px; height: 22px; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: -3px; }
.nav { display: flex; gap: 4px; margin-left: 18px; }
.nav a {
  white-space: nowrap;
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px;
  transition: background .2s, color .2s; position: relative;
}
.nav a:hover { color: var(--text); background: var(--card2); }
.nav a.on { color: var(--text); background: var(--card2); }
.nav a.on::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--grad); }
.nav .cnt { font-size: 11px; background: var(--grad); color: #fff; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.top .sp { flex: 1; }
.iconbtn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); cursor: pointer;
  transition: transform .15s, background .2s, border-color .2s; color: var(--text);
}
.iconbtn:hover { border-color: var(--line2); background: var(--card); }
.iconbtn:active { transform: scale(.92); }
.theme-btn svg { transition: transform .5s var(--ease); }
.theme-btn:active svg { transform: rotate(90deg); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }

main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 22px 16px 120px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -.03em; line-height: 1.15; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* нижняя навигация на телефоне */
.tabbar { display: none; }
@media (max-width: 1080px) {
  .nav, .who .name { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 40;
    background: color-mix(in srgb, var(--card-solid) 88%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 6px;
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 16px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; transition: color .2s, background .2s; }
  .tabbar a.on { color: var(--text); background: var(--card2); }
  .tabbar a.on svg { color: var(--accent); }
  .tabbar a.new { color: #fff; background: var(--grad); box-shadow: 0 6px 18px rgba(124, 92, 255, .45); }
  main { padding: 16px 12px 120px; }
  .top { padding: 10px 12px; }
}

/* ============ карточки ============ */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.card + .card { margin-top: 16px; }
.card h2, .card h3 { margin: 0 0 12px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.card h2 { font-size: 19px; }
.card h3 { font-size: 16px; }
.card .sub { color: var(--muted); margin: -6px 0 14px; font-size: 14px; }
.h-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--card2); color: var(--accent); border: 1px solid var(--line); flex: none; }
.h-ico.ai { background: var(--grad-ai); color: #fff; border: 0; }
.h-ico.bot { background: var(--grad); color: #fff; border: 0; }

.reveal { animation: up .55s var(--ease) both; }
.stagger > * { animation: up .5s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .05s; } .stagger > *:nth-child(3) { animation-delay: .1s; } .stagger > *:nth-child(4) { animation-delay: .15s; }
.stagger > *:nth-child(5) { animation-delay: .2s; } .stagger > *:nth-child(6) { animation-delay: .25s; } .stagger > *:nth-child(7) { animation-delay: .3s; }
.stagger > *:nth-child(8) { animation-delay: .35s; } .stagger > *:nth-child(n+9) { animation-delay: .4s; }
@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ кнопки ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line2);
  background: var(--card2); color: var(--text); font-weight: 650; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .25s, background .2s, border-color .2s, opacity .2s;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad); background-size: 160% 160%; border: 0; color: #fff; box-shadow: 0 8px 24px rgba(124, 92, 255, .4); animation: gradmove 6s ease infinite; }
.btn.primary:hover { box-shadow: 0 10px 30px rgba(124, 92, 255, .55); }
.btn.ai { background: var(--grad-ai); background-size: 160% 160%; border: 0; color: #fff; box-shadow: 0 8px 24px rgba(34, 211, 238, .3); animation: gradmove 5s ease infinite; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--card2); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn.lg { min-height: 54px; padding: 0 26px; font-size: 16px; border-radius: 16px; }
.btn.block { width: 100%; }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes gradmove { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }

/* ============ поля ============ */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .g2.stack, .g3.stack { grid-template-columns: 1fr; } }
.span2 { grid-column: span 2; } .span-all { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > label, .lbl { font-size: 12.5px; font-weight: 650; color: var(--muted); letter-spacing: .01em; display: flex; align-items: center; gap: 6px; }
.fld .help { font-size: 12px; color: var(--faint); }
.vf { position: relative; display: flex; align-items: stretch; border-radius: var(--r-sm); background: var(--card2); border: 1px solid var(--line2); transition: border-color .2s, box-shadow .2s, background .2s; }
.vf:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); background: var(--card); }
.vf input, .vf textarea, .vf select {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 11px 12px; font-size: 15.5px; border-radius: var(--r-sm);
}
.vf textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.vf select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.vf select option { background: var(--card-solid); color: var(--text); }
.vf .unit { align-self: center; color: var(--faint); font-size: 13px; padding-right: 4px; white-space: nowrap; }
.vf.filled { border-color: color-mix(in srgb, var(--good) 45%, var(--line2)); }
.vf.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); background: var(--good-bg); } 100% { box-shadow: 0 0 0 10px transparent; } }
.mic {
  flex: none; width: 40px; margin: 3px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; position: relative;
  transition: color .2s, background .2s;
}
.mic:hover { color: var(--accent); background: var(--card2); }
.mic.rec { color: #fff; background: var(--bad); }
.mic.rec::before, .mic.rec::after { content: ''; position: absolute; inset: 0; border-radius: 10px; border: 2px solid var(--bad); animation: ripple 1.4s ease-out infinite; }
.mic.rec::after { animation-delay: .7s; }
@keyframes ripple { from { transform: scale(1); opacity: .8; } to { transform: scale(1.8); opacity: 0; } }
.vf.listening { border-color: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 18%, transparent); }
.vf textarea + .mic { align-self: flex-start; height: 40px; }

/* чипы-варианты */
.chips-wrap { display: flex; align-items: flex-start; gap: 6px; }
.chips-wrap .mic { height: 40px; margin: 0; border: 1px solid var(--line2); background: var(--card2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 99px; border: 1px solid var(--line2); background: var(--card2); cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted); transition: all .2s var(--ease); user-select: none; -webkit-tap-highlight-color: transparent;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.on { color: #fff; border-color: transparent; background: var(--grad); box-shadow: 0 4px 14px rgba(124, 92, 255, .35); animation: pop .35s var(--ease); }
.chip .e { font-size: 15px; }
.chips-wrap.listening .chips { outline: 2px dashed var(--bad); outline-offset: 4px; border-radius: 12px; }

/* сегменты источника */
.seg { display: inline-flex; background: var(--card2); border: 1px solid var(--line); border-radius: 15px; padding: 4px; gap: 4px; position: relative; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 9px 16px; border-radius: 11px; display: flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 650; color: var(--muted); transition: color .2s, background .25s; }
.seg button.on { background: var(--card-solid); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button.on svg { color: var(--accent); }
@media (max-width: 520px) { .seg { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; } .seg button { justify-content: center; padding: 9px 6px; font-size: 13px; flex-direction: column; gap: 2px; } }

.found { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.found span { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; background: var(--good-bg); color: var(--good); font-weight: 600; animation: pop .4s var(--ease) both; }

/* ============ форма новой машины ============ */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.editor .side { position: sticky; top: 84px; }
@media (max-width: 1020px) { .editor { grid-template-columns: 1fr; } .editor .side { position: static; order: -1; } }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 16px; font-weight: 750; letter-spacing: -.01em; }
.sec-title .n { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); color: #fff; font-size: 13px; display: grid; place-items: center; flex: none; }
.sec-title small { font-weight: 500; color: var(--faint); font-size: 12.5px; }
.optional { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); border: 1px solid var(--line2); border-radius: 99px; padding: 1px 8px; }

.drop {
  border: 2px dashed var(--line2); border-radius: var(--r); padding: 22px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--card2); color: var(--text); }
.drop svg { width: 34px; height: 34px; color: var(--accent); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { position: relative; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: var(--card2); border: 1px solid var(--line); animation: pop .35s var(--ease) both; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.thumb button { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb button svg { width: 15px; height: 15px; }
.thumb .tag { position: absolute; left: 5px; bottom: 5px; font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; }

/* живая оценка сбоку */
.live { text-align: center; }
.live .ring-wrap { margin: 4px auto 6px; }
.live .why { text-align: left; margin-top: 12px; display: grid; gap: 6px; }
.live .why div { font-size: 13px; display: flex; gap: 8px; align-items: flex-start; color: var(--muted); animation: up .35s var(--ease) both; }
.live .why b { font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.meter { height: 6px; border-radius: 6px; background: var(--card2); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; background: var(--grad); border-radius: 6px; transition: width .6s var(--ease); }
.tiny { font-size: 12px; color: var(--faint); }

/* ============ кольцо оценки ============ */
.ring-wrap { position: relative; width: var(--size, 150px); height: var(--size, 150px); }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-wrap .track { fill: none; stroke: var(--card2); stroke-width: 10; }
.ring-wrap .bar { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease), stroke .6s; filter: drop-shadow(0 0 8px color-mix(in srgb, currentColor 50%, transparent)); }
.ring-wrap .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-wrap .val b { font-size: calc(var(--size, 150px) * .3); font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-wrap .val small { color: var(--muted); font-size: calc(var(--size, 150px) * .095); font-weight: 600; margin-top: 2px; }
.lvl-great { color: var(--good); } .lvl-good { color: #6fd36a; } .lvl-mid { color: var(--warn); } .lvl-risky { color: #ff8a3d; } .lvl-bad { color: var(--bad); }
:root[data-theme="light"] .lvl-good { color: #3aa53a; }
.verdict-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 99px; font-weight: 700; font-size: 14px; background: color-mix(in srgb, currentColor 14%, transparent); }

/* ============ страница машины ============ */
.car-hero { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 900px) { .car-hero { grid-template-columns: 1fr; } }
.gallery { border-radius: var(--r); overflow: hidden; position: relative; background: var(--card2); border: 1px solid var(--line); min-height: 220px; aspect-ratio: 4/3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fadein .5s; }
.gallery .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.gallery .ph svg { width: 90px; height: 90px; opacity: .5; }
.gallery .nav-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 5px; }
.gallery .nav-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .5); cursor: pointer; }
.gallery .nav-dots i.on { background: #fff; width: 18px; border-radius: 4px; }
.gallery .arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .45); color: #fff; cursor: pointer; display: grid; place-items: center; }
.gallery .arrow.l { left: 8px; } .gallery .arrow.r { right: 8px; transform: translateY(-50%) scaleX(-1); }
@keyframes fadein { from { opacity: 0; } }
.car-title { font-size: clamp(24px, 3.5vw, 36px); margin: 0; letter-spacing: -.03em; line-height: 1.1; }
.price { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 8px 0 12px; }
.specs { display: flex; flex-wrap: wrap; gap: 8px; }
.spec { display: inline-flex; gap: 7px; align-items: center; padding: 7px 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; }
.spec svg { width: 16px; height: 16px; color: var(--accent); }

.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .scores { grid-template-columns: 1fr; } }
.score-card { display: flex; gap: 20px; align-items: center; }
@media (max-width: 420px) { .score-card { flex-direction: column; text-align: center; } }
.score-card .txt h3 { margin: 0 0 6px; }
.score-card .reasons { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }
.score-card .reasons li::before { content: '• '; color: var(--accent); }
.vs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 8px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { padding: 14px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); }
.tile .k { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.tile .k svg { width: 15px; height: 15px; color: var(--accent); }
.tile .v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .v small { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile .s { font-size: 12px; color: var(--faint); }

.items { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); align-items: start; }
.item .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.item .ic svg { width: 18px; height: 18px; }
.item.bad .ic { background: var(--bad-bg); color: var(--bad); } .item.warn .ic { background: var(--warn-bg); color: var(--warn); }
.item.good .ic { background: var(--good-bg); color: var(--good); } .item.info .ic { background: var(--info-bg); color: var(--info); }
.item b { display: block; font-size: 14.5px; }
.item p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.item .d { font-weight: 800; font-size: 13px; padding: 3px 8px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.item .d.p { color: var(--good); background: var(--good-bg); } .item .d.m { color: var(--bad); background: var(--bad-bg); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

.check { display: grid; gap: 6px; }
.check label { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.check label:hover { background: var(--card2); }
.check input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line2); flex: none; margin: 0; cursor: pointer; display: grid; place-items: center; transition: all .2s; }
.check input:checked { background: var(--good); border-color: var(--good); }
.check input:checked::after { content: ''; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check input:checked + span { color: var(--faint); text-decoration: line-through; }
.progress-line { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.progress-line .meter { flex: 1; margin: 0; }
ol.qs { margin: 0; padding-left: 22px; display: grid; gap: 6px; }

.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .cols2 { grid-template-columns: 1fr; } }

/* ============ нейросеть ============ */
.prov { display: flex; flex-wrap: wrap; gap: 8px; }
.prov button {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 14px; border: 1px solid var(--line2); background: var(--card2); cursor: pointer; font-weight: 700;
  transition: all .2s var(--ease); position: relative;
}
.prov button i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.prov button small { font-weight: 500; color: var(--faint); font-size: 11.5px; }
.prov button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent); }
.prov button.off { opacity: .55; }
.ai-run { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.scan {
  margin-top: 16px; border-radius: var(--r); padding: 26px; text-align: center; position: relative; overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--cyan) 18%, transparent), transparent 70%);
}
.scan .carline { width: 180px; height: 90px; margin: 0 auto 10px; color: var(--cyan); position: relative; }
.scan .carline svg { width: 100%; height: 100%; }
.scan .carline::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40px; left: -40px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--cyan) 60%, transparent), transparent); animation: sweep 1.6s ease-in-out infinite; }
@keyframes sweep { to { left: 100%; } }
.scan .msg { font-weight: 650; }
.scan .msg2 { color: var(--muted); font-size: 13px; min-height: 20px; transition: opacity .3s; }
.ai-res { margin-top: 16px; display: grid; gap: 14px; }
.ai-block { padding: 14px 16px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); }
.ai-block h4 { margin: 0 0 8px; font-size: 14px; display: flex; gap: 8px; align-items: center; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: 12px; }
.ai-block p { margin: 0; }
.ai-block ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.ai-block.pros h4 { color: var(--good); } .ai-block.cons h4 { color: var(--bad); }
.ai-block.rec { border: 0; background: linear-gradient(var(--card-solid), var(--card-solid)) padding-box, var(--grad-ai) border-box; border: 2px solid transparent; }
.ai-meta { font-size: 12px; color: var(--faint); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ai-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.chat { display: grid; gap: 10px; margin-top: 14px; }
.msg-q, .msg-a { padding: 11px 14px; border-radius: 16px; max-width: 88%; white-space: pre-wrap; animation: up .35s var(--ease) both; }
.msg-q { justify-self: end; background: var(--grad); color: #fff; border-bottom-right-radius: 6px; }
.msg-a { justify-self: start; background: var(--card2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg-a small { display: block; color: var(--faint); margin-top: 6px; font-size: 11.5px; }
.ask-row { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.ask-row .vf { flex: 1; }
.ask-row .vf textarea { min-height: 46px; height: 46px; resize: none; }
.ask-row.listening .vf { border-color: var(--bad); }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ============ список машин ============ */
.cars { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.carcard {
  border-radius: var(--r); overflow: hidden; background: var(--card); border: 1px solid var(--line); cursor: pointer; position: relative; box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; text-decoration: none; color: var(--text); display: flex; flex-direction: column;
}
.carcard:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line2); }
.carcard .img { aspect-ratio: 16/10; background: var(--card2); position: relative; overflow: hidden; }
.carcard .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.carcard:hover .img img { transform: scale(1.05); }
.carcard .img .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.carcard .img .ph svg { width: 64px; height: 64px; opacity: .45; }
.carcard .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 99px; font-weight: 800; font-size: 13px; color: #fff; backdrop-filter: blur(8px); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.badge svg { width: 14px; height: 14px; }
.badge.bot { background: color-mix(in srgb, var(--c, #6f7dff) 85%, #000); }
.badge.aib { background: linear-gradient(135deg, #0891b2, #7c3aed); }
.carcard .fav { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .4); color: rgba(255, 255, 255, .8); display: grid; place-items: center; cursor: pointer; transition: transform .2s; }
.carcard .fav.on { color: #ffc531; }
.carcard .fav:active { transform: scale(.85); }
.carcard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.carcard h3 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.carcard .p { font-weight: 800; font-size: 18px; }
.carcard .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 13px; }
.carcard .cmp { position: absolute; bottom: 12px; right: 12px; }
.carcard .cmp input { width: 22px; height: 22px; accent-color: var(--accent); cursor: pointer; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { width: 120px; height: 120px; margin: 0 auto 14px; border-radius: 36px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 16px 40px rgba(124, 92, 255, .4); animation: float 4s ease-in-out infinite; }
.empty .big svg { width: 64px; height: 64px; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-3deg); } }
.searchbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.searchbar .vf { flex: 1; min-width: 220px; }
.cmpbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 35; display: flex; gap: 12px; align-items: center; padding: 10px 10px 10px 18px; border-radius: 18px; background: var(--card-solid); border: 1px solid var(--line2); box-shadow: var(--shadow); animation: up .3s var(--ease); }
@media (max-width: 1080px) { .cmpbar { bottom: 96px; } }

/* сравнение */
.cmp-table { overflow-x: auto; }
.cmp-table table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 560px; }
.cmp-table th, .cmp-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.cmp-table th { color: var(--muted); font-weight: 600; font-size: 13px; position: sticky; left: 0; background: var(--card-solid); min-width: 130px; }
.cmp-table thead td { font-weight: 800; font-size: 15px; }
.cmp-table td.best { color: var(--good); font-weight: 800; }
.cmp-table td.worst { color: var(--bad); }
.cmp-table thead img { width: 100%; max-width: 180px; aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 6px; }

/* ============ настройки / админка ============ */
.keys { display: grid; gap: 12px; }
.keyrow { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card2); }
@media (max-width: 700px) { .keyrow { grid-template-columns: 1fr; } }
.keyrow .pname { display: flex; gap: 10px; align-items: center; font-weight: 800; }
.keyrow .pname i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.keyrow .pname small { display: block; font-weight: 500; color: var(--faint); font-size: 12px; }
.status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.status.ok { color: var(--good); background: var(--good-bg); } .status.no { color: var(--faint); background: var(--card2); } .status.sh { color: var(--info); background: var(--info-bg); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.switch:last-child { border-bottom: 0; }
.switch p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.tgl { position: relative; width: 52px; height: 30px; flex: none; }
.tgl input { opacity: 0; width: 0; height: 0; position: absolute; }
.tgl span { position: absolute; inset: 0; border-radius: 99px; background: var(--line2); transition: background .25s; cursor: pointer; }
.tgl span::after { content: ''; position: absolute; width: 24px; height: 24px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: transform .3s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.tgl input:checked + span { background: var(--good); }
.tgl input:checked + span::after { transform: translateX(22px); }
.users { display: grid; gap: 10px; }
.urow { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); }
.urow.blocked { opacity: .65; border-style: dashed; }
.urow .avatar { width: 42px; height: 42px; }
.urow b { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.urow small { color: var(--muted); font-size: 12.5px; display: block; }
.urow .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .urow { grid-template-columns: 42px minmax(0, 1fr); } .urow .acts { grid-column: 1 / -1; justify-content: flex-start; } }
.tag-s { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line2); color: var(--muted); }
.tag-s.adm { color: var(--accent2); border-color: color-mix(in srgb, var(--accent2) 50%, transparent); }
.tag-s.blk { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }

/* ============ вход ============ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: linear-gradient(150deg, #1d2a6b 0%, #4b2a8c 55%, #8a2a6d 100%); }
.auth-hero h1 { font-size: clamp(30px, 4vw, 50px); letter-spacing: -.04em; line-height: 1.05; margin: 30px 0 14px; max-width: 520px; }
.auth-hero p { color: rgba(255, 255, 255, .78); max-width: 470px; font-size: 16px; }
.auth-hero .feats { display: grid; gap: 12px; margin-top: 26px; max-width: 470px; }
.auth-hero .feats div { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(8px); }
.auth-hero .feats svg { width: 22px; height: 22px; flex: none; }
.road { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none; }
.road .lane { position: absolute; bottom: 40px; left: 0; width: 200%; height: 4px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .35) 0 40px, transparent 40px 80px); animation: lane 1.2s linear infinite; }
.road .car { position: absolute; bottom: 46px; left: 10%; width: 120px; height: 60px; color: #fff; animation: drive 9s ease-in-out infinite; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .35)); }
.road .car svg { width: 100%; height: 100%; }
@keyframes lane { to { transform: translateX(-80px); } }
@keyframes drive { 0%, 100% { left: 8%; } 50% { left: 62%; } }
.auth-main { display: grid; place-items: center; padding: 30px 18px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box .brand { margin-bottom: 26px; }
.auth-box h2 { font-size: 28px; letter-spacing: -.03em; margin: 0 0 4px; }
.auth-box .sub { color: var(--muted); margin: 0 0 22px; }
.auth-box form { display: grid; gap: 14px; }
.auth-switch { text-align: center; margin-top: 16px; color: var(--muted); }
.auth-switch button { border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; }
.err { color: var(--bad); background: var(--bad-bg); padding: 10px 14px; border-radius: 12px; font-size: 14px; animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 26px 20px 120px; }
  .auth-hero h1 { margin-top: 18px; font-size: 30px; }
  .auth-hero .feats { display: none; }
}

/* ============ уведомления, модалка ============ */
#toasts { position: fixed; top: 76px; right: 16px; z-index: 100; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--card-solid); border: 1px solid var(--line2); box-shadow: var(--shadow); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; animation: tin .4s var(--ease); }
.toast.out { animation: tout .3s ease forwards; }
.toast svg { width: 20px; height: 20px; flex: none; }
.toast.good svg { color: var(--good); } .toast.bad svg { color: var(--bad); } .toast.info svg { color: var(--info); }
@keyframes tin { from { opacity: 0; transform: translateX(30px); } }
@keyframes tout { to { opacity: 0; transform: translateX(30px); } }
#hint { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 90; padding: 10px 18px; border-radius: 99px; background: var(--card-solid); border: 1px solid var(--bad); box-shadow: var(--shadow); font-weight: 600; max-width: calc(100vw - 32px); }
dialog#modal { border: 1px solid var(--line2); border-radius: 22px; background: var(--card-solid); color: var(--text); padding: 24px; width: min(460px, calc(100vw - 28px)); box-shadow: var(--shadow); }
dialog#modal::backdrop { background: rgba(5, 8, 20, .6); backdrop-filter: blur(4px); }
dialog#modal[open] { animation: pop .3s var(--ease); }
dialog#modal h3 { margin: 0 0 8px; }
dialog#modal p { color: var(--muted); margin: 0 0 16px; }
.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, .9); display: grid; place-items: center; animation: fadein .2s; cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 10px; }

.skel { background: linear-gradient(90deg, var(--card2) 25%, color-mix(in srgb, var(--text) 8%, transparent) 50%, var(--card2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.muted { color: var(--muted); }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; }
.sticky-act { position: sticky; bottom: 12px; z-index: 5; display: flex; gap: 10px; justify-content: flex-end; padding: 12px; border-radius: 18px; background: color-mix(in srgb, var(--card-solid) 85%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: var(--shadow); margin-top: 16px; }
@media (max-width: 1080px) { .sticky-act { bottom: 92px; } .sticky-act .btn { flex: 1; } }

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

.car-hero > .card, .score-card .txt, .editor > div { min-width: 0; }
.spec { max-width: 100%; overflow-wrap: anywhere; }
html, body { max-width: 100%; overflow-x: hidden; }
.row.between > .row { justify-content: flex-end; }
.ring-wrap { flex: none; }
@media (max-width: 1020px) {
  .editor .side .card.tiny { display: none; }
  .live { padding: 14px 16px; text-align: left; }
  .live h3 { justify-content: flex-start; margin-bottom: 6px; }
  #live-body { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; }
  #live-body > p, #live-body > .meter:first-of-type:last-child { grid-column: 1 / -1; }
  #live-body .ring-wrap { --size: 84px !important; grid-row: span 4; margin: 0; }
  #live-body .why { display: none; }
  #live-body .verdict-pill { justify-self: start; margin-top: 0; }
  .editor .side { position: sticky; top: 64px; z-index: 6; }
}
.cmpbar b { white-space: nowrap; }
@media (max-width: 640px) { .cmpbar { left: 12px; right: 12px; transform: none; justify-content: space-between; } }
.shell { grid-template-columns: minmax(0, 1fr); }
