:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #1c1f23;
  --muted: #545b63;
  --line: #d9dcd6;
  --accent: #0f766e;
  --accent-text: #ffffff;
  --pass: #166534;
  --pass-bg: #e8f5ec;
  --fail: #9f1239;
  --fail-bg: #fdecef;
  --warn: #854d0e;
  --warn-bg: #fdf5e1;
  --focus: #1d4ed8;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111416;
    --surface: #1a1e21;
    --text: #e8eaec;
    --muted: #a7afb6;
    --line: #2f363b;
    --accent: #2dd4bf;
    --accent-text: #0b1a18;
    --pass: #86efac;
    --pass-bg: #12291b;
    --fail: #fda4af;
    --fail-bg: #331820;
    --warn: #fcd34d;
    --warn-bg: #30270f;
    --focus: #93c5fd;
  }
}

* {
  box-sizing: border-box;
}
table {
  border-collapse: collapse;
  font-size: 15px;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
}
td:last-child {
  white-space: nowrap;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    17px / 1.55 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
}
a {
  color: var(--accent);
  text-underline-offset: 2px;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 16px;
  top: 8px;
  background: var(--surface);
  padding: 6px 10px;
  z-index: 2;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

header.site,
footer.site,
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}
header.site {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 6px;
}
.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}
header.site nav a {
  margin-left: 12px;
  font-size: 15px;
}
header.site nav a:first-child {
  margin-left: 0;
}
footer.site {
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding-top: 16px;
  padding-bottom: 32px;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
  margin: 18px 0 8px;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 23px;
  line-height: 1.25;
  margin: 36px 0 10px;
}
h3 {
  font-size: 19px;
  margin: 26px 0 8px;
}
h4 {
  font-size: 16px;
  margin: 0 0 4px;
}
.lede {
  color: var(--muted);
  margin: 0 0 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 14px;
}
.card h3 {
  margin-top: 0;
}
label {
  display: block;
  font-weight: 600;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
input[type="text"],
input[type="number"],
input[type="month"],
select {
  width: 100%;
  min-height: 46px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
#vin {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
button {
  font: inherit;
  font-weight: 650;
  min-height: 46px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 0;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  white-space: nowrap;
}
.row input {
  flex: 1 1 250px;
}
.row button {
  flex: 1 0 auto;
}
button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.hint {
  color: var(--muted);
  font-size: 15px;
  margin: 6px 0 0;
}
.status {
  margin: 8px 0 0;
  min-height: 1.5em;
}
.status.error {
  color: var(--fail);
}
.note {
  background: var(--warn-bg);
  color: var(--text);
  border-left: 4px solid var(--warn);
  padding: 10px 12px;
  border-radius: 6px;
}

.checks {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.checks li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.checks li:first-child {
  border-top: 0;
}
.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  align-self: start;
}
.badge.pass {
  color: var(--pass);
  background: var(--pass-bg);
}
.badge.fail {
  color: var(--fail);
  background: var(--fail-bg);
}
.badge.check-label,
.badge.review,
.badge.unknown {
  color: var(--warn);
  background: var(--warn-bg);
}
.checks .cite {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
}

.ask {
  margin: 14px 0 0;
  padding: 12px;
  border: 1px dashed var(--warn);
  border-radius: 8px;
}
fieldset {
  border: 0;
  margin: 14px 0 0;
  padding: 0;
}
legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 4px;
}
fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  margin-right: 18px;
  min-height: 44px;
}
input[type="radio"],
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}
label.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 400;
  min-height: 44px;
}
.s179 {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.s179 p {
  margin: 0;
}

.verdict {
  font-size: 18px;
}
.verdict.qualifies {
  border-color: var(--pass);
  background: var(--pass-bg);
}
.verdict.does-not-qualify {
  border-color: var(--fail);
  background: var(--fail-bg);
}
.verdict.incomplete {
  border-color: var(--warn);
  background: var(--warn-bg);
}
.verdict ul {
  font-size: 15px;
  padding-left: 20px;
  margin-bottom: 0;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}
.grid label {
  font-weight: 600;
}
.grid input,
.grid select {
  margin-top: 4px;
}
details#estimator {
  margin: 10px 0 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 32px;
}
.result {
  margin-top: 16px;
}
.result table {
  width: 100%;
}
.result .total {
  font-size: 20px;
  font-weight: 700;
}

.ad-slot {
  min-height: 100px;
  margin: 24px 0;
}
.ad-slot-bottom {
  min-height: 280px;
}

#guide ol,
#guide ul {
  padding-left: 22px;
}
#guide li {
  margin: 6px 0;
}
#faq details {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
#faq details p {
  margin: 8px 0 0;
}
.table-wrap {
  overflow-x: auto;
}
#guide .sources li {
  overflow-wrap: anywhere;
}
.prose {
  padding-bottom: 24px;
}

@media (min-width: 640px) {
  .row button {
    flex: 0 0 auto;
  }
  h1 {
    font-size: 38px;
  }
  .grid {
    grid-template-columns: 1fr 1fr;
  }
  .card {
    padding: 20px 22px;
  }
}

.print-only {
  display: none;
}
@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }
  header.site,
  footer.site,
  #tool,
  #guide,
  .ad-slot,
  .skip,
  .intro {
    display: none;
  }
  .print-only {
    display: block;
  }
  #summary table {
    width: 100%;
  }
  #summary td,
  #summary th {
    border-bottom: 1px solid #999;
  }
  a {
    color: #000;
  }
}

/* The hidden attribute must win over display: grid/flex set above. */
[hidden] {
  display: none;
}
