:root {
  --bg: #f5f6f8; --card: #fff; --text: #1a1d23; --muted: #626b7a; --line: #e3e6eb;
  --accent: #1f5eff; --accent-soft: #e8eeff; --good: #0a8a4a; --good-soft: #e3f6ec;
  --bad: #c2362b; --bad-soft: #fdecea; --warn: #a86400; --warn-soft: #fff4e0;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318; --card: #1a1d24; --text: #e8eaee; --muted: #98a0ad; --line: #2b303a;
    --accent: #6b93ff; --accent-soft: #1e2944; --good: #4cc98a; --good-soft: #15301f;
    --bad: #ff7a6e; --bad-soft: #3a1c1a; --warn: #f0b45a; --warn-soft: #33260f;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.8rem; } h2 { font-size: 1.3rem; margin-top: 1.6em; } h3 { font-size: 1.05rem; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; }
.nav { display: flex; gap: 4px; overflow-x: auto; }
.nav a { padding: 8px 12px; border-radius: 9px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.nav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.badge[hidden] { display: none; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: .75rem; text-align: center; }
main { padding-top: 24px; padding-bottom: 48px; min-height: 70vh; outline: none; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 16px 0 32px; }

/* buttons, chips */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.sm { padding: 5px 10px; font-size: .87rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: .87rem; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: .8rem; color: var(--muted); white-space: nowrap; }
.tag.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* catalog */
.hero { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.hero p { margin: 0; color: var(--muted); }
.layout { display: grid; grid-template-columns: 270px 1fr; gap: 24px; align-items: start; }
.filters { position: sticky; top: 80px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); max-height: calc(100vh - 100px); overflow: auto; }
.filters summary { font-weight: 600; cursor: pointer; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.fgroup { margin-top: 16px; }
.fgroup > label, .fgroup > .flabel { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
input[type=search], input[type=number], select { width: 100%; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.range-val { font-weight: 600; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select { width: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.09); }
.card .ph { aspect-ratio: 16/10; background: var(--bg); position: relative; display: block; overflow: hidden; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.ph-none { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .brand { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card h3 { margin: 0; font-size: 1.08rem; }
.card h3 a { color: var(--text); }
.price { font-weight: 700; font-size: 1.2rem; }
.price small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: .85rem; }
.kv span { color: var(--muted); }
.card .actions { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
.empty { padding: 48px; text-align: center; color: var(--muted); background: var(--card); border-radius: var(--radius); border: 1px dashed var(--line); }

/* model page */
.crumbs { font-size: .87rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.model-head { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; }
.gallery .main { aspect-ratio: 16/10; border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); cursor: zoom-in; }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.thumbs button { flex: 0 0 96px; aspect-ratio: 16/10; padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden; cursor: pointer; background: var(--card); }
.thumbs button.on { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.credit-line { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 14px; }
.big-price { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.quick div { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.quick b { display: block; font-size: 1.05rem; }
.quick span { font-size: .78rem; color: var(--muted); }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 22px 0 0; position: sticky; top: 60px; z-index: 5; background: var(--bg); padding: 8px 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
table { width: 100%; border-collapse: collapse; }
.specs td, .specs th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.specs th { font-weight: 500; color: var(--muted); width: 45%; }
ul.check { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
ul.check li { padding: 3px 0 3px 22px; position: relative; break-inside: avoid; }
ul.check li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 700; }
ul.plus li::marker { content: "+  "; color: var(--good); font-weight: 700; }
ul.minus li::marker { content: "−  "; color: var(--bad); font-weight: 700; }
.note { background: var(--warn-soft); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: .87rem; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.pager a { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--text); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .r { text-align: right; }
.sources { font-size: .85rem; word-break: break-all; }

/* tables (credit, compare, dealers) */
.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tbl { font-size: .88rem; }
.tbl th, .tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl thead th { background: var(--bg); font-weight: 600; position: sticky; top: 0; white-space: nowrap; }
.tbl tr.group td { background: var(--accent-soft); font-weight: 700; }
.tbl tr.expired td { opacity: .55; }
.cmp th.rowh { color: var(--muted); font-weight: 500; white-space: nowrap; position: sticky; left: 0; background: var(--card); }
.cmp td { min-width: 190px; }
.cmp .best { color: var(--good); font-weight: 700; }
.cmp .ph { aspect-ratio: 16/10; border-radius: 9px; overflow: hidden; background: var(--bg); margin-bottom: 6px; }
.cmp .ph img { width: 100%; height: 100%; object-fit: cover; }

/* calculator */
.calc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; }
.calc label { font-size: .8rem; color: var(--muted); display: block; margin-bottom: 4px; }
.calc-out { margin-top: 12px; font-size: 1.05rem; }
.calc-out b { font-size: 1.4rem; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 50; display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lb-close { position: absolute; top: 12px; right: 18px; font-size: 2rem; color: #fff; background: none; border: 0; cursor: pointer; }

@media (max-width: 900px) {
  .layout, .model-head, .cols { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  .calc { grid-template-columns: 1fr 1fr; }
  ul.check { columns: 1; }
  .top-in { gap: 12px; }
  .logo span:last-child { display: none; }
}
@media (max-width: 520px) {
  h1 { font-size: 1.45rem; }
  .quick { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr; }
}
