: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) auto;
  padding: 16px 20px;
}

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

.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;
}

.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(2, minmax(0, 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;
}

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

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    padding: 10px 18px;
  }

  .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;
  }

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

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