:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #121826;
  --muted: #667085;
  --border: #e4e7ec;
  --accent: #ff5a1f;
  --accent-hover: #e94c14;
  --accent-soft: #fff1eb;
  --ok: #12a150;
  --ok-soft: #e8f7ef;
  --warn: #b7791f;
  --warn-soft: #fdf5e6;
  --danger: #d92d20;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161a21;
    --surface-2: #1e232c;
    --text: #e8ebf0;
    --muted: #98a2b3;
    --border: #2a303b;
    --accent-soft: #3a1d12;
    --ok-soft: #10301f;
    --warn-soft: #33270f;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 28px; letter-spacing: -.02em; }
h2 { font-size: 20px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.header .container { display: flex; align-items: center; gap: 20px; height: 60px; }
.logo { font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: -.02em; white-space: nowrap; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { text-decoration: none; padding: 7px 12px; border-radius: 9px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 10px; white-space: nowrap; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-lg { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger { color: var(--danger); }
.inline { display: inline; }

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
input[type=text], input[type=number], input:not([type]), select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- layout blocks ---------- */
.page { padding: 28px 0 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-error { background: #fdecea; color: var(--danger); }
.alert a { font-weight: 600; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- listing cards ---------- */
.feed { display: flex; flex-direction: column; gap: 12px; }
.card {
  display: grid; grid-template-columns: 220px 1fr; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px; text-decoration: none;
}
.card.fresh { animation: flash 2.5s ease-out; }
@keyframes flash { from { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); } }
.card-img { aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.card-title { font-size: 17px; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.card-price { font-size: 18px; font-weight: 800; white-space: nowrap; }
.card-meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.src { font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 6px; color: #fff; }
.src-drom { background: #d7262e; }
.src-autoru { background: #1e2a38; }
.src-avito { background: #00aaff; }
.src-youla { background: #7b3cff; }

.empty { text-align: center; padding: 48px 20px; }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ---------- filters ---------- */
.filter-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.filter-row:last-child { border-bottom: 0; }
.filter-row .info { flex: 1; min-width: 0; }
.filter-row .name { font-weight: 700; }
.filter-row.off { opacity: .55; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); cursor: pointer; font-weight: 500; user-select: none; }
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); }

/* ---------- landing ---------- */
.hero { padding: 72px 0 48px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 50px); max-width: 820px; margin: 0 auto 18px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.sources-strip { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.sources-strip .src { font-size: 14px; padding: 6px 14px; border-radius: 8px; }
.section { padding: 48px 0; }
.section h2 { text-align: center; font-size: 28px; margin-bottom: 28px; }
.feature .icon { font-size: 26px; margin-bottom: 8px; }
.feature h3 { font-size: 17px; }
.step-num { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-weight: 800; margin-bottom: 10px; }

.plan-card { display: flex; flex-direction: column; gap: 12px; position: relative; }
.plan-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-card .price { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.plan-card .price small { font-size: 15px; color: var(--muted); font-weight: 500; }
.plan-card ul { list-style: none; padding: 0; margin: 0; }
.plan-card li { padding: 4px 0 4px 24px; position: relative; }
.plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.plan-card .ribbon { position: absolute; top: -11px; right: 16px; }

/* ---------- extended public landing ---------- */
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 34px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.metric-grid > div { min-height: 104px; padding: 20px; border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; }
.metric-grid > div:last-child { border: 0; }
.metric-grid b { font-size: 27px; line-height: 1; letter-spacing: -.03em; }
.metric-grid span { color: var(--muted); font-size: 13px; margin-top: 6px; }
.demo-feed { max-width: 880px; margin: 0 auto; }
.car-placeholder { background: linear-gradient(140deg, #c8ced1, #737b7d 45%, #e4e0d6); color: rgba(255,255,255,.92); font-size: 13px; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,.55); }
.car-placeholder-dark { background: linear-gradient(140deg, #1d2026, #5c6470 46%, #bab1a7); }
.demo-note { max-width: 880px; margin: 14px auto 0; text-align: right; }
.audience { align-items: start; }
.audience-list { display: grid; gap: 12px; }
.audience-list .panel { padding: 16px 20px; }
.audience-list p { margin: 5px 0 0; font-size: 14px; }
.faq { padding-top: 60px; }
.faq details { margin-bottom: 10px; padding: 0; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 20px; font-weight: 700; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary span { color: var(--accent); font-size: 19px; line-height: 1; }
.faq details p { margin: -4px 20px 18px; max-width: 780px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }
.stat .num { font-size: 28px; font-weight: 800; }

.login-box { max-width: 440px; margin: 40px auto; text-align: center; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .header .container { gap: 10px; }
  .header-right .who { display: none; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .card { grid-template-columns: 1fr; }
  .card-top { flex-direction: column; gap: 2px; }
  .hero { padding: 44px 0 28px; }
  .filter-row { flex-wrap: wrap; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-grid > div { min-height: 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .metric-grid > div:last-child { border-bottom: 0; }
  .demo-note { text-align: left; }
}
