:root {
  --ink: #17211d;
  --muted: #66736f;
  --paper: #fbfaf5;
  --surface: #ffffff;
  --line: #d9ded7;
  --brand: #f4a261;
  --brand-dark: #b85f22;
  --accent: #c8572f;
  --gold: #f3c65f;
  --shadow: 0 18px 45px rgba(23, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(23, 33, 29, 0.12);
  background: rgba(251, 250, 245, 0.92);
  backdrop-filter: blur(14px);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0;
}

.brand,
.nav-actions,
.hero-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--brand-dark);
  font-size: 1.2rem;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
}

.nav-actions {
  gap: 18px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.button:focus-visible {
  background: var(--brand-dark);
  box-shadow: 0 10px 22px rgba(244, 162, 97, 0.26);
  transform: translateY(-1px);
}

.button-secondary {
  background: #ffffff;
  color: var(--brand-dark);
  border: 1px solid rgba(184, 95, 34, 0.24);
}

.button-muted {
  background: #e9eee8;
  color: var(--ink);
}

.button-danger {
  background: #a33c25;
}

.button-danger:hover,
.button-danger:focus-visible {
  background: #7f2d1b;
  box-shadow: 0 10px 22px rgba(163, 60, 37, 0.2);
}

.button-small {
  min-height: 36px;
  padding: 0 14px;
  color: #fff;
  font-weight: 900;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  width: min(1160px, calc(100% - 32px));
  min-height: 280px;
  margin: 0 auto;
  padding: 28px 0;
  align-items: center;
}

.hero-copy {
  max-width: 600px;
}

.hero-copy h1 {
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 3.2vw, 2.9rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 14px;
  font-size: 1.35rem;
}

.hero-text {
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(1.18rem, 2vw, 1.55rem);
  line-height: 1.35;
  font-weight: 800;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.market-snapshot {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.market-snapshot div {
  padding: 14px;
  border-radius: 8px;
  background: #fff4e8;
}

.stat-value,
.stat-label {
  display: block;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
}

.stat-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

section {
  padding: 68px 0;
}

.filters-section,
.detail-section,
.list-section {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.listing-page {
  min-height: calc(100vh - 174px);
}

.support-page {
  min-height: calc(100vh - 92px);
}

.admin-page {
  min-height: calc(100vh - 174px);
}

[hidden] {
  display: none !important;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 24px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-weight: 800;
}

.filter-bar,
.list-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.keyword-filter {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd7d1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
  font-weight: 800;
}

input::placeholder,
textarea::placeholder {
  color: var(--ink);
  font-weight: 800;
  opacity: 1;
}

input[readonly] {
  background: #fff4e8;
  color: var(--muted);
  cursor: default;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(244, 162, 97, 0.24);
  border-color: var(--brand);
}

.results-line {
  display: flex;
  align-items: center;
  min-height: 42px;
  color: var(--muted);
  font-weight: 800;
}

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

.listing-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 280px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(23, 33, 29, 0.07);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.listing-card:hover,
.listing-card:focus-visible {
  border-color: rgba(244, 162, 97, 0.5);
  box-shadow: 0 18px 40px rgba(23, 33, 29, 0.12);
  outline: none;
  transform: translateY(-2px);
}

.listing-product {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
}

.listing-card h3 {
  margin: 0;
  font-size: 1.16rem;
  text-align: center;
}

.listing-image {
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff6ea 0%, #ffe0bd 100%);
  color: var(--brand-dark);
  font-size: 1.5rem;
  font-weight: 800;
}

img.listing-image {
  display: block;
  object-fit: cover;
}

.price {
  color: var(--brand-dark);
  font-size: 1.12rem;
  font-weight: 800;
  white-space: nowrap;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff0df;
  color: #7b421d;
  font-size: 0.78rem;
  font-weight: 800;
}

.listing-description {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.locked-note {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
}

.detail-section {
  padding-top: 28px;
}

.detail-back {
  margin-bottom: 16px;
}

.detail-view {
  display: grid;
  grid-template-columns: minmax(240px, 380px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-image {
  display: grid;
  width: 100%;
  min-height: 320px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff6ea 0%, #ffe0bd 100%);
  color: var(--brand-dark);
  font-size: 3.2rem;
  font-weight: 800;
}

img.detail-image {
  display: block;
  object-fit: cover;
}

.detail-copy {
  display: grid;
  gap: 14px;
}

.detail-copy h2 {
  margin-bottom: 0;
}

.detail-price {
  color: var(--brand-dark);
  font-size: 1.5rem;
}

.detail-pills {
  justify-content: flex-start;
}

.detail-description {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 800;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.list-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.list-page-section {
  padding-top: 72px;
}

.list-page-section h1 {
  margin-bottom: 14px;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}

.list-page-form {
  box-shadow: 0 12px 30px rgba(23, 33, 29, 0.06);
}

.vehicle-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(184, 95, 34, 0.24);
  border-radius: 8px;
  background: #fff7ef;
}

.vehicle-fields legend {
  padding: 0 6px;
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.vehicle-info {
  width: 100%;
}

.seller-payment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(23, 33, 29, 0.06);
}

.seller-payment h2 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.seller-payment p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 800;
}

.payment-card {
  display: grid;
  gap: 12px;
}

.payment-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #7b421d;
  color: #fff;
}

.payment-total span {
  color: rgba(255, 255, 255, 0.74);
  font-weight: 800;
}

.payment-total strong {
  font-size: 1.8rem;
}

.ai-writer-row {
  display: flex;
  justify-content: flex-start;
  margin-top: -4px;
}

.admin-section {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 72px;
}

.admin-login-section {
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

.admin-login {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-login h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.admin-section h1 {
  margin-bottom: 14px;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-stat {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 8px;
  background: #fff0df;
}

.admin-stat strong {
  color: var(--brand-dark);
  font-size: 1.7rem;
}

.admin-stat span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(23, 33, 29, 0.06);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.admin-table th,
.admin-table td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.report-id {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #7b421d;
  color: #fff;
  font-weight: 800;
}

.admin-description {
  display: block;
  max-width: 360px;
  margin: 5px 0 10px;
  color: var(--muted);
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f7fb;
  color: #1967b3;
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-admin {
  color: var(--muted);
  font-weight: 800;
  text-align: center !important;
}

.payment-record-section {
  padding-top: 44px;
}

.support-section {
  display: grid;
  gap: 16px;
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

.support-section h1 {
  margin-bottom: 0;
}

.support-section p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 800;
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.support-email-line {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand-dark) !important;
}

.wide-field {
  grid-column: 1 / -1;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--brand-dark);
  font-weight: 800;
}

.site-footer {
  display: grid;
  gap: 20px;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 44px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-footer p {
  margin: 0;
}

.footer-support-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.footer-support-card div:first-child {
  display: grid;
  gap: 2px;
}

.footer-support-card strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.footer-support-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-support-email {
  margin: 0;
  color: var(--brand-dark) !important;
  font-weight: 800;
}

.country-selector {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.country-selector-title {
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.country-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.country-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(184, 95, 34, 0.22);
  border-radius: 999px;
  background: #fff7ef;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.country-option:hover,
.country-option:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 8px 18px rgba(244, 162, 97, 0.22);
  outline: none;
  transform: translateY(-1px);
}

.flag-icon {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 18px;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid rgba(23, 33, 29, 0.18);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(23, 33, 29, 0.08);
}

.flag-us {
  background: repeating-linear-gradient(
    to bottom,
    #b22234 0 1.38px,
    #fff 1.38px 2.76px
  );
}

.flag-us::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 9.6px;
  background: #3c3b6e;
  content: "";
}

.flag-uk {
  background:
    linear-gradient(33deg, transparent 42%, #fff 42% 48%, #c8102e 48% 54%, #fff 54% 60%, transparent 60%),
    linear-gradient(147deg, transparent 42%, #fff 42% 48%, #c8102e 48% 54%, #fff 54% 60%, transparent 60%),
    linear-gradient(to right, transparent 38%, #fff 38% 44%, #c8102e 44% 56%, #fff 56% 62%, transparent 62%),
    linear-gradient(to bottom, transparent 34%, #fff 34% 42%, #c8102e 42% 58%, #fff 58% 66%, transparent 66%),
    #012169;
}

.flag-ca {
  background: linear-gradient(to right, #d52b1e 0 25%, #fff 25% 75%, #d52b1e 75%);
}

.flag-ca::before {
  position: absolute;
  top: 4px;
  left: 11px;
  width: 6px;
  height: 10px;
  background: #d52b1e;
  clip-path: polygon(50% 0, 62% 28%, 92% 18%, 76% 45%, 100% 55%, 67% 62%, 73% 100%, 50% 76%, 27% 100%, 33% 62%, 0 55%, 24% 45%, 8% 18%, 38% 28%);
  content: "";
}

.flag-eu {
  background: #003399;
}

.flag-eu::before {
  position: absolute;
  inset: 4px 9px;
  border: 2px dotted #ffcc00;
  border-radius: 50%;
  content: "";
}

.flag-au {
  background:
    radial-gradient(circle at 72% 64%, #fff 0 1.4px, transparent 1.5px),
    radial-gradient(circle at 78% 28%, #fff 0 1.2px, transparent 1.3px),
    radial-gradient(circle at 62% 34%, #fff 0 1.1px, transparent 1.2px),
    radial-gradient(circle at 86% 48%, #fff 0 1.1px, transparent 1.2px),
    linear-gradient(33deg, transparent 0 18%, #fff 18% 23%, #c8102e 23% 27%, #fff 27% 32%, transparent 32%),
    linear-gradient(147deg, transparent 0 18%, #fff 18% 23%, #c8102e 23% 27%, #fff 27% 32%, transparent 32%),
    linear-gradient(to right, transparent 0 16%, #fff 16% 20%, #c8102e 20% 28%, #fff 28% 32%, transparent 32%),
    linear-gradient(to bottom, transparent 0 22%, #fff 22% 27%, #c8102e 27% 39%, #fff 39% 44%, transparent 44%),
    #012169;
}

.flag-jp {
  background: radial-gradient(circle at center, #bc002d 0 5px, transparent 5.2px), #fff;
}

@media (max-width: 900px) {
  .hero,
  .detail-view {
    grid-template-columns: 1fr;
  }

  .nav-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: min(100% - 20px, 1160px);
    padding: 6px 0;
  }

  .brand {
    justify-content: center;
    font-size: 1.05rem;
  }

  .nav-actions {
    display: flex;
    grid-column: 1 / -1;
    width: 100%;
    gap: 8px;
  }

  .nav-actions a {
    flex: 1 1 0;
    min-height: 30px;
    padding: 0 10px;
    justify-content: center;
    font-size: 0.82rem;
    text-align: center;
  }

  .hero {
    min-height: auto;
    padding: 26px 0 28px;
  }

  .market-snapshot {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .seller-payment {
    grid-template-columns: 1fr;
  }

  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .filter-bar,
  .list-form,
  .vehicle-fields {
    grid-template-columns: 1fr;
  }

  .market-snapshot,
  .listing-grid {
    grid-template-columns: 1fr;
  }

  .footer-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-support-card {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .detail-image {
    min-height: 240px;
  }

  section {
    padding: 48px 0;
  }

  h1 {
    font-size: clamp(1.9rem, 9vw, 2.6rem);
  }

}
