* { box-sizing: border-box; }
body {
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
  color: #1b1b1b;
  background: #fafafa;
}
header h1 a { color: #111; text-decoration: none; }
.tagline { color: #333; font-weight: 700; margin-top: 0.4rem; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.site-header__text { flex: 1 1 auto; min-width: 0; }
.site-header__text h1 { margin: 0; }
.site-header__logo { height: 180px; width: auto; flex: 0 0 auto; }
@media (max-width: 600px) {
  .site-header__logo { height: 120px; }
}
.search-form { display: flex; flex-direction: column; gap: 0.6rem; margin: 1.5rem 0; }
.search-form .form-heading { font-weight: 700; font-size: 1rem; color: #111; margin-top: 0.6rem; margin-bottom: 0.35rem; }
.search-form .form-heading:first-child { margin-top: 0; }
.search-form input[type=text] { padding: 0.6rem; font-size: 1.1rem; border: 1px solid #bbb; border-radius: 6px; }
.search-form .mode { display: flex; gap: 1rem; font-size: 0.9rem; }
.search-form select { padding: 0.5rem 0.6rem; font-size: 1rem; border: 1px solid #bbb; border-radius: 6px; background: white; }
.search-form button { padding: 0.6rem 1rem; background: #0b3d91; color: white; border: 0; border-radius: 6px; font-size: 1rem; cursor: pointer; margin-top: 1.25rem; align-self: flex-start; }
.search-form button:hover { background: #072b68; }
.error { color: #a00; background: #fee; padding: 0.6rem; border-radius: 6px; }
.card { background: white; border: 1px solid #e2e2e2; border-radius: 8px; padding: 1rem 1.25rem; margin: 1rem 0; }
.card h3 { margin-top: 0; color: #0b3d91; }
.card h3.carrier-name,
.card h3.red-header { color: #c00; }
.card h3.black-header { color: #111; }

.collapsible > summary.collapsible-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.1rem 0;
}
.collapsible > summary.collapsible-summary::-webkit-details-marker { display: none; }
.collapsible > summary.collapsible-summary::marker { content: ""; }
.collapsible > summary.collapsible-summary::before {
  content: "\25B6";  /* ▶ */
  display: inline-block;
  font-size: 0.8rem;
  color: #666;
  transition: transform 0.15s ease;
  flex: 0 0 auto;
}
.collapsible[open] > summary.collapsible-summary::before { transform: rotate(90deg); }
.collapsible > summary.collapsible-summary > h3 { flex: 1 1 auto; margin: 0; }
.collapsible-body { margin-top: 0.75rem; }

.state-switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: #333;
}
.state-switch label { font-size: 0.85rem; color: #555; }
.state-switch select {
  padding: 0.25rem 0.4rem;
  font-size: 0.9rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: white;
}

.bar-chart { margin: 1.5rem 0 0.5rem; }
.bar-chart__title { font-size: 0.9rem; font-weight: 600; color: #333; margin-bottom: 0.5rem; }
.bar-chart__bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 400px;
  padding: 1.25rem 0 0;
  border-bottom: 2px solid #333;
  overflow-x: auto;
}
.bar-chart__col {
  flex: 1 1 0;
  min-width: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.bar-chart__pair {
  display: flex;
  gap: 1px;
  align-items: flex-end;
  width: 100%;
  height: 100%;
}
.bar-chart__pair > .bar-chart__bar { flex: 1 1 0; }
.bar-chart__bar {
  width: 100%;
  min-height: 1px;
  position: relative;
  background: #666;
}
.bar-chart__bar--crash { background: #c00; }
.bar-chart__bar--insp { background: #0b3d91; }
.bar-chart__count {
  position: absolute;
  top: -1.1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: #333;
  white-space: nowrap;
}
.bar-chart__xlabel {
  font-size: 0.65rem;
  color: #555;
  margin-top: 0.35rem;
  transform: rotate(-45deg);
  transform-origin: top left;
  white-space: nowrap;
  height: 2.5em;
}
.bar-chart__legend {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #333;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.swatch { display: inline-block; width: 12px; height: 12px; margin-right: 4px; border-radius: 2px; vertical-align: -2px; }
.swatch--insp { background: #0b3d91; }
.swatch--crash { background: #c00; }

.reg-list { list-style: none; padding: 0; margin: 0.15rem 0 0; }
.reg-list--cols { columns: 3; column-gap: 1.75rem; }
.reg-list li { break-inside: avoid; padding: 0; margin: 0; font-size: 0.88rem; line-height: 1.35; color: #999; }
.reg-list li.checked { color: #111; font-weight: 600; }
.reg-list .chk { display: inline-block; width: 1.25em; font-weight: 700; color: #c00; text-align: center; }
.reg-asof { font-size: 0.8rem; font-weight: 400; color: #666; margin-left: 0.5rem; }

.veh-table { line-height: 1.2; }
.veh-table th, .veh-table td { padding: 0.15rem 0.75rem; font-size: 0.88rem; border-bottom: 1px solid #f0f0f0; }
.veh-table th:first-child { text-align: left; }
.veh-table th:not(:first-child), .veh-table td:not(:first-child) { text-align: right; width: 7rem; font-variant-numeric: tabular-nums; }
.veh-table tbody tr:nth-child(even) { background: #fafbfd; }

/* Tighter vertical rhythm inside the top static-info cards */
.card > p { margin: 0.2rem 0; line-height: 1.35; }
.card > h3 + p { margin-top: 0.3rem; }

/* Compact inline summary strip inside the detail sections */
.state-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.25rem;
  font-size: 0.88rem;
  padding: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
  background: #f6f8fb;
  border-left: 3px solid #c00;
  border-radius: 2px;
  line-height: 1.25;
}
.state-summary em { font-style: normal; font-weight: 600; color: #555; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.04em; }
.state-summary span { white-space: nowrap; color: #444; }
.state-summary strong { color: #111; }
.state-summary--insp { border-left-color: #0b3d91; }

@media (max-width: 700px) {
  .reg-list--cols { columns: 2; }
}
@media print, (max-width: 500px) {
  .reg-list--cols { columns: 1; }
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid #eee; }
th { background: #f0f3f8; }
pre { background: #f4f4f4; padding: 0.75rem; overflow: auto; font-size: 0.8rem; }
footer { margin-top: 3rem; font-size: 0.8rem; color: #666; border-top: 1px solid #ddd; padding-top: 1rem; }
.muted { color: #666; font-size: 0.9rem; }
.state-table td:nth-child(2), .state-table td:nth-child(3),
.state-table th:nth-child(2), .state-table th:nth-child(3) { text-align: right; width: 10rem; }
.state-table tr.zero-row td { color: #aaa; }
.state-table tbody tr:nth-child(even) { background: #fafbfd; }

.detail-table { font-size: 0.85rem; }
.detail-table th, .detail-table td { padding: 0.3rem 0.5rem; vertical-align: top; }
.detail-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.detail-table tbody tr:nth-child(even) { background: #fafbfd; }
.viol-list { margin: 0.4rem 0 0 1rem; padding: 0; font-size: 0.85rem; }
.viol-list li { margin-bottom: 0.6rem; list-style: none; padding: 0.4rem 0.6rem; background: #f6f8fb; border-left: 3px solid #0b3d91; border-radius: 2px; }
.viol-list .v-head { font-size: 0.95rem; margin-bottom: 0.2rem; }
.viol-list .v-meta { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; color: #333; font-size: 0.8rem; margin-bottom: 0.25rem; }
.viol-list .v-meta em { color: #666; font-style: normal; font-weight: 600; margin-right: 0.25rem; }
.viol-list .v-desc { color: #222; }
.oos-tag { background: #a00; color: white; font-size: 0.7rem; padding: 1px 5px; border-radius: 3px; margin-left: 0.25rem; vertical-align: 2px; }

main { max-width: 1200px; margin: 0 auto; }
body { max-width: none; }
body > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
