:root {
  --ink: #1c1915;
  --muted: #5c564c;
  --paper: #f6f1e7;
  --card: #fffdf8;
  --line: #d9d0c1;
  --accent: #8c2f2f;
  --ok: #1f6b45;
  --warn: #8a4b08;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.4;
}
header, main, .sheet { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }
h1 { font-size: 1.8rem; margin: 0.2rem 0; }
h2 { font-size: 1.2rem; margin: 0 0 0.6rem; }
.eyebrow { letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.75rem; color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin: 0 0 1rem;
}
label { display: block; font-size: 0.92rem; margin: 0.55rem 0; }
form.aligned > label {
  display: grid;
  grid-template-columns: 14.5rem minmax(12rem, 24rem);
  column-gap: 0.75rem;
  align-items: center;
  margin: 0.4rem 0;
}
form.aligned > label input,
form.aligned > label select,
form.aligned > label textarea {
  width: 100%;
  max-width: none;
}
form.aligned > label.tick {
  display: grid;
  grid-template-columns: 14.5rem minmax(12rem, 24rem);
  align-items: center;
}
form.aligned > label.tick input {
  width: 1.2rem;
  height: 1.2rem;
  justify-self: start;
}
.row label {
  display: grid;
  grid-template-columns: auto 10.5rem;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}
.row label input,
.row label select {
  width: 10.5rem;
  max-width: none;
}
#docKind { width: 14rem; }
.checks {
  margin: 0.9rem 0 1.1rem;
  max-width: 38rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: white;
}
.check-row, .check-head {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) 6.5rem 6.5rem;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.75rem;
}
.check-head {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #efe8dc;
  border-bottom: 1px solid var(--line);
}
.check-head span:nth-child(n + 2) { text-align: center; }
.check-row { border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row:nth-child(even) { background: #f7f3eb; }
.check-row .choice {
  display: flex;
  margin: 0;
  justify-content: center;
  align-items: center;
  min-height: 2.75rem;
}
input, select, textarea, button {
  font: inherit;
  color: inherit;
}
input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="time"], select, textarea {
  width: 100%;
  max-width: 28rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
textarea { min-height: 4.5rem; }
button, .button {
  background: var(--ink);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary, .button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.warn { background: var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.status { min-height: 1.2rem; color: var(--accent); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0.5rem 0;
  padding: 0.6rem 0.8rem;
}
.choice { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; }
input[type="checkbox"],
input[type="radio"] {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  accent-color: #1c1915;
  flex: 0 0 auto;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: white; }
table.lines { table-layout: fixed; }
table.lines.checks { table-layout: auto; }
table.lines.checks .col-date { width: 7rem; }
table.lines.checks .col-miles { width: 4.8rem; }
table.lines.checks th:nth-child(1),
table.lines.checks td:nth-child(1),
table.lines.checks th:nth-child(2),
table.lines.checks td:nth-child(2) {
  white-space: nowrap;
  padding-right: 0.85rem;
}
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 0.45rem 0.5rem; vertical-align: middle; }
th { font-size: 0.75rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); }
table.lines .fit { white-space: nowrap; }
table.lines .addr { overflow-wrap: anywhere; }
table.lines .actions { white-space: nowrap; text-align: right; }
table.lines .actions button + button { margin-left: 0.3rem; }
table.lines tbody tr:nth-child(even) td { background: #f7f3eb; }
table.lines td.fit, table.lines th.fit { text-align: left; }
.fine { color: var(--muted); font-size: 0.85rem; }
.top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
ul.findings { margin: 0; padding-left: 1.1rem; }
ul.findings li { margin: 0.25rem 0; }

@media (max-width: 700px) {
  header, main { padding: 0.9rem; }
  form.aligned > label,
  form.aligned > label.tick { grid-template-columns: 1fr; }
  .check-row, .check-head { grid-template-columns: minmax(6rem, 1fr) 4.5rem 4.5rem; }
}

@media print {
  body { background: white; }
  .no-print { display: none !important; }
  .card, .sheet { border: 0; padding: 0; }
  a { color: black; text-decoration: none; }
  table { font-size: 11px; }
  tr { break-inside: avoid; }
}
