:root {
  /* --- surfaces & ink --- */
  --bg: #0d0d0d;
  --bg-card: #15181d;
  --bg-card-2: #1c2027;
  --border: #2a2f38;
  --text: #ffffff;
  --text-secondary: #c3c2b7;
  --text-dim: #898781;

  /* --- brand (chrome only: logo, buttons — never data) --- */
  --brand: #ff4d3d;

  /* --- status palette (validated against this dark surface) ---
     Reserved for verdict/grade meaning. Never reused as a series color. */
  --good: #0ca30c;
  --warn: #fab219;
  --bad: #d03b3b;

  /* --- interface accent ---
     Readable yellow for interface text that was sitting at --text-dim and
     was hard to read: inactive tabs, form labels, prompts, the drop zone.
     12.8:1 against the card background, against 5.0:1 for the grey it
     replaces. Deliberately LIGHTER than --warn so it never reads as a
     status colour, and deliberately kept OFF the chart, where yellow would
     compete with the warning band and the plotted line. */
  --accent: #ffd75e;
  /* Same hue, quieter, for long-form fine print like the footer disclaimer.
     Full-strength yellow on three lines of legal text shouts louder than
     the thing the page is actually for. 8.8:1 — still comfortably readable. */
  --accent-quiet: #d4b455;

  /* --- chart chrome --- */
  --grid: #2c2c2a;
  --axis: #383835;
  --series: #ffffff;

  --radius: 14px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
code { background: var(--bg-card-2); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(13, 13, 13, 0.93);
  backdrop-filter: blur(6px);
  z-index: 20;
  gap: 12px;
  flex-wrap: wrap;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.logo .dont { color: var(--brand); }

nav.tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}
nav.tabs button {
  border: none;
  background: transparent;
  color: var(--accent);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
nav.tabs button.active { background: var(--brand); color: #fff; }

.hero { padding: 44px 0 10px; text-align: center; }
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  /* Two lines now, so tighten the leading — default line-height on a 2.6rem
     heading leaves a gap that reads as two separate headings. */
  line-height: 1.15;
}
/* Both lines are short enough to fit a phone as-is, so the <br> stays on
   every screen size: the headline is always exactly two lines. */
.hero p {
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.5;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 22px;
}

.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field { flex: 1; min-width: 170px; display: flex; flex-direction: column; gap: 6px; }
.mileage-field { max-width: 200px; }

label {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hint { font-size: 0.78rem; color: var(--accent); }
.hint.ok { color: var(--good); }
.hint.warn { color: var(--warn); }

input, select {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 14px;
  border-radius: 10px;
  font-size: 1rem;
  width: 100%;
  font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
#vin { text-transform: uppercase; letter-spacing: 0.06em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.vin-input-group { display: flex; gap: 8px; }
.vin-input-group input { flex: 1; }
.scan-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0 15px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  min-height: 48px;
}
.scan-btn:hover { border-color: var(--brand); }
.scan-btn span { color: #22c55e; font-weight: 700; font-size: 1rem; }
.scan-btn[hidden] { display: none; }

button.primary {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 14px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
  min-height: 48px;
  font-family: inherit;
}
button.primary:disabled { opacity: 0.5; cursor: default; }
button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  font-family: inherit;
  font-size: 0.95rem;
}
button.secondary:hover { border-color: var(--text-dim); }

.error-msg { color: var(--bad); font-size: 0.9rem; margin-top: 10px; }
.muted { color: var(--accent); font-size: 0.85rem; }

/* =====================================================================
   RESULT: header -> narrative -> pros/cons -> score -> chart
   ===================================================================== */
.result { margin-top: 26px; }

/* Keep the sticky header from covering the top of a result when it
   scrolls into view. This has to sit on the elements scrollIntoView is
   actually called on, not on their children. */
#result-container,
#batch-detail,
#batch-result-card {
  scroll-margin-top: 96px;
}

.result-head {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 22px;
  border-bottom: none;
}
.result-title {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.result-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
/* Engine size gets its own badge next to the title, not just a line in
   the spec row below — a customer glancing at the result should not be
   able to miss which engine this is, especially on models that ship more
   than one (a Renegade's 1.4L turbo vs. 2.4L Tigershark grade very
   differently). */
.engine-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.spec-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}
.spec {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.spec-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 600;
}
.spec-value { font-size: 1.05rem; font-weight: 600; }

/* Always drawn on white regardless of light/dark theme, since a barcode
   only scans reliably as black bars on a light background — the SVG
   itself also paints a white rect behind the bars, this is just the
   card chrome around it. */
.vin-barcode {
  margin-top: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 420px;
}
.vin-barcode-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  font-weight: 600;
  align-self: flex-start;
}
.vin-barcode-img { width: 100%; }
.vin-barcode-img svg { display: block; width: 100%; height: auto; }
.vin-barcode-text {
  font-family: monospace;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: #111;
}

.result-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0 22px 22px;
}

