:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-strong: #12312b;
  --text: #1d2523;
  --muted: #68736f;
  --line: #dfe5df;
  --accent: #246b5e;
  --accent-strong: #194f46;
  --accent-soft: #e5f1ec;
  --gold: #c98b2e;
  --danger: #a33a2f;
  --shadow: 0 18px 50px rgba(20, 39, 34, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(36, 107, 94, 0.12), transparent 34rem),
    linear-gradient(180deg, #fbfbf8 0%, var(--bg) 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.app-header h1,
.search-panel h2,
.results-header h2 {
  margin: 0;
  letter-spacing: 0;
}

.app-header h1 {
  font-size: clamp(2rem, 4vw, 4.5rem);
  line-height: 0.98;
}

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

.data-status {
  max-width: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 12px 14px;
  text-align: right;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.7fr);
  gap: 24px;
  align-items: end;
  border-radius: 8px;
  background: var(--surface-strong);
  color: #f7fbf8;
  padding: 24px;
  box-shadow: var(--shadow);
}

.search-panel .eyebrow {
  color: #a6d8ca;
}

.search-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: inherit;
  font-size: 0.9rem;
  font-weight: 650;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 139, 46, 0.22);
}

button {
  min-height: 45px;
  border: 0;
  border-radius: 7px;
  background: var(--gold);
  color: #211508;
  cursor: pointer;
  font-weight: 800;
  padding: 0 18px;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.message {
  margin: 18px 0;
  color: var(--muted);
}

.message.error {
  color: var(--danger);
  font-weight: 700;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.summary-grid article,
.lane-card,
.results-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(20, 39, 34, 0.07);
}

.summary-grid article {
  padding: 18px;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.summary-grid strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1;
}

.lane-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px;
}

.lane-card h3,
.lane-card p {
  margin: 0;
}

.lane-card h3 {
  font-size: 1.1rem;
}

.lane-card div:last-child {
  text-align: right;
}

.lane-card p:not(.eyebrow) {
  margin-top: 6px;
  color: var(--muted);
}

.lane-arrow {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 8px 12px;
  text-transform: uppercase;
}

.results-section {
  overflow: hidden;
}

.results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.results-header label {
  width: min(320px, 100%);
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 13px 20px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.vehicle-cell strong {
  display: block;
}

.vehicle-cell span,
.match-badge {
  color: var(--muted);
  font-size: 0.85rem;
}

.match-badge {
  display: inline-flex;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 750;
  padding: 5px 9px;
}

@media (max-width: 780px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding-top: 22px;
  }

  .app-header,
  .results-header {
    align-items: stretch;
    flex-direction: column;
  }

  .data-status {
    max-width: none;
    text-align: left;
  }

  .search-panel,
  .search-form,
  .lane-card {
    grid-template-columns: 1fr;
  }

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

  .lane-card div:last-child {
    text-align: left;
  }

  .lane-arrow {
    width: max-content;
  }
}

@media (max-width: 460px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}
