:root { --ink: #1d2733; --muted: #5d6b7a; --line: #d9e0e7; --bg: #f7f9fb; --card: #fff; --accent: #1f5f99;
        --us: #1f5f99; --ca: #b3261e; font-family: system-ui, "Segoe UI", sans-serif; color: var(--ink);
        color-scheme: light dark; /* native form controls and scrollbars follow the theme */ }
@media (prefers-color-scheme: dark) {
  :root { --ink: #e6ebf0; --muted: #9aa8b6; --line: #2e3a46; --bg: #12181e; --card: #1a222b; --accent: #6fa8dc; }
}
body { margin: 0; background: var(--bg); }
header { background: var(--card); border-bottom: 1px solid var(--line); padding: 12px 16px; }
header h1 { margin: 0 0 8px; font-size: 1.2rem; }
nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
nav a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
nav a.active { color: var(--ink); border-color: var(--accent); }
.meta { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }
main { padding: 16px; max-width: 1200px; margin: 0 auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.card h3 { margin: 0 0 6px; font-size: 1rem; }
.big { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.note { color: var(--muted); font-size: .9rem; max-width: 70ch; }
.chart { position: relative; height: 280px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.sort-btn { font: inherit; font-weight: 600; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
            text-align: inherit; }
.sort-btn:focus-visible, .twisty:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode-group { display: inline-flex; gap: 0; }
.mode-btn[aria-pressed="true"] { background: var(--accent); color: var(--card); border-color: var(--accent); }
.card h4 { margin: 12px 0 4px; font-size: .95rem; }
.label { color: var(--muted); font-size: .85rem; margin: 0; }
.scope { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.findings { max-width: 1100px; margin: 0 auto; }
.profile { overflow-wrap: anywhere; }
.profile table { display: block; overflow-x: auto; }   /* wide profile/findings tables scroll, not the page */
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.search { padding: 6px 8px; width: min(360px, 100%); margin-bottom: 6px; }
.table-info, .pager { color: var(--muted); font-size: .85rem; margin: 6px 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tree, .tree ul { list-style: none; margin: 0; padding-left: 18px; }
.tree > li { padding-left: 0; }
.tree li > ul { display: none; }
.tree li.open > ul { display: block; }
.tree li.open > .twisty { transform: rotate(90deg); }
.twisty { display: inline-block; width: 18px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.dim { color: var(--muted); }
.vehicles-table { table-layout: fixed; }
.vehicles-table th:nth-child(1), .vehicles-table td:nth-child(1) { width: 38%; overflow-wrap: break-word; }
.vehicles-table th:nth-child(2), .vehicles-table td:nth-child(2) { width: 12%; }
.vehicles-table th:nth-child(3), .vehicles-table td:nth-child(3) { width: 16%; }
.vehicles-table th:nth-child(4), .vehicles-table td:nth-child(4) { width: 12%; }
.vehicles-table th:nth-child(5), .vehicles-table td:nth-child(5) { width: 22%; }
.expand-row { cursor: pointer; }
.expand-row:hover, .expand-row:focus-visible { background: var(--bg); }
.expand-detail td { background: var(--bg); padding: 8px 8px 12px; }
.expand-detail table { width: auto; max-width: 100%; }
.problem { background: var(--card); border: 1px solid var(--ca); border-radius: 6px; padding: 12px 16px; }
.profile { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 8px 16px; }
.profile table { width: auto; }
a { color: var(--accent); }
@media (max-width: 600px) { main { padding: 12px 16px; } .big { font-size: 1.3rem; } }