.narrative {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-secondary);
  padding: 20px 0;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* --- pros & cons side by side --- */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding-bottom: 22px;
}
.pc-col {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.pc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.pc-head.pros { color: var(--good); }
.pc-head.cons { color: var(--bad); }
.pc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pc-list li {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
}
.pc-list li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
}
.pc-col.pros .pc-list li::before { content: "+"; color: var(--good); }
.pc-col.cons .pc-list li::before { content: "−"; color: var(--bad); }
.pc-list li.empty { color: var(--text-dim); font-style: italic; padding-left: 0; }
.pc-list li.empty::before { content: ""; }

.recall-check {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 22px;
}
.recall-check.advisory {
  background: rgba(208, 59, 59, 0.10);
  border-color: rgba(208, 59, 59, 0.40);
}
.rc-text { flex: 1; min-width: 250px; font-size: 0.9rem; line-height: 1.5; color: var(--text-secondary); }
.recall-check.advisory .rc-text strong { color: var(--bad); }
.rc-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  padding: 10px 16px; border-radius: 9px; font-weight: 600; font-size: 0.88rem;
  text-decoration: none; white-space: nowrap;
}
.rc-btn:hover { border-color: var(--text-dim); }
.rc-action { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rc-btn { display: inline-block; }
.rc-hint { font-size: 0.72rem; color: var(--text-dim); max-width: 260px; text-align: right; line-height: 1.4; }
.rc-hint.ok { color: var(--good); }
.rc-hint.warn { color: var(--warn); }
.rc-vin {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem; letter-spacing: 0.06em; color: var(--text-secondary);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 8px; user-select: all; cursor: pointer;
}
@media (max-width: 560px) {
  .rc-action { width: 100%; align-items: stretch; }
  .rc-btn { width: 100%; text-align: center; }
  .rc-hint { max-width: none; text-align: center; }
  .rc-vin { text-align: center; }
}

.estimate-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 4px;
  padding: 2px 7px;
  vertical-align: middle;
}

.refine-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(250, 178, 25, 0.10);
  border: 1px solid rgba(250, 178, 25, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 20px;
}
.refine-text { flex: 1; min-width: 240px; font-size: 0.9rem; line-height: 1.5; color: var(--text-secondary); }
.refine-text strong { color: var(--warn); }
.refine-controls { display: flex; gap: 8px; align-items: center; }
.refine-controls select { min-width: 170px; }
@media (max-width: 560px) {
  .refine-controls { width: 100%; }
  .refine-controls select { flex: 1; }
}

/* --- buy score: sits directly under the vehicle header, because the
   score is the thing everyone looks for first --- */
