* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0 0 80px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f2f2f5;
  color: #1a1a1a;
}

.topbar {
  background: #1a1a1a;
  color: #fff;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar-meta { font-size: 13px; color: #ccc; display: flex; gap: 16px; align-items: center; }
.btn-link { color: #9ecbff; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }

.alert { margin: 16px 24px; padding: 12px 16px; border-radius: 6px; font-size: 14px; }
.alert-error { background: #ffe6e6; color: #a30000; border: 1px solid #f5b5b5; }

.panel {
  background: #fff;
  margin: 16px 24px;
  padding: 20px 24px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.panel h2 { margin-top: 0; font-size: 16px; }
.hint { color: #666; font-size: 13px; margin-top: -4px; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.field input[type=text], .field textarea {
  width: 100%;
  max-width: 500px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
}
.field-checkbox { display: flex; align-items: center; gap: 8px; }
.field-checkbox span { margin-bottom: 0; font-weight: normal; }

.search-box {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}

.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.car-card {
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa;
}
.car-card.expanded { border-color: #1a1a1a; background: #fff; }

.car-card-head {
  display: flex;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
  align-items: flex-start;
}
.car-card-head input[type=checkbox] { margin-top: 6px; width: 18px; height: 18px; flex-shrink: 0; }

.car-select-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.order-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2f855a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.order-badge[hidden] { display: none; }

.hero-thumb {
  width: 92px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  background: #ddd;
  flex-shrink: 0;
}
.hero-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #999;
}

.car-card-info { min-width: 0; flex: 1; }
.car-card-title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.car-card-trim { font-size: 12px; color: #666; margin-top: 1px; }
.car-card-price { font-size: 14px; font-weight: 700; color: #1a1a1a; margin-top: 4px; }
.car-card-sub { font-size: 11px; color: #888; margin-top: 3px; }

.photo-panel {
  display: none;
  border-top: 1px solid #e2e2e2;
  padding: 10px;
  background: #fff;
}
.car-card.expanded .photo-panel { display: block; }

.photo-panel-actions { font-size: 12px; margin-bottom: 8px; }
.photo-panel-actions a { color: #1a5fb4; text-decoration: none; margin-right: 12px; }
.photo-panel-actions a:hover { text-decoration: underline; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.photo-thumb { position: relative; cursor: pointer; display: block; }
.photo-thumb img {
  width: 100%;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid transparent;
  display: block;
}
.photo-thumb input[type=checkbox] {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
}
.photo-thumb input[type=checkbox]:checked + img { border-color: #1a7f37; }

.stickybar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a1a;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.2);
}
.btn-primary {
  background: #2f855a;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary:disabled { background: #555; cursor: not-allowed; }
.btn-primary:not(:disabled):hover { background: #276749; }
