:root {
  color-scheme: light;
  --bg: #f4f1ec;
  --ink: #1f2524;
  --muted: #68706d;
  --line: #d7d0c6;
  --paper: #fffaf2;
  --paper-strong: #ffffff;
  --green: #1d6b54;
  --blue: #315f8a;
  --red: #9a463c;
  --gold: #9b7029;
  --shadow: 0 20px 50px rgba(39, 45, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.topbar {
  align-items: end;
  background: #12231f;
  color: #fffaf2;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 220px;
  padding: 36px max(24px, calc((100vw - 1180px) / 2)) 32px;
}

.topbar h1 {
  font-size: 48px;
  letter-spacing: 0;
  line-height: 1;
  margin: 8px 0 0;
}

.eyebrow {
  color: #b7c4bd;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.budget-pill {
  align-items: center;
  border: 1px solid rgba(255, 250, 242, 0.3);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 16px 18px;
}

.budget-pill span {
  color: #cfd8d3;
  font-size: 13px;
}

.budget-pill strong {
  font-size: 30px;
  line-height: 1;
}

main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 24px 24px 48px;
}

.summary-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: -44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary-grid article {
  background: var(--paper-strong);
  min-height: 158px;
  padding: 22px;
}

.summary-grid span,
.meta span,
.cost-table span,
.source-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-grid strong {
  display: block;
  font-size: 22px;
  line-height: 1.12;
  margin: 8px 0 12px;
}

.summary-grid p,
.decision-panel p,
.car-card p {
  color: var(--muted);
  margin: 0;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 18px;
}

.filter {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  min-height: 38px;
  padding: 8px 14px;
}

.filter.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fffaf2;
}

