/* CarDecision Design System — modern automotive, mobile-first */
:root {
  --brand-ink: #0B1F33;
  --brand-navy: #123A56;
  --brand-steel: #1E5A7A;
  --brand-accent: #E85D04;
  --brand-accent-dark: #C44D03;
  --brand-teal: #0F766E;
  --brand-sand: #F3F1EC;
  --brand-mist: #E8EEF2;
  --brand-white: #FFFFFF;
  --brand-muted: #5B6B7A;
  --brand-line: #D5DEE6;
  --brand-success: #0F7A4A;
  --brand-danger: #B42318;
  --brand-warning: #B54708;

  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.35rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: clamp(2.2rem, 5vw, 3.25rem);

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 8px 28px rgba(11, 31, 51, 0.08);
  --shadow-lg: 0 16px 40px rgba(11, 31, 51, 0.12);
  --container: 1160px;
  --header-h: 72px;
  --bottom-nav-h: 64px;
  --space: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--brand-ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(30, 90, 122, 0.12), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(232, 93, 4, 0.08), transparent 50%),
    linear-gradient(180deg, #F7F9FB 0%, var(--brand-sand) 100%);
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav-h) + 12px);
}
@media (min-width: 900px) {
  body { padding-bottom: 0; }
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-steel); text-decoration: none; }
a:hover { color: var(--brand-accent); }
h1,h2,h3,h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
p { margin: 0 0 1rem; color: var(--brand-muted); }
.container { width: min(100% - 1.5rem, var(--container)); margin-inline: auto; }
.section { padding: 2.5rem 0; }
.section-head { margin-bottom: 1.25rem; }
.section-head p { max-width: 60ch; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--brand-line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h); gap: 1rem;
}
.brand {
  display: flex; flex-direction: column; gap: 0;
  color: var(--brand-ink); font-family: var(--font-display); font-weight: 800;
}
.brand-name { font-size: 1.25rem; letter-spacing: -0.03em; }
.brand-tag { font-size: 0.68rem; font-weight: 600; color: var(--brand-muted); letter-spacing: 0.02em; }
.nav-desktop { display: none; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
@media (min-width: 1100px) {
  .nav-desktop { display: flex; }
}
.nav-desktop a {
  color: var(--brand-ink); font-size: 0.82rem; font-weight: 600;
  padding: 0.4rem 0.55rem; border-radius: 999px;
}
.nav-desktop a:hover, .nav-desktop a.active { background: var(--brand-mist); color: var(--brand-navy); }
.header-cta { display: flex; gap: 0.5rem; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 1px solid transparent; border-radius: 10px;
  padding: 0.72rem 1.15rem; font-weight: 700; font-family: var(--font-body);
  font-size: 0.95rem; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  text-decoration: none; line-height: 1.2;
}
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline: 3px solid rgba(232, 93, 4, 0.35); outline-offset: 2px;
}
.btn-primary { background: var(--brand-accent); color: #fff; }
.btn-primary:hover { background: var(--brand-accent-dark); color: #fff; }
.btn-secondary { background: #123A56; color: #fff; }
.btn-secondary:hover { background: #0B1F33; color: #fff; }
.btn-outline {
  background: transparent; border-color: var(--brand-line); color: var(--brand-ink);
}
.btn-outline:hover { border-color: var(--brand-steel); color: var(--brand-steel); }
.btn-lg { padding: 0.9rem 1.4rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* Cards */
.card {
  background: var(--brand-white);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-body { padding: 1.1rem 1.2rem; }
.card-media {
  aspect-ratio: 16/10;
  background:
    linear-gradient(135deg, var(--brand-navy), var(--brand-steel)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 10px, transparent 10px 20px);
  display: grid; place-items: center; color: rgba(255,255,255,.85);
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
}
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.02em;
  background: var(--brand-mist); color: var(--brand-navy);
}
.badge-demo { background: #FEF3C7; color: #92400E; }
.badge-estimated { background: #E0F2FE; color: #075985; }
.badge-reported { background: #EDE9FE; color: #5B21B6; }
.badge-verified { background: #D1FAE5; color: #065F46; }
.badge-rumour { background: #FEE2E2; color: #991B1B; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: var(--fs-sm); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--brand-line); border-radius: 10px;
  padding: 0.8rem 0.9rem; font: inherit; background: #fff; color: var(--brand-ink);
  min-height: 48px;
}
.textarea { min-height: 120px; resize: vertical; }
.range {
  width: 100%; accent-color: var(--brand-accent);
}
.form-hint { font-size: var(--fs-sm); color: var(--brand-muted); margin-top: 0.25rem; }
.form-row { display: grid; gap: 1rem; }
@media (min-width: 720px) {
  .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--brand-line); border-radius: var(--radius); background: #fff; }
table.data {
  width: 100%; border-collapse: collapse; min-width: 640px; font-size: var(--fs-sm);
}
table.data th, table.data td {
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--brand-line); text-align: left; vertical-align: top;
}
table.data th { background: var(--brand-mist); font-family: var(--font-display); font-weight: 700; }
table.data tr:last-child td { border-bottom: 0; }
table.data .winner { background: rgba(15, 122, 74, 0.08); font-weight: 700; }

/* Tabs */
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab {
  border: 1px solid var(--brand-line); background: #fff; border-radius: 999px;
  padding: 0.5rem 0.9rem; font-weight: 600; cursor: pointer; color: var(--brand-ink);
}
.tab.active, .tab[aria-selected="true"] { background: var(--brand-ink); color: #fff; border-color: var(--brand-ink); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(11,31,51,.55); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg); width: min(560px, 100%);
  box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto;
}
.modal-header, .modal-footer { padding: 1rem 1.2rem; border-bottom: 1px solid var(--brand-line); display: flex; justify-content: space-between; align-items: center; }
.modal-footer { border-bottom: 0; border-top: 1px solid var(--brand-line); }
.modal-body { padding: 1.2rem; }

/* Toast */
.toast-wrap { position: fixed; right: 1rem; bottom: calc(var(--bottom-nav-h) + 1rem); z-index: 120; display: grid; gap: 0.5rem; }
@media (min-width: 900px) { .toast-wrap { bottom: 1rem; } }
.toast {
  background: var(--brand-ink); color: #fff; padding: 0.85rem 1rem; border-radius: 10px;
  box-shadow: var(--shadow); min-width: 240px; font-size: var(--fs-sm);
}
.toast.success { background: var(--brand-success); }
.toast.error { background: var(--brand-danger); }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, #e8eef2 25%, #f7f9fb 37%, #e8eef2 63%);
  background-size: 400% 100%; animation: shimmer 1.2s ease infinite;
  border-radius: 8px; min-height: 1rem;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Empty / Error */
.empty-state, .error-state {
  text-align: center; padding: 2.5rem 1.25rem; background: #fff;
  border: 1px dashed var(--brand-line); border-radius: var(--radius);
}
.empty-state h3, .error-state h3 { margin-bottom: 0.4rem; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  padding: 2.5rem 0 2rem;
  background:
    linear-gradient(120deg, rgba(11,31,51,0.92), rgba(18,58,86,0.85)),
    url('../images/hero-cars.svg') center/cover no-repeat;
  color: #fff; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.hero h1 { color: #fff; max-width: 14ch; }
.hero p { color: rgba(255,255,255,0.86); max-width: 42ch; font-size: var(--fs-lg); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.4rem; }
.hero .btn-outline { border-color: rgba(255,255,255,0.45); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,0.1); color: #fff; }
.price { font-family: var(--font-display); font-weight: 800; color: var(--brand-ink); font-size: 1.15rem; }
.price-note { font-size: var(--fs-xs); color: var(--brand-muted); }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.chip {
  background: var(--brand-mist); color: var(--brand-navy); border-radius: 999px;
  padding: 0.25rem 0.6rem; font-size: var(--fs-xs); font-weight: 600;
}

/* Result cards */
.result-card {
  background: #fff; border: 1px solid var(--brand-line); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow);
}
.result-card.top-match { border-color: var(--brand-accent); box-shadow: 0 0 0 2px rgba(232,93,4,0.15), var(--shadow); }
.match-pct {
  font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--brand-accent);
}

/* Bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,0.97); border-top: 1px solid var(--brand-line);
  height: var(--bottom-nav-h); backdrop-filter: blur(8px);
}
@media (min-width: 900px) { .bottom-nav { display: none; } }
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.15rem; font-size: 0.68rem; font-weight: 700; color: var(--brand-muted);
}
.bottom-nav a.active, .bottom-nav a:hover { color: var(--brand-accent); }
.bottom-nav svg { width: 20px; height: 20px; }

/* Footer */
.site-footer {
  background: var(--brand-ink); color: rgba(255,255,255,0.82); padding: 3rem 0 2rem; margin-top: 2rem;
}
.site-footer a { color: rgba(255,255,255,0.82); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-col h4 { color: #fff; font-size: 0.95rem; margin-bottom: 0.75rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.footer-col li { font-size: var(--fs-sm); }
.footer-bottom {
  margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.12);
  font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between;
}

/* Ads */
.ad-slot {
  margin: 1.25rem 0; border: 1px dashed var(--brand-line); border-radius: 8px;
  background: #fafbfc; text-align: center; padding: 0.5rem;
}
.ad-label { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: #8a97a5; margin-bottom: 0.35rem; }
.ad-frame { display: grid; place-items: center; }
.ad-reserved { color: #9aa6b2; font-size: 0.8rem; padding: 1rem; }
.ad-top, .ad-header { min-height: 90px; }
.ad-in-content { min-height: 250px; }
.ad-sidebar { min-height: 250px; }
.ad-calculator-result { min-height: 100px; }
.ad-article { min-height: 280px; }
.ad-footer { min-height: 90px; }

.demo-banner {
  background: #FEF3C7; color: #92400E; text-align: center;
  padding: 0.45rem 1rem; font-size: var(--fs-sm); font-weight: 600;
}
.breadcrumb { font-size: var(--fs-sm); color: var(--brand-muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--brand-steel); }
.faq details {
  background: #fff; border: 1px solid var(--brand-line); border-radius: 10px;
  padding: 0.85rem 1rem; margin-bottom: 0.6rem;
}
.faq summary { cursor: pointer; font-weight: 700; color: var(--brand-ink); }
.sticky-cta {
  position: sticky; bottom: calc(var(--bottom-nav-h) + 8px); z-index: 40;
  background: rgba(255,255,255,0.95); border: 1px solid var(--brand-line);
  border-radius: 12px; padding: 0.75rem; box-shadow: var(--shadow); margin-top: 1rem;
}
@media (min-width: 900px) { .sticky-cta { bottom: 1rem; } }

.prose { max-width: 75ch; }
.prose h2, .prose h3 { margin-top: 1.5rem; }
.notice {
  background: #EFF6FF; border-left: 4px solid var(--brand-steel);
  padding: 0.85rem 1rem; border-radius: 0 8px 8px 0; margin: 1rem 0; color: var(--brand-navy);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.more-drawer {
  display: none; position: fixed; inset: auto 0 0 0; z-index: 70;
  background: #fff; border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg);
  padding: 1rem 1rem calc(var(--bottom-nav-h) + 1rem); max-height: 70vh; overflow: auto;
}
.more-drawer.open { display: block; }
.more-drawer a { display: block; padding: 0.7rem 0; border-bottom: 1px solid var(--brand-line); color: var(--brand-ink); font-weight: 600; }

/* Admin minimal */
.admin-body { background: #eef2f5; padding-bottom: 0; }
.admin-shell { display: grid; min-height: 100vh; }
@media (min-width: 900px) { .admin-shell { grid-template-columns: 240px 1fr; } }
.admin-side { background: var(--brand-ink); color: #fff; padding: 1.25rem; }
.admin-side a { color: rgba(255,255,255,.85); display: block; padding: 0.45rem 0; font-size: 0.9rem; }
.admin-main { padding: 1.25rem; }
.admin-main h1 { font-size: var(--fs-2xl); }
.admin-side a[aria-current="page"] { color: #fff; font-weight: 700; }
.admin-login { max-width: 400px; margin: 4rem auto; padding: 0 1rem; }
.admin-login h1 { font-size: var(--fs-2xl); }
.admin-card {
  background: #fff; border: 1px solid var(--brand-line); border-radius: var(--radius);
  padding: 1.25rem; margin: 1rem 0;
}
.admin-flash { padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin: 0.75rem 0; font-size: var(--fs-sm); }
.admin-flash-success { background: #e8f6ef; color: var(--brand-success); }
.admin-flash-error { background: #fdecea; color: var(--brand-danger); }
.admin-flash-warn, .admin-banner-warn { background: #fff4e5; color: var(--brand-warning); }
.admin-banner { padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin: 0.75rem 0; }
.admin-banner a { font-weight: 700; }
.admin-check { display: inline-flex; align-items: center; gap: 0.4rem; margin-right: 1rem; font-size: var(--fs-sm); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.admin-actions form { display: inline; }
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.admin-table th, .admin-table td { padding: 0.55rem 0.7rem; text-align: left; border-bottom: 1px solid var(--brand-line); vertical-align: top; }
.admin-table th { background: var(--brand-mist); font-weight: 700; }
.admin-table tr:hover td { background: rgba(255,255,255,0.7); }
.btn-danger { background: var(--brand-danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.92); color: #fff; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: var(--fs-xs); }
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { background: #fff; border-radius: 12px; padding: 1rem; border: 1px solid var(--brand-line); }
.stat strong { display: block; font-size: 1.5rem; font-family: var(--font-display); }

.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  background: #fff; border: 1px solid var(--brand-line); border-radius: 10px;
  box-shadow: var(--shadow); display: none; max-height: 280px; overflow: auto;
}
.search-suggest.open { display: block; }
.search-suggest a { display: block; padding: 0.7rem 0.9rem; color: var(--brand-ink); border-bottom: 1px solid var(--brand-line); }
.search-suggest a:hover { background: var(--brand-mist); }
.search-wrap { position: relative; }

/* ========== UX system: images, hierarchy, Fitts, proximity, a11y ========== */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--brand-accent); color: #fff; padding: 0.75rem 1rem; font-weight: 700;
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

.btn-touch, .btn-lg { min-height: 48px; min-width: 48px; padding: 0.85rem 1.25rem; }
.input-lg { min-height: 52px; font-size: 1.05rem; }

.nav-more { position: relative; }
.nav-more-btn {
  border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 0.82rem;
  color: var(--brand-ink); padding: 0.45rem 0.65rem; border-radius: 999px; cursor: pointer;
  min-height: 40px;
}
.nav-more-btn:hover, .nav-more-btn[aria-expanded=\"true\"] { background: var(--brand-mist); }
.nav-more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px;
  background: #fff; border: 1px solid var(--brand-line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 0.4rem; z-index: 60;
  display: grid; gap: 0.15rem;
}
.nav-more-menu[hidden] { display: none !important; }
.nav-more-menu a {
  display: block; padding: 0.65rem 0.8rem; border-radius: 8px; color: var(--brand-ink);
  font-size: 0.9rem; font-weight: 600;
}
.nav-more-menu a:hover { background: var(--brand-mist); color: var(--brand-navy); }

.hero-split, .hero-car-detail {
  background:
    linear-gradient(120deg, rgba(11,31,51,0.94), rgba(18,58,86,0.88)),
    url('../images/hero-cars.svg') center/cover no-repeat;
}
.hero-grid {
  display: grid; gap: 1.5rem; align-items: center;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 2rem; }
}
.hero-kicker {
  color: rgba(255,255,255,0.75); font-size: var(--fs-sm); font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.5rem;
}
.hero-copy h1 { max-width: 14ch; }
.hero-visual {
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}
.hero-visual img {
  width: 100%; height: auto; aspect-ratio: 16/10; object-fit: cover; display: block;
}
.image-attribution {
  margin: 0;
  padding: 0.45rem 0.75rem 0.55rem;
  font-size: var(--fs-xs);
  color: var(--brand-muted);
  background: rgba(0, 0, 0, 0.04);
  border-top: 1px solid var(--brand-line);
  line-height: 1.35;
}
.image-attribution a {
  color: var(--brand-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.image-attribution--tiny {
  margin-top: 0.35rem;
  padding: 0;
  background: transparent;
  border: 0;
  font-size: 0.7rem;
  opacity: 0.85;
}
.hero-car-detail .hero-visual .image-attribution {
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-muted);
}
.hero-search {
  display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.35rem; max-width: 560px;
}
.hero-search .input { flex: 1 1 220px; }
.hero-search .btn { flex: 0 0 auto; }

.quick-actions {
  display: grid; gap: 0.75rem; grid-template-columns: 1fr 1fr;
  margin-bottom: 2rem;
}
@media (min-width: 800px) {
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
}
.quick-action {
  display: flex; flex-direction: column; gap: 0.15rem;
  background: #fff; border: 1px solid var(--brand-line); border-radius: var(--radius);
  padding: 1rem 1.1rem; min-height: 72px; box-shadow: var(--shadow);
  color: var(--brand-ink); transition: border-color .15s, transform .15s;
}
.quick-action:hover { border-color: var(--brand-accent); color: var(--brand-ink); transform: translateY(-1px); }
.quick-action span { font-family: var(--font-display); font-weight: 700; }
.quick-action small { color: var(--brand-muted); font-size: var(--fs-xs); }

.find-cta-band {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
  margin-bottom: 2.5rem;
  background: linear-gradient(135deg, #fff, var(--brand-mist));
}
.find-cta-band h2 { margin: 0 0 0.35rem; }
.find-cta-band p { margin: 0; max-width: 48ch; }

/* Car cards — Aesthetic-Usability + recognition */
.car-card {
  color: inherit; display: flex; flex-direction: column; height: 100%;
  transition: transform .15s ease, box-shadow .15s ease;
  text-decoration: none;
}
.car-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-lg); color: inherit;
}
.car-card:focus-visible { outline: 3px solid rgba(232, 93, 4, 0.45); outline-offset: 3px; }
.card-media {
  position: relative; aspect-ratio: 16/10; overflow: hidden;
  background: linear-gradient(145deg, #d7e0e8, #eef3f7);
}
.card-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.car-card:hover .card-media img { transform: scale(1.04); }
.card-badge {
  position: absolute; left: 0.7rem; top: 0.7rem; z-index: 2;
  background: var(--brand-ink); color: #fff; font-size: 0.7rem; font-weight: 800;
  padding: 0.3rem 0.55rem; border-radius: 999px; letter-spacing: 0.02em;
}
.car-card-title {
  font-size: 1.05rem; margin: 0 0 0.4rem; color: var(--brand-ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.car-card-cta {
  display: inline-flex; margin-top: 0.75rem; font-weight: 700; font-size: var(--fs-sm);
  color: var(--brand-accent);
}
.car-card-grid > .empty-state { min-height: 180px; }

.match-list { display: grid; gap: 1rem; }
.match-card {
  display: grid; gap: 1rem; padding: 0; overflow: hidden;
}
@media (min-width: 720px) {
  .match-card { grid-template-columns: 0.9fr 1.1fr; align-items: stretch; }
}
.match-card-media { background: var(--brand-mist); min-height: 160px; }
.match-card-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16/10; display: block; }
.match-card-body { padding: 1.15rem 1.2rem; }

/* Filter proximity grouping */
.filter-panel {
  background: #fff; border: 1px solid var(--brand-line); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
.filter-panel .form-row { align-items: end; }

@media (prefers-reduced-motion: reduce) {
  .car-card, .car-card .card-media img, .quick-action { transition: none; }
  .car-card:hover { transform: none; }
  .car-card:hover .card-media img { transform: none; }
}

/* ========== Dark theme (data-theme on <html>) ========== */
html[data-theme="dark"] {
  --brand-ink: #E8EEF4;
  --brand-navy: #B8D0E0;
  --brand-steel: #7EB8D4;
  --brand-accent: #FF7A2F;
  --brand-accent-dark: #E85D04;
  --brand-teal: #2DD4BF;
  --brand-sand: #0F1720;
  --brand-mist: #1A2634;
  --brand-white: #15202B;
  --brand-muted: #A0B0C0;
  --brand-line: #2A3A4A;
  --brand-success: #34D399;
  --brand-danger: #F87171;
  --brand-warning: #FBBF24;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(30, 90, 122, 0.22), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(232, 93, 4, 0.12), transparent 50%),
    linear-gradient(180deg, #0B1218 0%, #121C28 100%);
  color: var(--brand-ink);
}
html[data-theme="dark"] .site-header {
  background: rgba(15, 23, 32, 0.94);
  border-bottom-color: var(--brand-line);
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .error-state,
html[data-theme="dark"] .faq details,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .filter-panel,
html[data-theme="dark"] .quick-action,
html[data-theme="dark"] .sticky-cta,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .search-suggest,
html[data-theme="dark"] .nav-more-menu,
html[data-theme="dark"] .more-drawer,
html[data-theme="dark"] .modal {
  background: var(--brand-white);
  border-color: var(--brand-line);
}
html[data-theme="dark"] .input,
html[data-theme="dark"] .select,
html[data-theme="dark"] .textarea,
html[data-theme="dark"] .tab {
  background: #0F1720;
  color: var(--brand-ink);
  border-color: var(--brand-line);
}
html[data-theme="dark"] .bottom-nav {
  background: rgba(15, 23, 32, 0.97);
  border-top-color: var(--brand-line);
}
html[data-theme="dark"] .notice {
  background: #1A2F42;
  color: #DCE9F4;
}
html[data-theme="dark"] .find-cta-band {
  background: linear-gradient(135deg, #15202B, #1A2634);
}
html[data-theme="dark"] .ad-slot {
  background: #121C28;
}
html[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #1a2634 25%, #243244 37%, #1a2634 63%);
  background-size: 400% 100%;
}
html[data-theme="dark"] .btn-outline {
  color: var(--brand-ink);
  border-color: var(--brand-line);
}
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
html:not([data-theme="dark"]) .theme-icon-sun { display: none; }
html:not([data-theme="dark"]) .theme-icon-moon { display: block; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  border: 1px solid var(--brand-line); border-radius: 10px;
  background: var(--brand-white); color: var(--brand-ink);
  cursor: pointer; transition: background .15s, border-color .15s, transform .12s;
}
.theme-toggle:hover { border-color: var(--brand-steel); background: var(--brand-mist); }
.theme-toggle:active { transform: scale(0.96); }
.theme-toggle:focus-visible {
  outline: 3px solid rgba(232, 93, 4, 0.55); outline-offset: 2px;
}
html[data-theme="dark"] .theme-toggle:focus-visible {
  outline-color: rgba(255, 122, 47, 0.7);
}

/* High-contrast focus rings (both themes) */
:focus-visible {
  outline: 3px solid rgba(232, 93, 4, 0.55);
  outline-offset: 2px;
}
html[data-theme="dark"] :focus-visible {
  outline-color: rgba(255, 122, 47, 0.75);
}
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .textarea:focus-visible,
.theme-toggle:focus-visible, .field-info-btn:focus-visible, .car-card:focus-visible {
  outline: 3px solid rgba(232, 93, 4, 0.55);
  outline-offset: 2px;
}
html[data-theme="dark"] .btn:focus-visible,
html[data-theme="dark"] .input:focus-visible,
html[data-theme="dark"] .select:focus-visible,
html[data-theme="dark"] .textarea:focus-visible,
html[data-theme="dark"] .theme-toggle:focus-visible,
html[data-theme="dark"] .field-info-btn:focus-visible,
html[data-theme="dark"] .car-card:focus-visible {
  outline-color: rgba(255, 122, 47, 0.75);
}

/* Field info tooltips */
.field-info {
  display: inline-flex; align-items: center; position: relative;
  margin-left: 0.35rem; vertical-align: middle;
}
.field-info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; min-width: 22px; padding: 0;
  border-radius: 999px; border: 1.5px solid var(--brand-steel);
  background: var(--brand-mist); color: var(--brand-navy);
  font-size: 0.7rem; font-weight: 800; font-family: var(--font-display);
  cursor: help; line-height: 1;
}
.field-info-btn:hover, .field-info-btn[aria-expanded="true"] {
  background: var(--brand-steel); color: #fff; border-color: var(--brand-steel);
}
.field-info-tip {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  z-index: 30; width: min(280px, 70vw);
  padding: 0.65rem 0.75rem; border-radius: 8px;
  background: #0b1f33; color: #fff; font-size: var(--fs-xs);
  font-weight: 500; line-height: 1.4; box-shadow: var(--shadow);
  pointer-events: none;
}
.field-info-tip[hidden] { display: none !important; }
.field-info-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #0b1f33;
}
.field-info-req { font-style: normal; opacity: 0.85; white-space: nowrap; }
.form-label .req-mark { color: var(--brand-danger); font-weight: 700; margin-left: 0.15rem; }
.form-label .opt-mark { color: var(--brand-muted); font-size: 0.75rem; font-weight: 600; margin-left: 0.25rem; }
.field-error {
  color: var(--brand-danger); font-size: var(--fs-sm); font-weight: 600;
  margin-top: 0.35rem; display: block;
}
.form-group.has-error .input,
.form-group.has-error .select {
  border-color: var(--brand-danger);
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.15);
}

/* Animations / interactivity — never hide content with opacity:0 */
html.cw-js .section-head, html.cw-js .car-card, html.cw-js .result-card {
  /* visible by default; optional lift when .is-visible */
  transform: none;
  opacity: 1;
  transition: transform .45s ease, box-shadow .25s ease;
}
html.cw-js .section-head.is-visible, html.cw-js .car-card.is-visible, html.cw-js .result-card.is-visible {
  opacity: 1; transform: none;
}
.progress-track #fmc-progress,
.progress-bar-fill {
  transition: width .35s ease;
}
.btn:active { transform: scale(0.97); }
.btn { transition: background .15s, color .15s, border-color .15s, transform .12s; }

@media (prefers-reduced-motion: reduce) {
  html.cw-js .section-head, html.cw-js .car-card, html.cw-js .result-card {
    opacity: 1; transform: none; transition: none;
  }
  .progress-track #fmc-progress, .progress-bar-fill { transition: none; }
  .btn:active, .theme-toggle:active { transform: none; }
  .skeleton { animation: none; }
  html { scroll-behavior: auto; }
}

/* ===== Animated charts ===== */
.cw-charts-row {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
  margin: 1rem 0 0.5rem;
}
@media (min-width: 860px) {
  .cw-charts-row { grid-template-columns: 1fr 1fr; align-items: stretch; }
}
.cw-chart-card {
  position: relative;
  background: var(--brand-white, #fff);
  border: 1px solid var(--brand-line, #D5DEE6);
  border-radius: var(--radius, 12px);
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: var(--shadow, 0 8px 28px rgba(11,31,51,.08));
}
[data-theme="dark"] .cw-chart-card {
  background: #142433;
  border-color: #2a3f52;
}
.cw-chart-title {
  font-family: var(--font-display, Outfit, sans-serif);
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
  color: var(--brand-ink, #0B1F33);
}
[data-theme="dark"] .cw-chart-title { color: #f3f6f8; }
.cw-donut-wrap { display: grid; place-items: center; }
.cw-donut-svg { max-width: 100%; height: auto; overflow: visible; }
.cw-donut-slice {
  transform-origin: 50% 50%;
  transition: transform .2s ease, filter .2s ease, opacity .2s ease;
  cursor: pointer;
}
.cw-donut-slice.is-hot { transform: scale(1.04); filter: brightness(1.08); }
.cw-donut-center {
  font-family: var(--font-display, Outfit, sans-serif);
  font-size: 15px; font-weight: 800;
  fill: var(--brand-ink, #0B1F33);
}
.cw-donut-sub { font-size: 11px; fill: #5B6B7A; }
[data-theme="dark"] .cw-donut-center { fill: #f3f6f8; }
[data-theme="dark"] .cw-donut-sub { fill: #9fb0bf; }
.cw-donut-legend {
  list-style: none; margin: 0.85rem 0 0; padding: 0;
  display: grid; gap: 0.45rem;
}
.cw-donut-legend li {
  display: grid; grid-template-columns: 12px 1fr auto; gap: 0.55rem;
  align-items: center; font-size: 0.82rem;
}
.cw-donut-legend .swatch {
  width: 10px; height: 10px; border-radius: 999px; display: inline-block;
}
.cw-donut-legend .leg-label { color: var(--brand-ink, #0B1F33); font-weight: 600; }
.cw-donut-legend .leg-val { color: #5B6B7A; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .cw-donut-legend .leg-label { color: #e8eef2; }
[data-theme="dark"] .cw-donut-legend .leg-val { color: #9fb0bf; }
.cw-chart-tip {
  position: absolute; left: 50%; bottom: 0.65rem; transform: translateX(-50%);
  background: #0B1F33; color: #fff; font-size: 0.75rem; font-weight: 600;
  padding: 0.35rem 0.65rem; border-radius: 8px; white-space: nowrap;
  pointer-events: none; z-index: 3;
}
.cw-bar-row {
  display: grid; grid-template-columns: minmax(70px, 28%) 1fr auto;
  gap: 0.55rem; align-items: center; margin-bottom: 0.65rem;
}
.cw-bar-label { font-size: 0.82rem; font-weight: 600; color: var(--brand-ink, #0B1F33); }
[data-theme="dark"] .cw-bar-label { color: #e8eef2; }
.cw-bar-track {
  height: 12px; border-radius: 999px; background: #e8eef2; overflow: hidden;
}
[data-theme="dark"] .cw-bar-track { background: #1e3040; }
.cw-bar-fill {
  height: 100%; width: 0; border-radius: 999px; background: var(--c, #E85D04);
}
.cw-bar-value { font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #5B6B7A; }
.cw-chart-animate .cw-donut-slice {
  animation: cwDonutIn .7s ease both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.cw-chart-animate .cw-bar-fill {
  animation: cwBarIn .85s cubic-bezier(.22,.9,.3,1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
  width: var(--w, 0%);
}
@keyframes cwDonutIn {
  from { opacity: 0; transform: scale(.82); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes cwBarIn {
  from { width: 0; }
  to { width: var(--w, 0%); }
}
@media (prefers-reduced-motion: reduce) {
  .cw-chart-animate .cw-donut-slice,
  .cw-chart-animate .cw-bar-fill { animation: none; }
  .cw-chart-animate .cw-bar-fill { width: var(--w, 0%); }
}
.cw-mini-donut {
  width: 64px; height: 64px; border-radius: 50%; margin: 0.35rem 0 0.75rem;
  background: conic-gradient(#E85D04 calc(var(--p, 0) * 1%), #e8eef2 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
  animation: cwDonutIn .6s ease both;
}
[data-theme=\"dark\"] .cw-mini-donut {
  background: conic-gradient(#E85D04 calc(var(--p, 0) * 1%), #1e3040 0);
}
