* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: #111;
  min-height: 100vh;
  padding: 40px 20px;
}

.container {
  max-width: 680px;
  margin: 0 auto;
}

.header { margin-bottom: 28px; }
h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.subtitle { font-size: 14px; color: #888; }

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

#plateInput {
  flex: 1;
  padding: 13px 16px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
}
#plateInput:focus { border-color: #111; }
#plateInput::placeholder { font-weight: 400; letter-spacing: 0; text-transform: none; color: #bbb; }

#conditionSelect {
  padding: 13px 14px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  background: #fff;
  color: #333;
  cursor: pointer;
  max-width: 200px;
}
#conditionSelect:focus { border-color: #111; }

button {
  padding: 13px 24px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
button:hover    { background: #333; }
button:disabled { background: #999; cursor: not-allowed; }

.status {
  font-size: 13px;
  color: #555;
  min-height: 22px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status.error { color: #c0392b; }

.card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  display: none;
}

.card-header {
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #aaa;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.plate-badge {
  display: inline-block;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: 5px;
  margin: 14px 20px 10px;
}

.info-grid { padding: 0 20px 16px; }

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid #f8f8f8;
  font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: #888; }
.info-value  { font-weight: 600; }

.cheapest-box {
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}
.cheapest-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
  margin-bottom: 6px;
}
.cheapest-price {
  font-size: 28px;
  font-weight: 800;
  color: #111;
  margin-bottom: 6px;
}
.cheapest-meta {
  font-size: 13px;
  color: #777;
  margin-bottom: 14px;
}
.bilbasen-btn {
  display: inline-block;
  background: #111;
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.bilbasen-btn:hover { background: #333; }

.bid-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #ddd;
}
.bid-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
}
.bid-price {
  font-size: 16px;
  font-weight: 800;
  color: #1a7f37;
}

.listings-count {
  font-size: 12px;
  font-weight: 500;
  color: #bbb;
  text-transform: none;
  letter-spacing: 0;
}

#listingsTable { padding: 16px 20px; }

.listings {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.listings thead tr {
  border-bottom: 2px solid #f0f0f0;
}
.listings th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
}
.listings tbody tr {
  border-bottom: 1px solid #f8f8f8;
  transition: background 0.15s;
}
.listings tbody tr:hover { background: #fafafa; }
.listings tbody tr:last-child { border-bottom: none; }
.listings td { padding: 10px 10px; vertical-align: middle; }

.td-num   { color: #ccc; font-weight: 700; width: 30px; }
.td-title a { color: #111; text-decoration: none; font-weight: 500; }
.td-title a:hover { text-decoration: underline; }
.td-price { font-weight: 700; color: #111; white-space: nowrap; }
.td-km    { color: #777; white-space: nowrap; }
.td-date  { color: #aaa; white-space: nowrap; }

.no-listings { font-size: 13px; color: #aaa; padding: 10px 0; }

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid #ddd;
  border-top-color: #555;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }