/* Page styles for /used-car-inspection-checklist/ (screen + US Letter print). */
.print-only { display: none; }
.page-hdr .disclaimer { margin-top: 24px; max-width: 720px; }
.intro { margin-top: 14px; font-size: 16px; color: var(--text-secondary); max-width: 640px; }

.tools-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px 0 24px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.save-note { font-size: 13px; color: var(--muted); max-width: 560px; }
.tools-btns { display: flex; gap: 10px; }

.sec { padding: 28px 0 8px; }
.sec h2 { margin-bottom: 14px; }
.sec-num { color: var(--brand); }
.sec-sub { font-family: var(--body); font-size: 14px; letter-spacing: 0; color: var(--muted); text-transform: none; }
.items { list-style: none; display: grid; gap: 10px; }
.item fieldset { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px 16px; }
.item legend { float: left; width: 100%; font-size: 15px; color: var(--text); margin-bottom: 10px; }
.item legend + * { clear: both; }
.chip { display: inline-block; margin-left: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; vertical-align: 1px; }
.chip-db { color: var(--flagged); border-color: color-mix(in srgb, var(--flagged) 50%, transparent); }
.chip-pi { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 50%, transparent); }
.ctrls { display: flex; flex-wrap: wrap; gap: 8px; }
.ctrls .opt { padding: 8px 12px; font-size: 14px; }
.opt-done { margin-right: 4px; }

.sec-notes textarea { min-height: 140px; resize: vertical; }
.recon-field { max-width: 320px; }

/* Cost per Fix item */
.item-cost { margin-top: 10px; max-width: 220px; }
.cost-lbl { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.cost-print { display: none; }

/* Summary box */
.summary { margin-top: 28px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: var(--r-sm); padding: 18px 20px; }
.summary h2 { margin-bottom: 10px; }
.sum-lines { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.sum-line { font-size: 15px; color: var(--text-secondary); }
.sum-line strong { font-family: var(--mono); font-weight: 500; color: var(--text); }
.sum-main strong { color: var(--brand); }
.sum-warn { margin-top: 10px; font-size: 14px; color: var(--text); border-left: 3px solid var(--flagged); padding: 6px 10px; background: color-mix(in srgb, var(--flagged) 8%, transparent); }
.sum-help { margin-top: 10px; font-size: 13px; color: var(--muted); }
#sum-handoff { margin-top: 14px; }

/* Print buttons: orange outline, top of the list and after the last section */
.btn-print { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  font-family: var(--body); font-size: 14px; font-weight: 500; color: var(--brand); background: transparent;
  border: 1.5px solid var(--brand); border-radius: var(--r-sm); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.btn-print:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand-hover); border-color: var(--brand-hover); }
.btn-print:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; background: color-mix(in srgb, var(--brand) 12%, transparent); }
.btn-print:active { background: color-mix(in srgb, var(--brand) 20%, transparent); }
.print-icon { flex-shrink: 0; }
.print-end { margin-top: 28px; }

.cross { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--border); }

/* Per-item notes */
.item-note { margin-top: 8px; }
.note-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; background: none; border: none; color: var(--text-secondary); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.note-btn:hover { color: var(--text); }
.note-btn::before { content: '+ '; }
.note-wrap { margin-top: 6px; }
.note-lbl { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.note-area { min-height: 72px; resize: vertical; font-size: 15px; }
.note-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.note-print { display: none; }

/* Final Notes: optional */
#notes-open { margin-bottom: 8px; }
.sec-notes .sec-sub { margin-left: 2px; }

/* OBD code log */
.obd { margin-top: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 16px; }
.obd-title { font-family: var(--body); font-size: 16px; font-weight: 500; color: var(--text); }
.obd-help { margin: 4px 0 12px; }
.obd-none { margin-bottom: 12px; }
.obd-rows { list-style: none; display: grid; gap: 12px; margin-bottom: 12px; }
.obd-rows:empty { display: none; }
.obd-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 150px auto; gap: 10px; align-items: start; padding: 12px; background: var(--surface3); border: 1px solid var(--border); border-radius: var(--r-sm); }
.obd-f label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.obd-code { font-family: var(--mono); text-transform: uppercase; }
.obd-remove { align-self: end; }
.obd-blank { display: none; }

