:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18211d;
  background: #f5f4ef;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px;
  border-bottom: 1px solid #ddd8ce;
  background: rgb(245 244 239 / 94%);
  backdrop-filter: blur(12px);
}

.brand { font-size: 21px; font-weight: 850; }
nav { display: flex; gap: 18px; color: #58645d; font-size: 15px; }

.post-link, .search-panel button, .post-form button, .card-actions button, .dialog-actions button, .reset-filters {
  border: 0;
  border-radius: 8px;
  background: #157347;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.post-link { padding: 10px 14px; }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 32px;
  align-items: stretch;
}

.eyebrow {
  margin: 0 0 12px;
  color: #a34225;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 20px; font-size: clamp(42px, 7vw, 78px); line-height: 0.96; letter-spacing: 0; }
h2 { margin-bottom: 10px; font-size: 34px; letter-spacing: 0; }
.intro, .sell-copy p, .motors-panel p, .account-panel p { max-width: 670px; color: #536059; font-size: 19px; line-height: 1.6; }

.search-panel {
  display: grid;
  grid-template-columns: 1.25fr 0.8fr 0.8fr auto;
  gap: 10px;
  margin-top: 30px;
  padding: 12px;
  border: 1px solid #dad5cc;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 18px 44px rgb(24 33 29 / 9%);
}

label { display: grid; gap: 7px; }
label span { color: #5d6962; font-size: 13px; font-weight: 750; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d6d0c7;
  border-radius: 8px;
  background: #fff;
  color: #18211d;
  padding: 10px 12px;
}
textarea { resize: vertical; }
.search-panel button { align-self: end; min-height: 44px; padding: 0 20px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hero-actions button, .hero-actions a {
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  background: #fffdf8;
  color: #18211d;
  cursor: pointer;
  font-weight: 800;
  padding: 10px 14px;
}

.hero-media { position: relative; min-height: 430px; overflow: hidden; border-radius: 8px; background: #222; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.media-strip {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
  background: rgb(255 253 248 / 92%);
}
.media-strip span { color: #5d6962; }

.quick-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0 48px; }
.quick-stats div, .filters, .listing-card, .post-form, .motor-form, .dashboard-grid article, .safety article {
  border: 1px solid #ddd8ce;
  border-radius: 8px;
  background: #fffdf8;
}
.quick-stats div { padding: 18px; }
.quick-stats strong { display: block; font-size: 28px; }
.quick-stats span { color: #5d6962; }

.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.result-count { color: #59655e; font-size: 14px; font-weight: 750; }
.sort-group { display: flex; gap: 6px; padding: 4px; border: 1px solid #ddd8ce; border-radius: 8px; background: #fffdf8; }
.sort-group button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #536059;
  cursor: pointer;
  padding: 0 12px;
}
.sort-group .active { background: #18211d; color: #fff; }

.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; }
.filters { align-self: start; padding: 16px; }
.filters h3 { margin-bottom: 18px; }
.filters output { color: #18211d; font-weight: 800; }
.reset-filters { width: 100%; min-height: 42px; margin-top: 16px; background: #18211d; }
.checkbox-row { grid-template-columns: auto 1fr; align-items: center; margin-top: 16px; }
.checkbox-row input { width: 18px; min-height: 18px; }

.listing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.listing-card { display: grid; grid-template-columns: 180px minmax(0, 1fr); min-height: 184px; overflow: hidden; }
.listing-card img { width: 100%; height: 100%; object-fit: cover; }
.listing-body { display: grid; gap: 12px; padding: 14px; }
.listing-meta, .listing-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.badge { border-radius: 999px; background: #e4efe8; color: #157347; padding: 5px 9px; font-size: 12px; font-weight: 850; }
.save-listing { border: 1px solid #ddd8ce; border-radius: 999px; background: #fff; cursor: pointer; padding: 7px 10px; }
.listing-card h3 { margin-bottom: 0; font-size: 20px; }
.listing-card p { color: #5d6962; line-height: 1.45; }
.listing-footer strong { font-size: 22px; }
.listing-footer span { color: #6b766f; font-size: 14px; }
.specs { display: flex; flex-wrap: wrap; gap: 6px; }
.specs span { border-radius: 999px; background: #f0ede6; color: #59655e; padding: 5px 8px; font-size: 12px; }
.card-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.card-actions button { min-height: 38px; background: #18211d; }
.card-actions .message-seller { background: #157347; }
.card-actions .boost-ad { background: #a34225; }

.sell-section, .motors-panel, .account-panel { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 24px; margin-top: 60px; padding-top: 20px; }
.post-form, .motor-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.motor-stack { display: grid; gap: 14px; }
.motor-form { grid-template-columns: repeat(3, 1fr); }
.finance-box { border: 1px solid #ddd8ce; border-radius: 8px; background: #fffdf8; padding: 18px; }
.finance-box div { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.finance-box strong { display: block; margin-top: 14px; font-size: 26px; }
.post-form .full { grid-column: 1 / -1; }
.post-form button { min-height: 46px; padding: 0 16px; }
.form-note { align-self: center; margin: 0; color: #6b766f; font-size: 14px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.dashboard-grid article { min-height: 210px; padding: 16px; }
.dashboard-list { display: grid; gap: 10px; }
.dashboard-item { display: grid; gap: 6px; border-top: 1px solid #e4dfd7; padding-top: 10px; color: #536059; font-size: 14px; }
.dashboard-item strong { color: #18211d; }
.dashboard-item button { width: fit-content; border: 1px solid #d6d0c7; border-radius: 8px; background: #fff; cursor: pointer; padding: 7px 10px; }

.safety { margin-top: 60px; }
.safety-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.safety article { padding: 18px; }
.safety p { margin: 0; color: #536059; line-height: 1.5; }

dialog { width: min(920px, calc(100vw - 28px)); border: 0; border-radius: 8px; padding: 0; background: #fffdf8; box-shadow: 0 30px 90px rgb(24 33 29 / 30%); }
dialog::backdrop { background: rgb(18 24 21 / 55%); }
.dialog-card { position: relative; display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 18px; padding: 18px; }
.dialog-card img { width: 100%; height: 100%; min-height: 380px; object-fit: cover; border-radius: 8px; }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #fff; cursor: pointer; font-size: 22px; }
dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
dt { color: #6b766f; font-size: 13px; }
dd { margin: 0; font-weight: 800; }
.dialog-actions { display: flex; gap: 10px; margin-top: 18px; }
.dialog-actions button { min-height: 42px; padding: 0 14px; }
.dialog-actions #dialogPhone { background: #a34225; }
.history-panel, .seller-panel { border: 1px solid #ddd8ce; border-radius: 8px; background: #f8f6ef; margin: 14px 0; padding: 12px; }
.history-panel strong, .seller-panel strong { display: block; margin-bottom: 5px; }
.history-panel span, .seller-panel span { color: #59655e; font-size: 14px; }

@media (max-width: 940px) {
  .hero, .layout, .sell-section, .motors-panel, .account-panel { grid-template-columns: 1fr; }
  .search-panel { grid-template-columns: 1fr 1fr; }
  .search-panel button { grid-column: 1 / -1; }
  .filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .filters h3 { grid-column: 1 / -1; margin-bottom: 0; }
}

@media (max-width: 700px) {
  .topbar, .toolbar, .media-strip { align-items: flex-start; flex-direction: column; }
  nav { display: none; }
  .search-panel, .quick-stats, .listing-grid, .post-form, .safety-grid, .filters, .motor-form, .finance-box div, .dashboard-grid, .dialog-card { grid-template-columns: 1fr; }
  .listing-card { grid-template-columns: 1fr; }
  .listing-card img { height: 210px; }
}
