:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202124;
  background: #f5f5f5;
}

* { box-sizing: border-box; }
body { margin: 0; padding: 32px 20px; }
main { max-width: 900px; margin: 0 auto; }

header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 18px;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: 30px; }
header p, .location { margin-bottom: 0; color: #666; }
a { color: #1457c7; }
.criteria { padding: 12px 14px; background: #fff; border: 1px solid #ddd; }
.view-nav { display: flex; gap: 6px; margin-top: 14px; }
.view-nav a {
  padding: 9px 13px;
  color: #202124;
  background: #fff;
  border: 1px solid #aaa;
  border-radius: 5px;
  font-weight: 650;
  text-decoration: none;
}
.view-nav a:hover { background: #eee; }
.view-nav a[aria-current="page"] { color: #fff; background: #202124; border-color: #202124; }
.view-nav a:focus-visible { outline: 3px solid #8bb8ff; outline-offset: 2px; }
.view-nav span { color: inherit; opacity: .75; }
.cars { display: grid; gap: 20px; margin-top: 14px; }
[hidden] { display: none !important; }

article {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
}

article > img,
.no-photo {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  min-height: 320px;
}

article > img {
  display: block;
  object-fit: cover;
}

.no-photo {
  display: grid;
  place-items: center;
  color: #777;
  background: #e9e9e9;
  font-size: 14px;
}

.details { min-width: 0; padding: 24px; }
.title-row { display: flex; justify-content: space-between; gap: 20px; min-width: 0; }
.title-row > div { min-width: 0; }
h2 { margin-bottom: 5px; font-size: 22px; }
.price { font-size: 22px; white-space: nowrap; }

.validity {
  display: inline-block;
  margin: 22px 0 16px;
  padding: 6px 9px;
  color: #17632e;
  background: #e8f5eb;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 650;
}

.validity.warning { color: #815200; background: #fff3d6; }
.validity.critical { color: #8b1f1f; background: #fde8e8; }
dl { margin: 0; }
dl div { display: grid; grid-template-columns: 100px 1fr; padding: 7px 0; border-top: 1px solid #eee; }
dt { color: #666; }
dd { min-width: 0; margin: 0; }
.issues { margin: 18px 0; line-height: 1.5; overflow-wrap: anywhere; }
.listing-link { font-weight: 650; }
footer { margin-top: 24px; color: #666; font-size: 13px; }

@media (max-width: 680px) {
  body { padding: 22px 14px; }
  header { align-items: flex-start; flex-direction: column; }
  article { grid-template-columns: 1fr; }
  article > img, .no-photo { min-height: 0; aspect-ratio: 16 / 9; }
  .details { padding: 20px; }
  .title-row { align-items: flex-start; flex-wrap: wrap; gap: 6px 14px; }
  .price { margin-left: auto; }
  .validity { max-width: 100%; overflow-wrap: anywhere; }
}

@media (max-width: 400px) {
  body { padding: 16px 10px; }
  h1 { font-size: 27px; }
  h2, .price { font-size: 20px; }
  .details { padding: 16px; }
  dl div { grid-template-columns: 88px minmax(0, 1fr); }
}