@media (max-width: 640px) {
  .obd { padding: 12px; }
  .obd-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .obd-f-mean { grid-column: 1 / -1; grid-row: 2; }
  .obd-remove { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 480px) {
  .ctrls .opt { padding: 8px 10px; gap: 8px; }
  .opt-done { margin-right: 0; }
}

/* ── PRINT: US Letter, black on white, no nav/CTAs ── */
@media print {
  @page { size: Letter; margin: 0.5in; }
  :root { --text: #000; --muted: #333; --text-secondary: #222; }
  html, body { background: #fff !important; color: #000; font-size: 9pt; line-height: 1.22; }
  .t-nav, .t-footer, .screen-only, .skip, .cross, .help, .field-error, .chip-sep { display: none !important; }
  .print-only { display: block; }
  .wrap { max-width: none; padding: 0; }
  .page-hdr { padding: 0 0 6pt; }
  h1 { color: #000; font-size: 19pt; line-height: 1; }
  .div { display: none; }
  .lede { color: #000; font-size: 9.5pt; max-width: none; margin-top: 4pt; }
  .page-hdr .disclaimer { color: #000; background: none; border: 1px solid #000; border-radius: 0; padding: 4pt 6pt; margin-top: 6pt; font-size: 9pt; max-width: none; }
  .print-meta { margin-top: 8pt; font-size: 9pt; }
  .sec { padding: 4pt 0 0; break-inside: avoid; page-break-inside: avoid; }
  .sec h2 { color: #000; font-size: 12pt; margin-bottom: 2pt; border-bottom: 1px solid #000; }
  .sec-num { color: #000; }
  .sec-sub { color: #333; font-size: 8.5pt; }
  .items { gap: 0; }
  .item fieldset { background: none; border: none; border-bottom: 1px solid #bbb; border-radius: 0; padding: 1.5pt 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8pt; }
  .item legend { float: left; margin: 0; font-size: 8.5pt; color: #000; width: auto; }
  .chip { color: #000 !important; border-color: #000 !important; font-size: 8pt; padding: 0 4pt; }
  .ctrls { flex-wrap: nowrap; gap: 6pt; }
  .ctrls .opt, .opt { min-height: 0; padding: 0; border: none; background: none; color: #000; font-size: 8pt; gap: 3pt; }
  .opt input, .toggle input { width: 9pt; height: 9pt; border: 1px solid #000; border-radius: 0 !important; background: #fff; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .opt input:checked { background: #000 !important; border-color: #000 !important; }
  .opt input:checked::after { display: none; }
  .sec-notes { break-inside: avoid; }
  .sec-notes label { color: #000; font-size: 9pt; }
  .sec-notes textarea { display: none; }
  .notes-print.print-only { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 9pt; border: 1px solid #000; padding: 4pt 6pt; margin-bottom: 4pt; }
  .obd.has-codes:not(.is-none) .obd-none { display: none; }
  .money input { background: #fff; color: #000; border: 1px solid #000; min-height: 0; border-radius: 0; }
  .recon-field { max-width: 2.5in; }
  .print-foot { margin-top: 8pt; font-size: 8.5pt; text-align: center; }
  a { color: #000; text-decoration: none; }

  /* Spanish runs ~15% longer; tighten rows so it still fits 2 Letter pages. */
  html:lang(es) .item fieldset { padding: 1pt 0; gap: 6pt; }
  html:lang(es) .item legend { font-size: 8.1pt; line-height: 1.18; }
  html:lang(es) .ctrls { gap: 4pt; }
  html:lang(es) .ctrls .opt { font-size: 8pt; gap: 2pt; }
  html:lang(es) .lede, html:lang(es) .page-hdr .disclaimer { font-size: 8.5pt; }
  html:lang(es) .sec { padding-top: 3pt; }
  html:lang(es) .obd-blank td { height: 13pt; }

  /* A Fix item's cost prints next to the item only when filled. */
  .item-cost { display: none !important; grid-column: 1 / -1; margin: 0; max-width: none; }
  .item-cost.has-cost { display: block !important; }
  .item-cost .cost-lbl, .item-cost .money, .item-cost .field-error { display: none !important; }
  .item-cost .cost-print { display: block; font-size: 8.5pt; color: #000; }

  /* Summary prints as one compact box. */
  .summary { background: none; border: 1px solid #000; border-radius: 0; padding: 3pt 6pt; margin-top: 6pt; break-inside: avoid; }
  .summary h2 { font-size: 10pt; color: #000; margin: 0 0 1pt; }
  .sum-lines { gap: 0 18pt; }
  .sum-line, .sum-line strong, .sum-main strong { font-size: 9pt; color: #000; }
  .sum-warn { color: #000; background: none; border-left: 2px solid #000; font-size: 8.5pt; padding: 1pt 5pt; margin-top: 2pt; }

  /* Item notes print under their item only when filled. */
  .item-note { display: none; grid-column: 1 / -1; margin: 0; }
  .item-note.has-note { display: block; }
  .item-note .note-print { display: block; font-size: 8.5pt; font-style: italic; color: #000; white-space: pre-wrap; overflow-wrap: anywhere; }

  /* The final Notes section is left out of print while it is empty. */
  .sec-notes.is-empty { display: none !important; }
  #notes-body[hidden] { display: block !important; }

  /* OBD code log: filled rows print as a table-like list; an empty log
     prints five blank rows to write codes in by hand. */
  .sec:has(.obd) { break-inside: auto; page-break-inside: auto; }
  .sec h2, .obd-title { break-after: avoid; page-break-after: avoid; }
  .obd { break-inside: avoid; page-break-inside: avoid; }
  .obd-blank, .obd-row { break-inside: avoid; }
  .obd { background: none; border: none; padding: 4pt 0 0; margin-top: 2pt; }
  .obd-title { font-size: 9.5pt; color: #000; }
  .obd-none { margin: 2pt 0 4pt; }
  .obd-rows { gap: 0; margin: 0; }
  .obd-row { grid-template-columns: 0.9in 1fr 1.1in; gap: 6pt; padding: 2pt 0; background: none; border: none; border-bottom: 1px solid #bbb; border-radius: 0; }
  .obd-f label { font-size: 8pt; color: #333; margin: 0; }
  .obd-row input, .obd-row select { min-height: 0; padding: 0; border: none; background: none; color: #000; font-size: 9pt; appearance: none; background-image: none; }
  .obd-blank.print-only { display: table; width: 100%; border-collapse: collapse; font-size: 8.5pt; }
  .obd-blank th { white-space: nowrap; text-align: left; font-weight: 500; border-bottom: 1px solid #000; padding: 2pt 4pt 2pt 0; }
  .obd-blank th:first-child { width: 0.9in; }
  .obd-blank th:last-child { width: 1.9in; }
  .obd-blank td { border-bottom: 1px solid #999; height: 14pt; }
  .obd.has-codes .obd-blank, .obd.is-none .obd-blank, .obd.is-none .obd-log { display: none !important; }
}
