:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #d8e0ea;
  --brand: #145ea8;
  --brand-dark: #0f4275;
  --header: #07111f;
  --good: #157347;
  --warn: #a16207;
  --soft: #f7fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
}

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

.primary {
  background: var(--brand);
  color: #fff;
}

.primary:hover {
  background: var(--brand-dark);
}

.secondary {
  background: #e7edf4;
  color: var(--ink);
  border: 1px solid var(--line);
}

.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 84px;
  padding: 14px 22px;
  background: var(--header);
  color: #fff;
}

.logo {
  width: 190px;
  max-height: 48px;
  object-fit: contain;
}

.app-header h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.app-header p {
  margin: 4px 0 0;
  color: #b8c4d6;
}

.status-pill {
  min-width: 160px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #0f1d31;
  color: #d7e3f2;
  text-align: center;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(340px, 0.65fr);
  gap: 16px;
  padding: 16px;
}

.panel,
.results {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.panel {
  padding: 14px;
}

.panel-title,
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

h2 {
  margin: 0;
  font-size: 22px;
}

.panel-title select,
.lookup-form select,
.lookup-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #020617;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.lookup-form {
  display: grid;
  gap: 12px;
}

.lookup-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

#plateInput {
  text-transform: uppercase;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.candidates {
  margin-top: 16px;
}

.subhead,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.candidate-list {
  display: grid;
  gap: 8px;
  min-height: 76px;
  margin-top: 8px;
}

.candidate-list.empty {
  align-content: center;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.candidate {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  padding: 10px 12px;
  text-align: left;
}

.candidate strong {
  font-size: 22px;
}

.candidate span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.results {
  margin: 0 16px 16px;
  padding: 16px;
}

.hidden {
  display: none;
}

.result-title {
  margin: 0;
}

.vehicle-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.vehicle-field {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  padding: 8px 10px;
}

.vehicle-field span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.vehicle-field strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 12px;
}

.result-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.card-head {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfe;
}

.card-head h3 {
  margin: 0;
  font-size: 18px;
}

.card-body {
  padding: 10px 12px 12px;
}

.variant-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.variant {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  padding: 10px;
}

.variant-title {
  min-height: 34px;
  margin-bottom: 8px;
  color: var(--brand-dark);
  font-weight: 900;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #e7edf4;
  padding: 7px 6px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.data-table td:first-child {
  font-weight: 800;
}

.part-list {
  display: grid;
  gap: 8px;
}

.part-row {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e7edf4;
  border-radius: 6px;
  background: var(--soft);
}

.part-row img {
  width: 62px;
  height: 42px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e7edf4;
  border-radius: 4px;
}

.part-row strong {
  display: block;
  font-size: 16px;
}

.part-row span {
  color: var(--muted);
  font-size: 12px;
}

.notice {
  color: var(--warn);
  font-weight: 800;
}

.raw-text {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.raw-text summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

pre {
  overflow: auto;
  max-height: 420px;
  padding: 12px;
  border-radius: 6px;
  background: #0b1220;
  color: #e5edf7;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-header {
    grid-template-columns: 1fr;
  }

  .logo {
    width: 170px;
  }

  .button-row {
    grid-template-columns: 1fr;
  }
}
