:root {
  color-scheme: light;
  --ink: #182026;
  --muted: #68727d;
  --line: #d9e1e8;
  --paper: #f8fafb;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warm: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  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;
}

.sr-only {
  clip: rect(0 0 0 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.site-header {
  align-items: center;
  background: rgba(248, 250, 251, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brandmark {
  align-items: center;
  display: inline-flex;
  height: 54px;
  text-decoration: none;
}

.brandmark img {
  display: block;
  height: 42px;
  max-width: min(248px, 78vw);
  width: auto;
}

.updated,
.variant-row span {
  color: var(--muted);
  font-size: 14px;
}

.page-shell {
  margin: 0 auto;
  max-width: 1160px;
  padding: 40px 24px 72px;
}

.intro {
  padding: 18px 0 34px;
}

.intro img {
  aspect-ratio: 1971 / 493;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(24, 32, 38, 0.16);
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.brand-heading h1 {
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: 0;
  line-height: 1.02;
  margin: 0;
}

.brand-search {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 10px;
  justify-items: center;
  margin: -10px auto 34px;
  max-width: 760px;
  padding: 0;
}

.brand-search label {
  color: var(--accent-strong);
  font-size: 16px;
  font-weight: 800;
}

.search-field {
  align-items: center;
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(24, 32, 38, 0.12);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 68px;
  padding: 0 20px;
  width: 100%;
}

.search-field span {
  color: var(--warm);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.brand-search input {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink);
  font: inherit;
  font-size: 21px;
  font-weight: 700;
  min-height: 64px;
  min-width: 0;
  outline: none;
  padding: 0;
  width: 100%;
}

.brand-search input:focus {
  box-shadow: none;
}

.brand-search > span {
  color: var(--muted);
  font-size: 15px;
}

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

.brand-tile {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
  min-width: 0;
  padding: 18px;
  text-align: center;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.brand-tile[hidden] {
  display: none;
}

.brand-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 14px 32px rgba(24, 32, 38, 0.1);
  transform: translateY(-2px);
}

.brand-tile-disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.42;
}

.brand-tile-disabled:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.brand-tile img,
.brand-heading img {
  display: block;
  height: 78px;
  max-width: min(138px, 80%);
  object-fit: contain;
  width: 138px;
}

.brand-alfa-romeo img {
  height: 92px;
  width: 92px;
}

.brand-byd img {
  height: 82px;
  max-width: 88%;
  width: 170px;
}

.brand-chery img {
  height: 72px;
  width: 150px;
}

.brand-jaecoo img,
.brand-jeep img,
.brand-kgm img,
.brand-mini img,
.brand-omoda img,
.brand-swm img {
  height: 78px;
  width: 156px;
}

.brand-mercedes-benz img {
  height: 112px;
  max-width: 88%;
  width: 112px;
}

.brand-suzuki img {
  height: 96px;
  width: 96px;
}

.brand-togg img {
  height: 70px;
  width: 156px;
}

.logo-fallback {
  align-items: center;
  background: linear-gradient(135deg, #0f766e, #f59e0b);
  border-radius: 50%;
  color: white;
  display: inline-flex;
  font-size: 26px;
  font-weight: 900;
  height: 82px;
  justify-content: center;
  width: 82px;
}

.brand-tile strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.brand-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.backline {
  margin-bottom: 24px;
}

.backline a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.brand-heading {
  align-items: center;
  display: flex;
  gap: 24px;
  margin-bottom: 34px;
}

.price-list {
  display: grid;
  gap: 18px;
}

.model-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.model-block h2 {
  border-bottom: 1px solid var(--line);
  font-size: 24px;
  margin: 0;
  padding: 18px 20px;
}

.variant-list {
  display: grid;
}

.variant-row {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(240px, auto);
  padding: 16px 20px;
}

.variant-row + .variant-row {
  border-top: 1px solid var(--line);
}

.variant-row-muted {
  background: #f4f7f8;
  opacity: 0.62;
}

.variant-row-muted .price-actions a {
  background: var(--panel);
}

.variant-row strong,
.variant-row span {
  display: block;
}

.price-cell {
  align-items: end;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}

.price-cell b {
  color: var(--accent-strong);
  font-size: 21px;
}

.price-cell a {
  color: var(--muted);
  font-size: 13px;
}

.price-cell span {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.price-panel {
  align-items: end;
  display: grid;
  gap: 8px 14px;
  grid-template-columns: auto;
  justify-content: end;
  text-align: right;
}

.price-stack {
  display: grid;
  gap: 2px;
}

.price-stack span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.price-stack b {
  color: var(--accent-strong);
  font-size: 28px;
  line-height: 1.05;
}

.price-stack .price-empty {
  color: #9aa5af;
}

.price-stack a,
.price-actions a {
  color: var(--muted);
  font-size: 13px;
}

.discount-pill {
  align-items: center;
  background: #fffaf2;
  border: 1px solid #fde4bf;
  border-radius: 999px;
  color: #9a3412;
  display: inline-flex;
  gap: 4px;
  justify-self: end;
  min-height: 22px;
  padding: 2px 7px;
  position: relative;
}

.discount-pill span {
  color: #9a3412;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.discount-pill:focus {
  outline: 2px solid rgba(194, 65, 12, 0.3);
  outline-offset: 2px;
}

.discount-tooltip {
  background: var(--ink);
  border-radius: 8px;
  bottom: 100%;
  box-shadow: 0 16px 34px rgba(24, 32, 38, 0.2);
  color: #fff;
  display: grid;
  gap: 2px;
  min-width: 190px;
  opacity: 0;
  padding: 10px 12px;
  pointer-events: auto;
  position: absolute;
  right: 0;
  text-align: left;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 20;
}

.discount-tooltip::after {
  border: 7px solid transparent;
  border-top-color: var(--ink);
  content: "";
  position: absolute;
  right: 18px;
  top: 100%;
}

.discount-tooltip strong {
  color: #cbd5df;
  display: block;
  font-size: 12px;
  text-transform: uppercase;
}

.discount-tooltip b {
  color: #fff;
  font-size: 18px;
}

.discount-tooltip a {
  color: #fbbf24;
  font-size: 13px;
}

.discount-pill:hover .discount-tooltip,
.discount-pill:focus .discount-tooltip,
.discount-pill:focus-within .discount-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.price-actions {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, max-content);
  justify-content: flex-end;
}

.price-actions a {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  min-height: 22px;
  padding: 2px 7px;
  text-decoration: none;
  white-space: nowrap;
}

.price-actions a:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.history-heading {
  align-items: end;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 20px;
}

.history-heading > div:first-child > span {
  color: var(--accent-strong);
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
}

.history-heading h1 {
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: 0;
  line-height: 1.04;
  margin: 0;
}

.history-current {
  align-items: flex-end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 220px;
  padding: 16px 18px;
}

.history-current span,
.history-current small,
.history-summary span,
.history-row span,
.history-row p {
  color: var(--muted);
}

.history-current b {
  color: var(--accent-strong);
  font-size: 26px;
}

.history-summary {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 18px;
}

.history-summary div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
}

.history-summary strong,
.history-summary span {
  display: block;
}

.history-summary strong {
  color: var(--ink);
  font-size: 22px;
}

.history-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.history-row {
  align-items: center;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 18px 20px;
}

.history-row + .history-row {
  border-top: 1px solid var(--line);
}

.history-row strong,
.history-row span {
  display: block;
}

.history-row p {
  font-size: 14px;
  margin: 8px 0 0;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 28px;
}

.site-footer {
  background: #151b20;
  color: #d8e0e7;
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
  padding: 34px max(24px, calc((100vw - 1160px) / 2 + 24px));
}

.site-footer strong {
  color: #ffffff;
  display: block;
  font-size: 15px;
  margin-bottom: 8px;
}

.site-footer p {
  color: #aeb9c3;
  font-size: 13px;
  margin: 0;
  max-width: 560px;
}

@media (max-width: 900px) {
  .brand-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 14px;
  }

  .brandmark {
    min-width: 0;
  }

  .brandmark img {
    max-width: min(190px, 52vw);
  }

  .updated {
    font-size: 12px;
    justify-self: end;
    text-align: right;
    white-space: nowrap;
  }

  .page-shell {
    padding: 26px 16px 54px;
  }

  .brand-grid {
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-search {
    align-items: stretch;
    margin-top: -2px;
  }

  .search-field {
    min-height: 60px;
    padding: 0 14px;
  }

  .brand-search input {
    font-size: 17px;
    min-height: 58px;
  }

  .brand-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .variant-row {
    grid-template-columns: 1fr;
  }

  .price-cell {
    align-items: flex-start;
    text-align: left;
  }

  .price-cell span {
    justify-content: flex-start;
  }

  .price-panel {
    grid-template-columns: 1fr;
    justify-content: stretch;
    text-align: left;
  }

  .discount-tooltip {
    left: 0;
    right: auto;
  }

  .discount-tooltip::after {
    left: 18px;
    right: auto;
  }

  .price-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: auto;
  }

  .price-actions a,
  .discount-pill {
    justify-content: center;
    justify-self: start;
    width: auto;
  }

  .history-heading,
  .history-row {
    grid-template-columns: 1fr;
  }

  .history-current {
    align-items: flex-start;
    min-width: 0;
  }

  .site-footer {
    gap: 22px;
    margin-top: 8px;
    padding: 28px 16px;
  }
}