.score-block {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  padding-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.model-picker select { font-size: 1rem; }
.score-number {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.score-number .out-of { font-size: 1.1rem; font-weight: 600; color: var(--text-dim); letter-spacing: 0; }
.score-meta { flex: 1; min-width: 200px; }
.score-verdict {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.score-sub { color: var(--text-dim); font-size: 0.9rem; margin: 0; }

.tone-good { color: var(--good); }
.tone-warn { color: var(--warn); }
.tone-bad { color: var(--bad); }

.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  border: 2px solid currentColor;
}

/* --- chart --- */
.chart-block { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 20px; }
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.chart-title { font-size: 1rem; font-weight: 700; margin: 0; }
.chart-sub { color: var(--text-dim); font-size: 0.85rem; margin: 0 0 14px; }
.chart-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.legend-swatch { width: 18px; height: 0; border-top-width: 2px; border-top-style: solid; display: inline-block; }
.legend-swatch.series { border-top-color: var(--series); }
.legend-swatch.typical { border-top-color: var(--text-dim); border-top-style: dashed; }

.chart-wrap { position: relative; width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.chart-toggle:hover { color: var(--text); border-color: var(--text-dim); }

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: nowrap;
  transform: translate(-50%, -120%);
  z-index: 5;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}
.chart-tooltip .tt-miles { color: var(--text-dim); }
.chart-tooltip .tt-score { font-weight: 700; }

table.curve-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
table.curve-table th, table.curve-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
table.curve-table th {
  color: var(--text-dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
table.curve-table tr.is-current { background: var(--bg-card-2); font-weight: 700; }

/* =====================================================================
   scanner overlay
   ===================================================================== */
#scanner-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  display: flex;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#scanner-overlay[hidden] { display: none; }
/* Full screen, so turning the phone sideways gives the camera the whole
   width for a long VIN barcode. */
.scanner-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.scanner-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-weight: 600;
  padding: 8px 12px;
  gap: 12px;
}
.scanner-torch {
  margin-left: auto;
  background: none;
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  min-height: 40px;
  font-weight: 600;
  cursor: pointer;
}
.scanner-torch.on { background: #fff; color: #111; }
.scanner-photo { margin-left: auto; background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important; }
#scanner-snap { margin-left: 0; }
#scanner-snap + .scanner-torch { margin-left: 0; }
.scanner-diag {
  color: #9a9a9a;
  font-size: 0.7rem;
  text-align: center;
  padding: 0 12px 8px;
  font-family: monospace;
}
.scanner-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 8px;
  min-width: 44px;
  min-height: 44px;
}
.scanner-view {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#scanner-video {
  width: 100%;
  height: 100%;
  background: #000;
  display: block;
  object-fit: cover;
}
/* Long, thin box like dedicated VIN scanners use. */
.scanner-reticle {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 50%;
  height: 22%;
  min-height: 90px;
  transform: translateY(-50%);
  border: 3px solid var(--brand);
  border-radius: 8px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
/* Aiming line through the middle of the box, like Black Book's scanner. */
.scanner-reticle::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--brand);
  opacity: 0.9;
}
@media (orientation: landscape) {
  .scanner-reticle { left: 1%; right: 1%; height: 36%; }
  .scanner-tip { display: none; }
  .scanner-head span { display: none; }
}
.scanner-tip {
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  padding: 6px 12px 0;
  opacity: 0.85;
}
.scanner-status {
  color: var(--text-secondary);
  text-align: center;
  padding: 6px 12px 10px;
  font-size: 0.9rem;
  min-height: 1.4em;
}

/* =====================================================================
   dealer pro
   ===================================================================== */
.pro-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pro-header h2, .pro-header h3 { margin: 0; }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  color: var(--accent);
  cursor: pointer;
}
.upload-zone.drag { border-color: var(--brand); color: var(--text); }

table.grade-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  /* Trimmed from 0.9rem — the Trend and merged Grade/Score columns
     freed up some room, but VIN is a long, unbreakable 17-character
     string with nowhere to shrink to, so it's the column that benefits
     most from every column around it giving up a little space. */
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
table.grade-table th, table.grade-table td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
}
table.grade-table th {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
table.grade-table tbody tr { cursor: pointer; }
table.grade-table tbody tr:hover { background: var(--bg-card-2); }

/* "Trend" column — see buildSparkline() in app.js. A non-sortable header,
   so it doesn't get the sort-arrow cursor the other th's have. */
th.thumb-th { cursor: default; }

td.thumb-cell {
  width: 1%;
  white-space: nowrap;
  padding: 6px 10px;
}

/* Auction # and VIN — both short, fixed-format identifiers, set in
   monospace so every character lines up column-to-column down the sheet.
   Was inline styles on each <td>; pulled into a class so print can target
   it directly (see @media print below). */
.mono-cell { font-family: monospace; font-size: 0.85em; }

/* The batch sheet's own small Code 39 barcode (see vinBarcodeMini() in
   app.js) — print-only, same idea as .print-only below: a barcode in
   every row of the live on-screen table would just be clutter, since
   nobody scans a monitor. It only earns its place on the printed sheet,
   which is what actually goes to the auction lot. */
.batch-vin-barcode { display: none; }
/* On-screen scannable VIN barcode in each batch row (vinBarcodeScreen() in
   app.js): scanned straight off the screen with a phone to price the car.
   Fixed pixel size so the bars stay whole pixels and scan reliably. Hidden
   when printing -- the paper sheet has its own barcode above. */
.batch-vin-screen { display: block; line-height: 0; margin-bottom: 4px; }
.batch-vin-screen svg { display: block; width: 327px; max-width: none; height: 56px; }
@media print { .batch-vin-screen { display: none !important; } }
.spark-svg {
  display: block;
  border-radius: 6px;
  background: var(--bg-card-2);
  transition: transform 0.12s ease-out;
  transform-origin: top left;
}
/* Hovering anywhere on the row (same trigger as the row's own highlight
   above, and the same zone that already opens the detail on click) blows
   its thumbnail up to a real, readable preview. transform doesn't affect
   layout, so nothing else on the page shifts — it just draws over
   whatever's to its right/below, same idea as the shrink/peek panel
   above the table. */
table.grade-table tbody tr:hover .spark-svg {
  transform: scale(2.3);
  position: relative;
  z-index: 30;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.grade-pill {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.grade-pill.good { color: var(--good); }
.grade-pill.warn { color: var(--warn); }
.grade-pill.bad { color: var(--bad); }

/* The numeric score, folded into the same pill as the letter grade
   instead of its own table column — same ranking (grade IS derived
   from score), so showing both separately was a whole extra column of
   width spent on something the table already sorts identically either
   way (see sortValue() in app.js). */
.grade-pill-score {
  font-weight: 600;
  opacity: 0.75;
  font-size: 0.85em;
}

.table-scroll { overflow-x: auto; overflow-y: visible; } /* explicit overflow-y — otherwise an unset overflow-y next to a set overflow-x is computed as auto instead of visible, which would clip the enlarged .spark-svg above */

.batch-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
}
.batch-list-item:last-child { border-bottom: none; }

/* --- sleeper picks -------------------------------------------------- */
.sleeper-note {
  background: var(--bg-card-2);
  border: 1px solid rgba(255, 215, 94, 0.35);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 18px 0 2px;
}
.sleeper-note-head {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 8px;
}
.sleeper-note p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.sleeper-list {
  margin: 12px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.sleeper-list strong { color: var(--text); }
.sleeper-more { margin: 10px 0 0 !important; font-size: 0.85rem; color: var(--accent-quiet) !important; }

/* The badge is the accent yellow, NOT a status colour — a sleeper is a
   flag for attention, not a grade, and the grade pill next to it already
   carries the good/warn/bad meaning. */
.sleeper-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--accent);
  color: #1a1500;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  vertical-align: middle;
  white-space: nowrap;
}
tr.is-sleeper { background: rgba(255, 215, 94, 0.06); }
tr.is-sleeper:hover { background: rgba(255, 215, 94, 0.12); }
.batch-meta { min-width: 200px; flex: 1; }
.batch-label { font-weight: 600; }
.batch-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.batch-actions button { padding: 8px 13px; min-height: 40px; font-size: 0.88rem; }
.batch-actions a { text-decoration: none; }

/* Destructive, so it reads as destructive — but quietly, until it's armed. */
button.secondary.danger { color: var(--bad); border-color: rgba(208, 59, 59, 0.35); }
button.secondary.danger:hover { border-color: var(--bad); }
button.secondary.danger.armed {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}

@media (max-width: 560px) {
  /* On a phone, a wrapping flex row left the four actions at ragged widths
     — and once Delete was armed its longer label pushed it to three lines.
     A fixed two-column grid keeps every action the same size and every tap
     target full width, armed or not. */
  .batch-list-item { flex-direction: column; align-items: stretch; }
  .batch-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .batch-actions button { width: 100%; }
}

.spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

footer {
  text-align: center;
  color: var(--accent-quiet);
  font-size: 0.82rem;
  padding: 40px 20px 16px;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.5;
}

@media (max-width: 620px) {
  header.top { padding: 14px 16px; }
  .wrap { padding: 0 16px 50px; }
  .card, .result-head, .result-body { padding-left: 16px; padding-right: 16px; }
  .pros-cons { grid-template-columns: 1fr; }
  .mileage-field { max-width: none; }
  .score-number { font-size: 3.2rem; }
  .spec-row { gap: 10px 20px; }
  table.grade-table { font-size: 0.82rem; }
  table.grade-table th, table.grade-table td { padding: 9px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  * { scroll-behavior: auto !important; }
}

.pro-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Print stands out from the other secondary actions on purpose — a
   dealer standing in the lane needs to spot it at a glance. Solid green,
   white text, fully rounded — a fixed color rather than var(--good) so
   it stays green even where --good gets redefined (print media). Shared
   by the batch sheet's Print button and the one on each vehicle's own
   detail view.
   Selector is "button.secondary.btn-print", not just ".btn-print" — both
   real print buttons carry class="secondary btn-print", and
   "button.secondary" (element+class, defined above) otherwise outranks
   a class-only ".btn-print" no matter where in the file it sits, which is
   why the green never actually showed. Matching all three parts of the
   selector against "button.secondary" ties its specificity and then wins
   on source order, so it stays robust even if the rules get reordered. */
button.secondary.btn-print {
  background: #0d7a0d;
  border-color: #0d7a0d;
  color: #fff;
  border-radius: 999px;
}
button.secondary.btn-print:hover { background: #0a640a; border-color: #0a640a; }

/* Shown only on paper — see @media print below. */
.print-only { display: none; }

/* =====================================================================
   Dealer Pro batch detail: a dismissible popup, not a permanent fixture.
   Clicking a row (or its Trend thumbnail) fills #batch-detail and shows
   #batch-detail-overlay — a dimmed, fixed backdrop covering the viewport
   with the actual result (.modal-shell) centered in it. Close it with
   the × (.modal-close), by clicking the dimmed backdrop itself, or with
   Escape — see openBatchDetailModal()/closeBatchDetailModal() in app.js.
   Because it's position: fixed, nothing about the table shifts to make
   room for it and nothing is left behind once it's closed — this is
   what actually solves "don't want the big version to stay on the page,
   even after a click", replacing the shrink/peek panel from before.
   ===================================================================== */
#batch-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 48px 16px;
}
/* Higher specificity than the rule above (id + attribute beats id alone),
   so this reliably wins regardless of source order once [hidden] is set. */
#batch-detail-overlay[hidden] { display: none; }

.modal-shell {
  position: relative;
  width: 100%;
  max-width: 880px;
  margin: auto;
}

/* A big, obvious way out. The old 36px dark-on-dark "x" on the popup's
   corner was easy to miss, and it scrolled away with a long result, so
   dealers who didn't know about clicking the backdrop or pressing Escape
   had no visible way to close it. This one is pinned to the top-right of
   the screen (position: fixed, so it stays put while the popup scrolls),
   white on dark with a text label, and large enough to hit with a thumb. */
.modal-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 210; /* above #batch-detail-overlay (200) */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px 0 16px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: #ffffff;
  color: #111111;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.modal-close .modal-close-x { font-size: 1.5rem; line-height: 1; }
.modal-close:hover { background: #e9e9e9; }
.modal-close:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 600px) {
  .modal-close { top: 10px; right: 10px; min-height: 44px; padding: 0 16px 0 12px; }
}

/* =====================================================================
   print: either the graded sheet OR one vehicle's own detail view —
   never both, and never the rest of the page (nav, forms, other cards).
   Which one prints is decided by a class app.js puts on <body> right
   before calling window.print(): "printing-batch" for the Print button
   in the Results header, "printing-detail" for the one on a vehicle's
   own detail view (reached by clicking a row, from either "Check a
   Vehicle" or a Dealer Pro batch). Both live in the DOM at once when a
   dealer has clicked into a car from a batch, so a plain "just show
   #whatever" rule can't tell them apart — the body class can.
   ===================================================================== */
@media print {
  @page { margin: 8mm; }
  /* The batch sheet prints landscape so the VIN column is wide enough for
     a full-size, phone-scannable barcode. Only the batch sheet: the
     single-vehicle detail printout stays portrait. */
  @page batch-sheet { size: letter landscape; margin: 8mm; }
  body.printing-batch { page: batch-sheet; }

  /* Repaint the dark theme's variables for paper before anything else —
     every rule below keeps using var(--text) etc., so this one block is
     what actually turns the page plain black-on-white. Every surface
     color collapses to white and every ink color to black on purpose:
     no fills, only text and thin borders, so a dealer printing a
     200-car sheet isn't burning a cartridge on background shading. */
  :root {
    --bg: #ffffff;
    --bg-card: #ffffff;
    --bg-card-2: #ffffff;
    --border: #999999;
    --text: #000000;
    --text-secondary: #000000;
    --text-dim: #333333;
    --accent: #000000;
    --accent-quiet: #333333;
    --good: #000000;
    --warn: #000000;
    --bad: #000000;
    /* The chart is drawn with these three, and on screen --series is
       white (a line meant for the near-black page). Left alone that's a
       white line on white paper — so these three get their own print
       colors rather than collapsing to the same black as everything
       above. */
    --series: #000000;
    --grid: #dddddd;
    --axis: #000000;
  }

  body { background: #fff; }

  /* Hide the whole page, then reveal only whichever section the body
     class below picks out. Hidden elements keep their layout space
     under visibility, so the section is pulled out of flow and pinned
     to the top of the sheet next, rather than printing pages of blank
     space up to wherever it sat on screen. */
  body * { visibility: hidden; }

  body.printing-batch #batch-result-card,
  body.printing-batch #batch-result-card * { visibility: visible; }
  body.printing-batch #batch-result-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: #fff;
  }

  /* #batch-detail lives inside #batch-detail-overlay, itself inside
     #batch-result-card, so it's caught by the "#batch-result-card *"
     rule above and would otherwise print alongside the batch sheet too
     — plus the overlay's own dark, fixed backdrop would paint a big
     black rectangle over the printed page. The batch sheet should only
     ever print the table + sleeper banner, never whichever vehicle a
     dealer happened to have open (and closing the popup before printing
     the batch sheet is the normal path anyway, since the popup covers
     the batch sheet's own Print button while it's open). display: none
     removes the whole popup from the print, backdrop included — a
     stronger fix than hiding just its contents. */
  body.printing-batch #batch-detail-overlay { display: none !important; }

  /* The clicked-in vehicle detail lives in #result-container on "Check a
     Vehicle" and in #batch-detail (inside the popup, on Dealer Pro) —
     only one ever actually holds a rendered result at a time, so
     revealing both ids is safe. */
  body.printing-detail #result-container,
  body.printing-detail #result-container *,
  body.printing-detail #batch-detail,
  body.printing-detail #batch-detail * { visibility: visible; }
  body.printing-detail #result-container,
  body.printing-detail #batch-detail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: #fff;
  }
  /* Strip the popup chrome around #batch-detail for print — otherwise
     the dark backdrop and the 880px-wide centered shell would still be
     in the way of #batch-detail's own absolute-position/fill-the-page
     rule just above. */
  body.printing-detail #batch-detail-overlay {
    position: static;
    inset: auto;
    background: none;
    padding: 0;
    display: block;
  }
  body.printing-detail .modal-shell {
    position: static;
    max-width: none;
    margin: 0;
  }

  .no-print, .btn-print, #export-btn { display: none !important; }
  .print-only { display: block !important; }

  /* --- vehicle detail view: chart, narrative, pros/cons, recall check --- */
  .result-head, .result-body { border: 1px solid var(--border); background: #fff; }
  .result-head { border-bottom: none; }
  .pc-col { background: #fff; border: 1px solid var(--border); }
  .chart-legend, .chart-sub { color: var(--text-dim); }
  /* Screen-only controls that don't do anything on paper. */
  .chart-toggle, #rc-go, #rc-hint { display: none !important; }
  /* Hardcoded tints (not on the dark-theme variables above, so the
     print :root reset above doesn't touch them) — flatten to outlines
     so they don't print as ink-heavy colored blocks. */
  .recall-check, .refine-strip { background: #fff !important; border: 1px solid var(--border) !important; }
  .recall-check.advisory { border-color: #000 !important; }
  .grade-badge { border-color: currentColor; }
  .result { page-break-inside: auto; }
  .pros-cons, .chart-block, .recall-check, .score-block { page-break-inside: avoid; break-inside: avoid; }
  .print-title { font-size: 1.05rem; font-weight: 800; margin: 0 0 2px; }
  .print-meta { font-size: 0.72rem; color: var(--text-dim); margin-bottom: 8px; }

  table.grade-table { border: 1px solid var(--border); }
  table.grade-table th { color: var(--text); }
  table.grade-table thead { display: table-header-group; }
  /* Tightened from 4px 8px / 0.78rem: the horizontal padding in
     particular was pure overhead x10 columns, and the old font-size was
     bigger than the Auction#/VIN columns already printed at (see
     .mono-cell below) — shrinking everything down to that same size, and
     tightening the padding around it, is what actually buys the room
     every column needed. (See the nth-child break below for how many
     rows this now fits per sheet — it moved once rows grew the barcode
     and the sleeper tag.) */
  table.grade-table th, table.grade-table td { padding: 3px 4px; font-size: 0.7rem; line-height: 1.15; }
  table.grade-table tr { page-break-inside: avoid; break-inside: avoid; }
  table.grade-table tbody tr:hover { background: none; }

  /* .mono-cell (Auction#, VIN) used to be deliberately smaller than the
     rest of the table (0.85em of the base). Now that the base itself has
     been brought down to match, cancel that extra shrink so every column
     reads at the same size instead of VIN/Auction# ending up smaller
     again than everything around them. */
  table.grade-table td.mono-cell { font-size: 1em; }

  /* On screen the table's own natural (content) width can run past
     .table-scroll's box, which is fine there — it just scrolls. There is
     no scrollbar on paper, so left alone the same overflow silently runs
     past the printable page width and whatever's past the edge (usually
     the VIN, the last and widest column) never prints at all.
     table-layout: fixed stops columns from growing to fit their content;
     the percentages below then divide the ACTUAL page width among all 10
     columns so the whole row always lands on the sheet. Widths are
     proportional to what each column needs — VIN (17 fixed characters
     plus its own barcode, nothing to shrink to) gets the most room;
     Year/Recalls are short and get the least. They add up to 100%. */
  table.grade-table { table-layout: fixed; width: 100%; }
  /* Headers need their own, smaller treatment: at the base font-size they
     were wrapping mid-word ("MILEAGE" -> "MILEAG" / "E") because the
     screen styles' uppercase + letter-spacing make header text wider per
     character than the data rows below it. Dropping both and sizing down
     a bit more fixes that at the source; word-break: normal (not
     break-word, the td default below) means a header can still wrap at
     an actual space — "AUCTION #" onto two lines — but a single word
     like "MILEAGE" or "RECALLS" never splits itself in half. */
  table.grade-table th {
    white-space: normal;
    font-size: 0.6rem;
    letter-spacing: 0;
    word-break: normal;
    overflow-wrap: normal;
  }
  table.grade-table td { overflow-wrap: break-word; word-break: break-word; } /* data cells: a genuinely long unbroken value (e.g. a long model name) should still wrap rather than overflow its column */
  table.grade-table th:nth-child(1),  table.grade-table td:nth-child(1)  { width: 6%; }  /* Trend */
  table.grade-table th:nth-child(2),  table.grade-table td:nth-child(2)  { width: 9%; }  /* Auction # — the header text itself ("AUCTION #") needs this much even though the data is short */
  table.grade-table th:nth-child(3),  table.grade-table td:nth-child(3)  { width: 9%; }  /* Grade — wide enough for the grade pill plus the stacked SLEEPER tag below it */
  table.grade-table th:nth-child(4),  table.grade-table td:nth-child(4)  { width: 4%; }  /* Year */
  table.grade-table th:nth-child(5),  table.grade-table td:nth-child(5)  { width: 10%; } /* Make */
  table.grade-table th:nth-child(6),  table.grade-table td:nth-child(6)  { width: 11%; } /* Model */
  table.grade-table th:nth-child(7),  table.grade-table td:nth-child(7)  { width: 9%; }  /* Engine */
  table.grade-table th:nth-child(8),  table.grade-table td:nth-child(8)  { width: 7%; }  /* Mileage */
  table.grade-table th:nth-child(9),  table.grade-table td:nth-child(9)  { width: 7%; }  /* Recalls */
  table.grade-table th:nth-child(10), table.grade-table td:nth-child(10) { width: 28%; } /* VIN — fits the 2.66in barcode */
  /* The sparkline SVG has its own fixed pixel width (see SPARK in
     app.js) — shrink it to fit the 5% print column instead of letting it
     overflow into Auction #. The hover-to-enlarge effect doesn't apply on
     paper anyway. */
  .spark-svg { width: 100%; height: auto; max-width: 34px; }
  /* The batch sheet's small scannable barcode (see vinBarcodeMini() in
     app.js) — shown only here, in print, stacked above the VIN text.
     vinBarcodeMini() already tunes its native width to roughly match this
     column, so width: 100% only ever needs to nudge it slightly rather
     than squash it — that's what keeps the bars tall enough to scan
     instead of shrinking down to a sliver along with the width. */
  .batch-vin-barcode { display: block !important; line-height: 0; margin-bottom: 1px; }
  /* Exact physical size: 266 SVG units = 2.66in, so 1 unit = 10 mils (see
     vinBarcodeMini in app.js). Never stretched to the column. */
  .batch-vin-barcode svg { display: block; width: 2.66in; height: 0.25in; max-width: none; }
  /* 20 vehicles to a sheet (down from 25): adding the barcode and the
     stacked SLEEPER tag made rows taller, so 25 of them no longer
     actually fit in one physical page — the browser's own natural page
     break would land somewhere around row 21–22 regardless of what this
     says, out of sync with the header repeating via table-header-group
     above. 20 leaves real margin even in the unlikely case every row on
     a page is a (taller) sleeper row, so the forced break and the actual
     content always agree. :not(:last-child) skips the break when the
     sheet is an exact multiple of 20 — otherwise the last group would
     force a blank page under the sleeper-pick note instead of just
     letting it follow. */
  /* Landscape (see @page batch-sheet) with full-height VIN barcodes fits
     12 rows per page with room to spare, so the forced break moved from
     every 20th row to every 12th. */
  table.grade-table tbody tr:nth-child(12n):not(:last-child) { page-break-after: always; break-after: page; }
  /* No zebra fill on sleeper rows — the SLEEPER tag on the row already
     marks it, so shading it too is ink the row doesn't need. */
  tr.is-sleeper { background: none; }

  /* An outlined tag instead of a solid block — same "SLEEPER" text,
     no ink-heavy fill behind it. */
  .sleeper-badge {
    background: none !important;
    color: #000 !important;
    border: 1px solid #000;
  }
  /* The Grade column is only ~9% of the page width on paper — nowhere
     near enough for the grade pill AND the SLEEPER tag side by side at any
     legible size. Forcing them onto one line (as this used to do) didn't
     make them fit; it just let the tag spill out of its cell and print
     directly on top of Make, since a table cell doesn't clip overflowing
     nowrap content. display: block drops the tag onto its own line below
     the pill — a block-level child always starts a new line regardless of
     the parent's white-space, so the pill itself still can't wrap
     mid-text, only the tag moves. A sleeper row ends up two lines tall
     instead of one; the 20-per-page break below already accounts for
     that (see its comment). */
  .sleeper-badge { display: block; margin: 1px 0 0; font-size: 0.55rem; }
  table.grade-table td.grade-cell { white-space: nowrap; }
  .sleeper-note { border: 1px solid var(--border); background: #fff; page-break-inside: avoid; break-inside: avoid; }
}

/* ---- In-app (native) scanner: camera is drawn BEHIND the page ---- */
html.native-scanning, html.native-scanning body { background: transparent !important; }
html.native-scanning body > *:not(#native-scan) { visibility: hidden !important; }
#native-scan { display: none; }
html.native-scanning #native-scan {
  display: block; position: fixed; inset: 0; z-index: 99999; visibility: visible;
}
#native-scan .ns-box {
  position: absolute; left: 0; right: 0; top: 50%; height: 16vh; transform: translateY(-50%);
  border-top: 3px solid #fff; border-bottom: 3px solid #fff;
  box-shadow: 0 0 0 200vmax rgba(0,0,0,0.55);
}
@media (orientation: landscape) { #native-scan .ns-box { height: 34vh; } }
#native-scan .ns-line {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: #ff2a2a;
  box-shadow: 0 0 6px #ff2a2a;
}
#native-scan .ns-tip, #native-scan .ns-status {
  position: absolute; left: 0; right: 0; text-align: center; color: #fff;
  font: 600 16px/1.3 system-ui, sans-serif; text-shadow: 0 1px 3px #000; padding: 0 12px;
}
#native-scan .ns-tip { top: 6%; }
#native-scan .ns-status { bottom: 18%; color: #ffd84d; }
#native-scan .ns-buttons {
  position: absolute; left: 0; right: 0; bottom: 4%; display: flex; justify-content: center; gap: 16px;
}
#native-scan .ns-buttons button {
  font: 700 18px system-ui, sans-serif; padding: 12px 22px; border-radius: 10px; border: 0;
  background: rgba(255,255,255,0.92); color: #111;
}
#native-scan .ns-buttons .ns-close { background: #d62828; color: #fff; }

/* Single-car result: a big, obvious "× Close — next car" button. The top
   one sticks to the top of the screen while you scroll the result. */
.result-clear-bar {
  position: sticky; top: 8px; z-index: 50;
  display: flex; justify-content: flex-end; margin-top: 18px;
}
.result-clear-bottom { display: flex; justify-content: center; margin: 22px 0 8px; }
.result-clear {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 20px 0 16px; border-radius: 999px;
  border: 2px solid #111; background: #111; color: #fff;
  font-size: 1.05rem; font-weight: 700; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.result-clear .result-clear-x { font-size: 1.5rem; line-height: 1; }
.result-clear:hover { background: #333; }
.result-clear:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.result-clear-bar + .result { margin-top: 10px; }
@media print { .result-clear-bar, .result-clear-bottom { display: none !important; } }
#native-scan .ns-buttons { flex-wrap: wrap; padding: 0 8px; }
#native-scan .ns-buttons button { padding: 12px 16px; }

/* Phones: pull the form up so the Mileage box stays above the keyboard
   after a scan (less space above the headline and under the subtitle). */
@media (max-width: 620px) {
  .hero { padding: 14px 0 0; }
  .hero h1 { margin-bottom: 6px; }
  #evaluate-form.card { margin-top: 10px; padding-top: 14px; padding-bottom: 14px; }
}

/* Inside the Android app the page runs edge-to-edge, right under the
   phone's clock/battery bar, so push the header down below it. */
html.in-app header.top {
  padding-top: calc(14px + max(env(safe-area-inset-top, 0px), 30px));
}
html.in-app .modal-close { top: calc(10px + max(env(safe-area-inset-top, 0px), 30px)); }
html.in-app #native-scan .ns-tip { top: calc(6% + 16px); }

/* ---- Subscription box (Dealer Pro) ---- */
.sub-card { border-color: var(--brand, #e0402f); }
.sub-title { margin: 0 0 4px; font-size: 1.3rem; }
.sub-sub { margin: 0 0 14px; }
.sub-plans { display: flex; gap: 12px; flex-wrap: wrap; }
.sub-plan { flex: 1; min-width: 200px; font-size: 1.05rem; padding: 14px 16px; }
.sub-price { font-size: 1.3rem; font-weight: 800; }
.sub-save { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,0.2); font-size: 0.85rem; font-weight: 700; }
.sub-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sub-text { font-size: 1.05rem; }
.sub-warn { color: #ffb74d; }
.sub-test { margin: 12px 0 0; font-size: 0.85rem; color: #ffd84d; }

/* Three tabs on a phone: tighter so they fit on one line under the logo */
@media (max-width: 620px) {
  nav.tabs { width: 100%; justify-content: space-between; }
  nav.tabs button { padding: 8px 10px; font-size: 0.9rem; flex: 1; white-space: nowrap; }
}
.account-sheets-link { text-align: left; }
.free-check-note { margin: 12px 0 0; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--brand, #e0402f); background: rgba(224,64,47,0.12); line-height: 1.5; }
.free-check-note .free-check-go { margin-left: 8px; margin-top: 6px; }

/* "Click a car for details" cue above the graded sheet + chip in each row */
.click-tip { display: flex; gap: 14px; align-items: center; margin: 12px 0; padding: 14px 16px; border: 2px solid var(--accent); border-radius: 10px; background: var(--bg-card-2); font-size: 1.15rem; line-height: 1.4; }
.click-tip-icon { font-size: 2rem; line-height: 1; }
.click-tip-sub { display: inline-block; margin-top: 6px; font-size: 0.95rem; opacity: 0.85; }
.row-more { display: inline-block; margin-left: 8px; padding: 2px 8px; border: 1px solid var(--accent); border-radius: 99px; color: var(--accent); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
@media print { .click-tip, .row-more { display: none !important; } }

/* "Open all" short cards under each car (see openCardHtml() in app.js) */
table.grade-table tbody tr.open-card-row,
table.grade-table tbody tr.open-card-row:hover { cursor: default; background: transparent; }
table.grade-table tr.open-card-row > td { padding: 0 0 16px; }
.open-card-slot { position: sticky; left: 0; width: var(--open-card-width, 100%); min-height: 220px; }
.open-card {
  background: var(--bg-card-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-size: 0.92rem; line-height: 1.45; white-space: normal;
}
.open-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 10px; }
.open-card-auction { font-size: 1.15rem; font-weight: 800; color: var(--accent); }
.open-card-title { font-weight: 700; }
.open-card-body { display: flex; gap: 18px; align-items: flex-start; }
.open-card-chart { flex: 0 0 320px; }
.open-card-chart svg { display: block; width: 100%; height: auto; }
.open-card-text { flex: 1; min-width: 0; }
.open-card-text p { margin: 0 0 8px; }
.open-card-line.pros strong { color: var(--good); }
.open-card-line.cons strong { color: var(--bad); }
.open-card-sep { color: var(--text-dim); padding: 0 3px; }
#open-all-btn:disabled, #close-all-btn:disabled { opacity: 0.45; cursor: default; }
#close-all-float {
  position: fixed; right: 14px; bottom: 14px; z-index: 150;
  min-height: 46px; padding: 0 18px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  border-color: var(--accent); background: var(--bg-card);
}
#close-all-float[hidden] { display: none; }
@media (max-width: 700px) {
  .open-card-body { flex-direction: column; align-items: stretch; }
  .open-card-chart { flex: none; width: 100%; max-width: 420px; }
}
@media print {
  tr.open-card-row, #open-all-btn, #close-all-btn, #close-all-float { display: none !important; }
}
