:root {
  color-scheme: light;
  --navy: #0e2f4f;
  --blue: #175b91;
  --blue-hover: #104a77;
  --ink: #17212b;
  --muted: #627181;
  --line: #d7e0e7;
  --soft: #f3f7fa;
  --white: #fff;
  --danger: #a12a2a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #eaf0f4; }
.site-header {
  display: flex; justify-content: space-between; align-items: center; gap: 30px;
  padding: 24px clamp(18px, 4vw, 60px); color: white; background: var(--navy);
  border-bottom: 5px solid #4f87ad;
}
.site-header h1 { margin: 2px 0 4px; font-size: clamp(1.65rem, 3vw, 2.35rem); }
.site-header p { margin: 0; opacity: .88; }
.site-header .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700; }
.company-link { color: #dcecf7; text-decoration: none; font-weight: 600; white-space: nowrap; }
main { max-width: 1800px; margin: 0 auto; padding: 24px clamp(12px, 2.6vw, 42px) 50px; }
.search-card, .results-card, .welcome {
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
}
.search-card { padding: 22px; margin-bottom: 22px; }
.form-grid { display: grid; gap: 15px; }
.vehicle-grid { grid-template-columns: 2.2fr .7fr 1fr 1.35fr; }
.criteria-grid {
  grid-template-columns: repeat(5, minmax(135px, 1fr));
  grid-template-areas:
    "start end impact over roll"
    ". . dv . .";
  margin-top: 15px;
}
.field-start { grid-area: start; }
.field-end { grid-area: end; }
.field-impact { grid-area: impact; }
.field-dv { grid-area: dv; }
.field-over { grid-area: over; }
.field-roll { grid-area: roll; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; font-weight: 700; color: #34495b; }
label small { font-size: .73rem; color: var(--muted); font-weight: 400; }
input, select {
  width: 100%; min-height: 42px; border: 1px solid #b9c7d2; border-radius: 5px;
  padding: 8px 10px; background: white; color: var(--ink); font: inherit;
}
input:focus, select:focus { outline: 3px solid rgba(23,91,145,.18); border-color: var(--blue); }
.full { margin-top: 15px; }
.option-row { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-top: 20px; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 17px; min-height: 17px; height: 17px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 5px;
  min-height: 40px; padding: 8px 16px; border: 1px solid transparent;
  text-decoration: none; font: inherit; font-weight: 700; cursor: pointer;
}
.primary { background: var(--blue); color: white; margin-left: auto; min-width: 120px; }
.primary:hover { background: var(--blue-hover); }
.secondary { background: white; color: var(--blue); border-color: var(--blue); font-size: .82rem; }
.htmx-indicator { display: none; color: var(--muted); font-size: .85rem; }
.quota-note { color: var(--muted); font-size: .85rem; font-weight: 650; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
.results-card { overflow: hidden; }
.results-heading {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--soft);
}
.results-heading h2 { margin: 0 0 4px; font-size: 1.2rem; }
.results-heading p { margin: 0; color: var(--muted); font-size: .84rem; }
.exports { display: flex; gap: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
table.results { border-collapse: separate; border-spacing: 0; min-width: 1280px; width: 100%; table-layout: auto; font-size: .78rem; }
.results th {
  position: sticky; top: 0; z-index: 2; color: white; background: #294c67;
  padding: 10px 8px; text-align: left; white-space: nowrap;
}
.results td { border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; min-width: 82px; }
.results td:nth-child(2) { min-width: 250px; }
.results td img { display: block; max-width: 180px; max-height: 145px; object-fit: contain; }
.results a { color: #075f9b; }
.results tr:hover td { background: #f7fafc; }
.results tr.sister td { border-top: 3px solid #7890a2; }
.remove { width: 34px; min-width: 34px !important; text-align: center; }
.remove button { border: 0; background: transparent; color: var(--danger); font-size: 1.25rem; cursor: pointer; }
.empty { text-align: center; color: var(--muted); padding: 35px !important; }
.warning, .error { padding: 12px 18px; color: #6e5000; background: #fff7dc; border-bottom: 1px solid #eadcae; }
.error { color: #792525; background: #fff0f0; border: 1px solid #e2bcbc; border-radius: 6px; }
.welcome { padding: 50px 25px; text-align: center; color: var(--muted); }
.welcome h2 { color: var(--ink); }
footer { text-align: center; padding: 20px; color: var(--muted); font-size: .78rem; }
@media (max-width: 1050px) {
  .vehicle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vehicle-grid .wide { grid-column: span 2; }
  .criteria-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "start end"
      "impact over"
      "dv roll";
  }
}
@media (max-width: 620px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .vehicle-grid { grid-template-columns: 1fr; }
  .vehicle-grid .wide { grid-column: auto; }
  .criteria-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "start"
      "end"
      "impact"
      "dv"
      "over"
      "roll";
  }
  .primary { margin-left: 0; width: 100%; }
  .results-heading { align-items: flex-start; flex-direction: column; }
}
