:root {
  --bg: #f3efe6;
  --paper: #fffdf8;
  --ink: #1c1915;
  --muted: #5f584e;
  --line: #e3d9c8;
  --accent: #8d3418;
  --accent-dark: #6d2410;
  --good: #1e6b3a;
  --pending: #8a5a00;
  --sold: #7a3030;
  --hidden: #5c584f;
  --shadow: 0 10px 30px rgba(40, 28, 16, 0.08);
  font-family: "Segoe UI", "Avenir Next", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
img { max-width: 100%; }
a { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; font-size: 16px; }
button, .button {
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
button.primary, a.button.primary { background: var(--accent); color: white; border-color: var(--accent-dark); }
button.danger { background: #fff; color: var(--sold); border-color: #e7c4c4; }
button.linkish { background: transparent; border: 0; color: #f4eadc; min-height: 44px; padding: 0.2rem 0.4rem; }
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 16px;
  background: #1c1915;
  color: #f6f1e8;
}
.brand { color: #f6f1e8; font-weight: 700; font-size: 1.25rem; text-decoration: none; letter-spacing: 0.01em; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.nav a { color: #f6f1e8; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav form { margin: 0; }
main { max-width: 1080px; margin: 0 auto; padding: 16px; }
.foot { max-width: 1080px; margin: 0 auto; padding: 8px 16px 28px; color: var(--muted); }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0.2rem 0 0.6rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.3rem; }
.intro p, .hint, .meta, .foot { color: var(--muted); }
.filters, .stack, .fields { display: grid; gap: 12px; }
.filters label, .stack label, .fields label, .extra label { display: grid; gap: 4px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
}
textarea { resize: vertical; }
.filters { margin: 12px 0 18px; }
@media (min-width: 800px) {
  .filters { grid-template-columns: 1.4fr 1fr 0.8fr auto; align-items: end; }
  .fields { grid-template-columns: 1fr 1fr; }
  .fields .wide, .wide { grid-column: 1 / -1; }
}
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
@media (min-width: 700px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1020px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }
.card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  min-height: 100%;
}
.card img, .nophoto { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #ddd4c6; }
.nophoto { display: grid; place-items: center; color: var(--muted); }
.card-body { padding: 12px 14px 16px; }
.price { font-weight: 750; font-size: 1.25rem; margin: 0.2rem 0; }
.price.large { font-size: 1.6rem; }
.cad { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: #eee;
}
.badge.pending { background: #f4e3c0; color: var(--pending); }
.badge.available { background: #d9f0e1; color: var(--good); }
.badge.sold { background: #f4d6d6; color: var(--sold); }
.badge.hidden { background: #e6e2da; color: var(--hidden); }
.banner, .error {
  background: #fff4e8;
  border: 1px solid #efd0b4;
  border-radius: 12px;
  padding: 10px 12px;
}
.error { background: #fdecec; border-color: #f0c8c8; color: #6d2424; }
.snap {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: 16px;
  background: #141210;
  margin: 12px 0;
}
.snap img {
  scroll-snap-align: center;
  min-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #141210;
}
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.thumbs button { padding: 0; border-radius: 8px; border: 2px solid transparent; background: transparent; min-height: 0; }
.thumbs button[aria-current="true"] { border-color: var(--accent); }
.thumbs img { width: 84px; height: 64px; object-fit: cover; display: block; border-radius: 6px; }
.specs { display: grid; gap: 8px; margin: 16px 0; }
@media (min-width: 700px) { .specs { grid-template-columns: 1fr 1fr; } }
.specs div { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.specs dt { color: var(--muted); font-size: 0.8rem; }
.specs dd { margin: 0; font-weight: 650; }
.prose { white-space: pre-wrap; }
.features { padding-left: 1.1rem; }
.admin-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.admin-card, .panel, .narrow {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.admin-card { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.row-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.photo-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.photo-row { display: flex; gap: 10px; align-items: center; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.photo-row img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.photo-actions form { margin: 0; }
.status-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.status-nav a { text-decoration: none; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.75rem; min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); }
.status-nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.inline-form { display: flex; gap: 8px; align-items: end; }
.inline-form select { width: auto; min-width: 9rem; }
.narrow { max-width: 440px; }
.panel { margin-top: 18px; }
.danger-zone { border-color: #f0c8c8; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.vin-row { display: grid; gap: 8px; }
@media (min-width: 700px) {
  .vin-row { grid-template-columns: 1fr auto; align-items: end; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.empty { padding: 12px 0; }