.car-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.car-card {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.media {
  aspect-ratio: 16 / 10;
  background: #d8d8d8;
  position: relative;
}

.media img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.rank {
  align-items: center;
  background: rgba(18, 35, 31, 0.9);
  border-radius: 999px;
  color: #fffaf2;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  left: 12px;
  min-width: 32px;
  padding: 0 10px;
  position: absolute;
  top: 12px;
}

.card-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.title-row {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.title-row h2 {
  font-size: 22px;
  letter-spacing: 0;
  line-height: 1.12;
  margin: 0;
}

.badge {
  border-radius: 999px;
  color: #fff;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.badge.best {
  background: var(--green);
}

.badge.luxury {
  background: var(--blue);
}

.badge.value {
  background: var(--gold);
}

.badge.watch {
  background: var(--red);
}

.meta {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta div {
  background: #fbf6ed;
  min-height: 68px;
  padding: 12px;
}

.meta strong {
  display: block;
  font-size: 15px;
  margin-top: 4px;
}

.cost-note,
.safety-note,
.origin-note {
  background: #f2eadf;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.safety-note {
  background: #eef3ef;
}

.origin-note {
  background: #f5f0e7;
}

.cost-note span,
.safety-note span,
.origin-note span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.cost-note strong,
.safety-note strong,
.origin-note strong {
  font-size: 15px;
  line-height: 1.3;
}

.tco-line {
  background: #12231f;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  margin: 2px 0;
  padding: 11px 12px;
}

.tco-line span {
  color: #b7c4bd;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.tco-line strong {
  color: #fffaf2;
  font-size: 18px;
  line-height: 1.2;
}

.cost-note em {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  line-height: 1.35;
}

.notes {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.notes li {
  color: var(--muted);
  list-style: none;
  padding-left: 18px;
  position: relative;
}

.notes li::before {
  background: var(--green);
  border-radius: 999px;
  content: "";
  height: 6px;
  left: 0;
  position: absolute;
  top: 9px;
  width: 6px;
}

.source-link {
  margin-top: auto;
}

.decision-panel {
  background: #12231f;
  border-radius: 8px;
  color: #fffaf2;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) 420px;
  margin-top: 24px;
  padding: 28px;
}

.decision-panel h2 {
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.12;
  margin: 8px 0 12px;
  max-width: 780px;
}

.decision-panel p {
  color: #cfd8d3;
}

.cost-table {
  background: rgba(255, 250, 242, 0.08);
  border: 1px solid rgba(255, 250, 242, 0.18);
  border-radius: 8px;
  display: grid;
}

.cost-table div {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.cost-table div + div {
  border-top: 1px solid rgba(255, 250, 242, 0.18);
}

.cost-table span {
  color: #b7c4bd;
}

.cost-table strong {
  color: #fffaf2;
  font-size: 15px;
}

.checklist {
  margin-top: 34px;
}

.estimate-section {
  display: grid;
  gap: 18px;
  grid-template-columns: 270px minmax(0, 1fr);
  margin-top: 34px;
}

.estimate-section .eyebrow {
  color: var(--muted);
}

.estimate-section h2 {
  font-size: 30px;
  line-height: 1.1;
  margin: 8px 0 12px;
}

.estimate-section p {
  color: var(--muted);
  margin: 0;
}

.estimate-table {
  display: grid;
  gap: 12px;
}

.estimate-table > div {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px 12px;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  padding: 16px;
}

.estimate-table .estimate-head {
  display: none;
}

.estimate-table strong {
  font-size: 22px;
  grid-column: 1 / -1;
  line-height: 1.15;
}

.estimate-table span {
  background: #f7f3eb;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green);
  display: grid;
  font-size: 18px;
  gap: 2px;
  font-weight: 800;
  line-height: 1.15;
  min-height: 68px;
  padding: 10px;
}

.estimate-table span::before {
  color: var(--muted);
  content: "";
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.estimate-table > div > span:nth-child(2)::before {
  content: "Repair/maint.";
}

.estimate-table > div > span:nth-child(3)::before {
  content: "Insurance";
}

.estimate-table > div > span:nth-child(4)::before {
  content: "5-year TCO";
}

.estimate-table > div > span:nth-child(5)::before {
  content: "Blind spot";
}

.estimate-table > div > span:nth-child(6)::before {
  content: "Common origin";
}

.estimate-table > div > span:nth-child(4) {
  background: #eef3ef;
  border: 1px solid #d5e0d8;
  border-radius: 6px;
  color: #12231f;
  font-size: 20px;
}

.estimate-table > div > span:nth-child(2),
.estimate-table > div > span:nth-child(3),
.estimate-table > div > span:nth-child(4) {
  white-space: nowrap;
}

.estimate-table p {
  color: var(--muted);
  grid-column: 1 / -1;
  margin: 0;
}

.hybrid-section {
  display: grid;
  gap: 18px;
  grid-template-columns: 320px minmax(0, 1fr);
  margin: 10px 0 24px;
}

.hybrid-section .eyebrow {
  color: var(--muted);
}

.hybrid-section h2 {
  font-size: 30px;
  line-height: 1.1;
  margin: 8px 0 12px;
}

.hybrid-section p {
  color: var(--muted);
  margin: 0;
}

.hybrid-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.hybrid-table > div {
  background: var(--paper-strong);
  display: grid;
  gap: 12px;
  grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr);
  padding: 14px 16px;
}

.dollars-section {
  margin-top: 0;
}

.dollars-table > div {
  grid-template-columns: minmax(150px, 180px) 105px 115px 120px 125px minmax(0, 1fr);
}

.dollars-table > div > span {
  color: var(--green);
  font-weight: 800;
}

.dollars-table p {
  color: var(--muted);
  font-weight: 500;
}

.insurance-table > div {
  grid-template-columns: minmax(170px, 230px) 145px 115px minmax(0, 1fr);
}

.insurance-table > div > span {
  color: var(--green);
  font-weight: 800;
}

.insurance-table p {
  color: var(--muted);
  font-weight: 500;
}

.hybrid-table > div + div {
  border-top: 1px solid var(--line);
}

.hybrid-table .hybrid-head {
  background: #12231f;
  color: #fffaf2;
  font-size: 13px;
  font-weight: 800;
}

.hybrid-table .hybrid-head span {
  color: #fffaf2;
}

.hybrid-table strong,
.hybrid-table span {
  align-self: start;
}

.hybrid-table span {
  color: var(--muted);
}

.hybrid-table p {
  color: var(--ink);
  font-weight: 700;
  margin: 0;
}

.checklist h2 {
  font-size: 26px;
  margin: 0 0 14px;
}

.checklist ul {
  columns: 2;
  gap: 40px;
  margin: 0;
  padding-left: 20px;
}

.checklist li {
  break-inside: avoid;
  margin: 0 0 8px;
}

footer {
  color: var(--muted);
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 24px 36px;
}

footer p {
  border-top: 1px solid var(--line);
  font-size: 13px;
  margin: 0;
  padding-top: 18px;
}

@media (max-width: 920px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .summary-grid,
  .car-grid,
  .decision-panel,
  .estimate-section,
  .hybrid-section {
    grid-template-columns: 1fr;
  }

  .decision-panel {
    padding: 22px;
  }

  .checklist ul {
    columns: 1;
  }

  .estimate-table > div {
    grid-template-columns: 1fr;
  }

  .hybrid-table > div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .topbar {
    min-height: 190px;
    padding: 28px 18px 30px;
  }

  .topbar h1 {
    font-size: 36px;
  }

  main {
    padding: 18px 14px 36px;
  }

  .summary-grid {
    margin-top: -34px;
  }

  .summary-grid article,
  .card-body {
    padding: 16px;
  }

  .decision-panel h2 {
    font-size: 24px;
  }

  footer {
    padding-left: 14px;
    padding-right: 14px;
  }
}
