/* The car negotiation tools' pages (car-tools, D-437..D-448): the parts they add on top of site.css (same tokens:
   --brand, --on, --deep, --soft, --paper, --ink, --muted, --line, --field, --ok, --err; fonts --display and --body).
   Every car page loads site.css, then this. Built from the approved mockups (docs/car-tools/mockups/). Phone first:
   every page is checked at 360-1440 px by test/screens.test.js. */


/* the "Car negotiation tools" row under the header (every car page) */
.subnav { max-width: 1180px; margin: 14px auto 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; text-decoration: none; font-size: 14px; font-weight: 700; padding: 7px 12px; border-radius: 999px;
  background: var(--night-tint); white-space: nowrap; }
.subnav a[aria-current="page"] { background: var(--brand); color: var(--on); }

/* a wider tool card for the calculators (same look as .tool) */
.calc { background: var(--paper); color: var(--ink); border-radius: 22px; padding: 22px; display: grid; gap: 14px;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--on) 16%, transparent); }
.calc h2 { font-size: 20px; margin: 0; }
/* the out-the-door answer: its live region is always in the form (so the first answer is read out), but stays out of
   the grid, with no gap under Calculate, until Calculate shows the answer inside it */
#calc > .live:has(> #out[hidden]) { position: absolute; }
.calc label, .lab { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.calc input, .calc select { width: 100%; border: 1.5px solid transparent; background: var(--field); border-radius: 12px; padding: 12px 13px;
  font: inherit; font-size: 16px; color: var(--ink); }
.calc input:focus, .calc select:focus { outline: none; border-color: var(--brand); background: var(--paper); }
.money { position: relative; }
.money::before { content: "$"; position: absolute; left: 13px; bottom: 13px; font-size: 16px; color: var(--muted); pointer-events: none; }
.money input { padding-left: 26px; }
.pct { position: relative; }
.pct::after { content: "%"; position: absolute; right: 13px; bottom: 13px; color: var(--muted); pointer-events: none; }
.row2, .row3, .row4 { display: grid; gap: 10px; }
.row2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.adv { border-top: 1px solid var(--line); padding-top: 12px; }
.adv summary { cursor: pointer; font-weight: 800; font-size: 15px; list-style: none; display: flex; align-items: center; gap: 8px; }
.adv summary::-webkit-details-marker { display: none; }
.adv summary::after { content: "\25BE"; font-size: 13px; transition: transform .15s; }
.adv[open] summary::after { transform: rotate(180deg); }
.adv .in { display: grid; gap: 10px; margin-top: 12px; }
.optional { font-weight: 500; color: var(--muted); font-size: 12px; }
.run { width: 100%; }
.seg { display: inline-flex; background: var(--field); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 14px; padding: 8px 12px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* the result: an itemized receipt (Purchase details | Amount) */
.receipt { border-radius: 18px; background: var(--paper); border: 1.5px solid var(--line); overflow: hidden; }
.receipt table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.receipt th, .receipt td { padding: 11px 16px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.receipt thead th { border-top: 0; background: var(--field); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.receipt td:last-child, .receipt th:last-child { text-align: right; white-space: nowrap; }
.receipt .sm { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.receipt .save td { color: var(--ok); font-weight: 700; }
.receipt .total th, .receipt .total td { font-family: var(--display); font-weight: 900; font-variation-settings: "wdth" 106; font-size: 24px;
  letter-spacing: -.02em; background: var(--soft); border-top: 2px solid var(--ink); }
.receipt .after td, .receipt .after th { font-weight: 800; }
.receipt input.inl { width: 92px; text-align: right; border: 1.5px dashed var(--line); background: transparent; border-radius: 8px; padding: 3px 6px;
  font: inherit; font-size: 15px; color: var(--ink); }
.receipt input.inl:focus { outline: none; border-color: var(--brand); border-style: solid; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
  margin-left: 6px; vertical-align: 1px; }
.tag.gov { background: #e7eefc; color: #1d3f8f; }
.tag.dealer { background: var(--soft); color: var(--deep); }
.tag.maker { background: #e6f4ec; color: var(--ok); }
.flag { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 700; }
.flag.red { color: var(--err); }
.flag.amber { color: #8a5a00; }
.flag.okay { color: var(--ok); }
.sentence { margin: 0; padding: 14px 16px; font-size: 15px; line-height: 1.5; border-top: 1px solid var(--line); }
.paybox { margin-top: 2px; }
.paygrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.paygrid div { background: var(--paper); padding: 12px 16px; }
.paygrid span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.paygrid b { font-size: 18px; font-variant-numeric: tabular-nums; }
.paygrid .big b { font-family: var(--display); font-weight: 900; font-size: 26px; font-variation-settings: "wdth" 106; }
.fine { font-size: 12.5px; color: var(--muted); margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); }

/* the hand-off card on the Night block */
.handoff { border-radius: 20px; background: var(--night-tint); border: 1px solid var(--night-line); padding: 18px; display: grid; gap: 12px; }
.handoff h3 { font-size: 22px; margin: 0; }
.handoff p { margin: 0; font-size: 15px; }
.handoff .row2 select, .handoff .row3 select, .handoff input { width: 100%; border: 0; background: var(--paper); border-radius: 12px; padding: 12px 13px; font: inherit; font-size: 16px; color: var(--ink); }

/* below the Night block: generic content parts */
.lead { font-size: 18px; max-width: 62ch; }
.prose p, .prose li { max-width: 68ch; }
.prose h3 { font-size: 22px; margin: 28px 0 10px; }
.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cards2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.box { border: 1.5px solid var(--line); border-radius: 20px; padding: 20px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.box.soft { background: var(--soft); border-color: transparent; }
.box strong { font-size: 17px; }
.box p { margin: 0; color: var(--muted); font-size: 15px; }
.num { font-family: var(--display); font-weight: 900; font-variation-settings: "wdth" 106; font-size: 34px; letter-spacing: -.02em; line-height: 1; color: var(--deep); }
.tablewrap { overflow-x: auto; border: 1.5px solid var(--line); border-radius: 18px; }
.data { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; min-width: 640px; }
.data th, .data td { padding: 11px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.data thead th { border-top: 0; background: var(--field); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.data td.r, .data th.r { text-align: right; }
.data tr.hl td { background: var(--soft); }
.src { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.src a { color: inherit; }
.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--err); font-weight: 700; }
.part { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.part b { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--on); display: grid; place-items: center;
  font-family: var(--display); font-weight: 900; font-size: 17px; flex: none; }
.part span { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--deep); }

.body > section { margin-bottom: 56px; scroll-margin-top: 16px; }
.body h2 { font-size: clamp(26px, 2.6vw, 34px); margin-bottom: 14px; }
.body p, .body li { max-width: 68ch; font-size: 17px; line-height: 1.6; }
.tldr { background: var(--soft); border-radius: 20px; padding: 20px 22px; }
.tldr h2 { font-size: 20px; margin: 0 0 10px; }
.tldr ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.tldr li { font-size: 16px; }
.tmpl { border: 1.5px solid var(--line); border-radius: 18px; overflow: hidden; margin: 14px 0; }
.tmpl header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--field); }
.tmpl header strong { font-size: 14px; }
.tmpl pre { margin: 0; padding: 14px 16px; white-space: pre-wrap; font: 15px/1.55 var(--body); color: var(--ink); }
.copy { border: 1.5px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.callout { border-left: 4px solid var(--brand); background: var(--field); border-radius: 0 16px 16px 0; padding: 14px 18px; margin: 16px 0; }
.callout p { margin: 0; }
.redflags { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; max-width: 72ch; }
.redflags li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 16px; }
.redflags li::before { content: "!"; width: 22px; height: 22px; border-radius: 50%; background: var(--err); color: #fff; display: grid; place-items: center;
  font-weight: 900; font-size: 13px; margin-top: 2px; }

/* data tools: filters, ranked rows, bars, deal cards */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.meter { height: 10px; border-radius: 999px; background: var(--field); overflow: hidden; min-width: 80px; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.updated { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; background: var(--night-tint);
  padding: 5px 11px; border-radius: 999px; }
.updated::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #1fb26b; box-shadow: 0 0 0 3px rgba(31,178,107,.25); }
.deals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.deal { border: 1.5px solid var(--line); border-radius: 20px; padding: 18px; display: grid; gap: 10px; align-content: start; min-width: 0; background: var(--paper); }
.deal .top2 { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.deal h3 { font-size: 19px; margin: 0; }
.deal .kind { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--deep); }
.score { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 19px;
  background: var(--soft); color: var(--deep); }
.offer { font-family: var(--display); font-weight: 900; font-variation-settings: "wdth" 106; font-size: 28px; letter-spacing: -.02em; line-height: 1.05; }
.offer small { font-family: var(--body); font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; font-size: 13.5px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.why1 { font-size: 13.5px; background: var(--field); border-radius: 12px; padding: 8px 10px; margin: 0; }
.deal .go2 { display: block; text-align: center; background: var(--ink); color: #fff; border-radius: 12px; padding: 11px; font-weight: 800; font-size: 14.5px; text-decoration: none; }
.bigstat { font-family: var(--display); font-weight: 900; font-variation-settings: "wdth" 106; font-size: clamp(40px, 5vw, 64px); line-height: 1; letter-spacing: -.03em; }
.range { position: relative; height: 54px; margin: 8px 0 4px; }
.range .track { position: absolute; left: 0; right: 0; top: 22px; height: 10px; border-radius: 999px; background: linear-gradient(90deg, #f4c7b1, var(--brand)); }
.range .pin { position: absolute; top: 0; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.range .pin i { width: 3px; height: 36px; background: var(--ink); border-radius: 2px; }
.verdict { border-radius: 18px; padding: 16px 18px; background: #e6f4ec; color: #134d31; display: grid; gap: 4px; }
.verdict strong { font-size: 18px; }

@media (max-width: 900px) {
  .deals, .cards3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .calc { padding: 16px; border-radius: 18px; }
  .row3, .row4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .deals, .cards3, .cards2 { grid-template-columns: minmax(0, 1fr); }
  .paygrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .receipt th, .receipt td { padding: 10px 12px; }
  .receipt .total th, .receipt .total td { font-size: 20px; }
  .body p, .body li { font-size: 16px; }
}

/* the tool card sits above the demo's money card where they meet on a computer */
.split .calc, .split .handoff { position: relative; z-index: 5; }
/* on a computer the demo's money card sits on the phone's lower corner, clear of the bigger tool cards */
@media (min-width: 901px) { .split .win { right: auto; left: -30px; } }
/* four steps in a row on a computer, two on a tablet, one on a phone */
.steps.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .steps.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .steps.four { grid-template-columns: minmax(0, 1fr); } }

/* ===== round 2 (D-440 - D-444) ===== */

/* the hand-off box: the inputs, one action button, then the number (optional), then one line of small print */
.go-box { display: grid; gap: 10px; }
.go-box h3 { font-size: 21px; margin: 0; }
.go-box .row2 select, .go-box .row3 select, .go-box .row2 input { width: 100%; border: 0; background: var(--paper); border-radius: 12px; padding: 12px 13px; font: inherit; font-size: 16px; color: var(--ink); }
.cta { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; border-radius: 14px; padding: 16px; font: inherit; font-weight: 800;
  font-size: 17px; background: var(--brand); color: var(--on); text-decoration: none; cursor: pointer; }
.cta:hover { background: #ff7a45; }
.optlab { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .72; margin: 4px 0 -4px; }
.go-box .field input { padding: 10px 4px; }
.rates { font-size: 12px; opacity: .78; margin: 0; text-align: center; }
/* the same box on white (inside articles and below the fold) */

/* the big, colored result numbers */
.bignums { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.bignums.single { grid-template-columns: minmax(0, 1fr); }
.bn { border-radius: 18px; padding: 16px 18px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.bn span { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.bn b { font-family: var(--display); font-weight: 900; font-variation-settings: "wdth" 106; font-size: clamp(34px, 4vw, 46px); letter-spacing: -.03em; line-height: 1.02;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bn small { font-size: 13.5px; font-weight: 600; }
.bn.main { background: var(--on); color: #fff; }
.bn.main b { color: var(--brand); }
.bn.main small { color: rgba(255,255,255,.75); }
.bn.pay { background: var(--soft); color: var(--deep); }
.bn.pay small { color: var(--ink); opacity: .75; }
.bn.pay.muted { background: var(--field); color: var(--muted); }
.bn.pay.muted b { font-size: 20px; font-family: var(--body); letter-spacing: 0; color: var(--ink); }
@media (max-width: 520px) { .bignums { grid-template-columns: minmax(0, 1fr); } }
.left #start.go-box { max-width: none; }

/* the article top (D-441): kicker, one strong title, the reading time (Hosea 2026-10-13: no line under the title); the
   3-step short version on the right. No demo, no phone box, no product here. Hierarchy by size and weight, never by fading. */
.ahero { max-width: 1120px; margin: 40px auto 0; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: start; }
.ahero .kick { font-size: 13px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; margin: 0 0 14px; }
.ahero h1 { font-size: clamp(36px, 4.6vw, 60px); line-height: 1.02; letter-spacing: -.03em; max-width: 15ch; margin: 0 0 16px; }
.ahero .by { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14.5px; font-weight: 700; margin: 0; }
.ahero .by span + span::before { content: "\00B7"; margin-right: 14px; }
.short3 { background: var(--paper); color: var(--ink); border-radius: 22px; padding: 26px 26px 24px; box-shadow: 0 18px 40px color-mix(in srgb, var(--on) 16%, transparent); }
.short3 h2 { font-size: 20px; margin: 0 0 14px; }
.short3 ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s3; }
.short3 li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; counter-increment: s3; font-size: 16.5px; line-height: 1.45; }
.short3 li::before { content: counter(s3); width: 30px; height: 30px; border-radius: 50%; background: var(--on); color: var(--brand); display: grid; place-items: center;
  font-family: var(--display); font-weight: 900; font-size: 15px; }
.short3 li b { display: block; font-size: 17px; }
@media (max-width: 900px) {
  .ahero { grid-template-columns: minmax(0, 1fr); gap: 26px; margin-top: 26px; }
  .ahero h1 { max-width: none; font-size: clamp(32px, 9vw, 44px); }
  .short3 { padding: 20px; }
}
/* an article body with no table of contents: one reading column */
.reading { max-width: 760px; }
.reading > section { margin-bottom: 56px; }
.reading h2 { font-size: clamp(26px, 2.6vw, 34px); margin-bottom: 12px; }
.reading p, .reading li { font-size: 17px; line-height: 1.6; max-width: 68ch; }
@media (max-width: 760px) { .reading p, .reading li { font-size: 16px; } }
/* one look for every error line, in articles too (the live .toolerr, a touch bolder) */
.toolerr, .reading .toolerr { font-size: 14px; font-weight: 600; max-width: none; }
/* the one Bulldog line inside an article's step 3, same on both articles */
.reading .aside { border-left: 4px solid var(--brand); padding: 4px 0 4px 16px; font-weight: 600; }
.reading .aside a { color: var(--deep); font-weight: 800; }
/* a section heading followed straight by the steps (no lede in between) keeps its breathing room */
.how h2 + .steps, .how h2 + ol { margin-top: 24px; }
/* on a phone the byline wraps: no separator dots, one gap between the items */
@media (max-width: 600px) { .ahero .by span + span::before { content: none; } .ahero .by { gap: 2px 16px; } }

/* ===== round 2 QA fixes (shared) ===== */
/* the row's name on its own line above the links, full ink; the links wrap on a computer and scroll on a phone */
.sublbl { max-width: 1180px; margin: 14px auto 8px; font-size: 12.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--night-dim); }
.sublbl + .subnav { margin-top: 0; }
.subnav a { min-height: 40px; display: inline-flex; align-items: center; }
@media (min-width: 761px) { .subnav { flex-wrap: wrap; overflow: visible; } }
/* no faded text on the Night block */
.optlab, .rates { opacity: 1; }
.left #start.go-box { padding: 18px; }
/* the part labels are words only (the steps carry the numbers) */
.part b { display: none; }
.part { margin-bottom: 10px; }
/* section headings on the tool pages: never bigger than the page title */
.how h2 { font-size: clamp(28px, 3vw, 40px); font-variation-settings: "wdth" 104; letter-spacing: -.025em; }
/* tap targets of at least 40px (site.css makes the shared ones 44) */
.seg button, .chip, .copy, .adv summary { min-height: 40px; }
.copy { padding: 8px 14px; }
.adv summary { display: flex; align-items: center; }
.receipt input.inl { font-size: 16px; min-height: 40px; width: 104px; }
.tag { white-space: nowrap; }
.bn b { white-space: nowrap; }
/* the demo's money card sits under the phone, never over the last messages */
.demo { padding-bottom: 128px; }
.demo .win { top: calc(100% + 14px); bottom: auto; right: auto; left: calc(50% - var(--cw) / 2); }
/* a step heading inside an article: an ink circle with the number, then the words */
.steph { display: flex; align-items: center; gap: 12px; }
.steph i { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--on); color: var(--brand); display: grid; place-items: center;
  font-style: normal; font-family: var(--display); font-weight: 900; font-size: 18px; }
.nw { white-space: nowrap; }
/* a phone: make and model each take the full width, so long names (Mercedes-Benz, Silverado 1500) never clip */
@media (max-width: 480px) { .go-box .row2 { grid-template-columns: minmax(0, 1fr); } }
/* the tools row on a phone: fade the side that has more links (subnav.js sets more-l / more-r) */
@media (max-width: 760px) {
  .subnav.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  .subnav.more-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px); mask-image: linear-gradient(to right, transparent, #000 36px); }
  .subnav.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
}

/* ===== the out-the-door calculator (/cars/out-the-door-price-calculator) ===== */
@media (max-width: 760px) {
  .statewrap .data { min-width: 0; }
  .statewrap .data th:nth-child(n+4), .statewrap .data td:nth-child(n+4) { display: none; }
  .statewrap .data thead th { white-space: normal; }
}
/* a small phone: price and state each take the full width, so long state names never clip */
@media (max-width: 400px) { .calc .row2.toprow { grid-template-columns: minmax(0, 1fr); } }
/* the smallest phones (320 wide): a slimmer card and receipt, and the tags may wrap, so the receipt fits */
@media (max-width: 340px) {
  .calc { padding-left: 12px; padding-right: 12px; }
  .receipt th, .receipt td { padding-left: 8px; padding-right: 8px; }
  .receipt input.inl { width: 84px; }
  .receipt .tag { white-space: normal; }
  .calc .row2, .calc .row3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) { .receipt .total th, .receipt .total td { font-size: 18px; } .receipt th { hyphens: none; } }
.sentence.lead2 { border-top: 0; padding: 12px 2px 4px; }
.cta[aria-disabled="true"] { opacity: .6; }
.part.tail { margin-top: 8px; }
.gap { margin-top: 22px; }
.statewrap .data td a { color: inherit; }
/* "More car negotiation tools": every other car tool, its name only (Hosea 2026-10-13), as many across as fit */
.cartools .lanes { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.cartools .lane { padding: 18px 20px; }
.cartools .lane strong::after { content: " \2192"; color: var(--deep); }
/* the calculator page's state table: about seven rows, then it scrolls inside its box, the header staying on top; "Show
   all" opens it to its full length (public/cars/otd.js; Hosea 2026-10-13) */
.statewrap.scroll { max-height: 420px; overflow-y: auto; }
.statewrap.scroll.open { max-height: none; }
.statewrap.scroll .data thead th { position: sticky; top: 0; z-index: 1; }

/* ===== the articles (/cars/negotiate-car-price, /cars/negotiate-a-lease) ===== */
/* the article body: one reading column, the three steps as shared step headings (.steph) */
.reading h3 { font-size: 21px; margin: 30px 0 10px; }
.reading > section > p:last-child { margin-bottom: 0; }
.reading .receipt, .reading .tmpl, .reading .tablewrap, .reading .tgt { margin: 18px 0 22px; }
.reading .fine, .reading .src { font-size: 13px; line-height: 1.45; max-width: none; }
.say { font-weight: 700; }

/* the target tool: four inputs, three big numbers */
.tgt { border: 1.5px solid var(--line); box-shadow: none; }
.reading .tgt h3 { margin: 0; font-size: 19px; }
.tgt .pct::after { font-size: 16px; bottom: 12px; }
.bignums.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bignums.three .bn b { font-size: clamp(28px, 3vw, 36px); }
.tgt .sentence { border-top: 0; padding: 2px 2px 0; font-size: 15.5px; }
.tgt .src { margin: 0; }
.tgt.stale .bignums, .tgt.stale .sentence { display: none; }

/* the email templates */
.tmpl .ph { background: var(--soft); border-radius: 5px; padding: 0 3px; }
.tmpl header div { display: grid; gap: 1px; min-width: 0; }
.tmpl header span { font-size: 13px; color: var(--muted); }
.copy { flex: none; color: var(--ink); }
.copy.done { background: var(--ink); color: #fff; }

/* the one soft line about Bulldog inside step 3 */

/* the decoder: they write / you reply */
.decode { min-width: 0; }
.decode td { width: 50%; }
.decode td:first-child { font-weight: 700; }
.decode td:last-child { font-style: italic; }
.reading .redflags li { font-size: 16.5px; line-height: 1.5; }

/* the end block: the pitch and the hand-off on the left, the demo on the right (its money card sits under the phone) */
.endblk { background: var(--night); color: var(--on-night); border-radius: 26px; padding: clamp(22px, 4vw, 44px);
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 64px; row-gap: 22px; align-items: start; }
.endblk .pitchcol { grid-area: 1 / 1; }
.endblk .handoff { grid-area: 2 / 1; position: relative; z-index: 5; }
.endblk #start { max-width: 460px; }
.endblk .demo { grid-area: 1 / 2 / 3 / 3; align-self: center; }
.endblk h2 { font-size: clamp(28px, 2.8vw, 36px); margin-bottom: 14px; }
.endblk .pitchcol > p { font-size: 17.5px; max-width: 52ch; }
.endblk .checks { margin: 0; }
.endblk .checks li { font-size: 16.5px; padding-bottom: 10px; }
.endblk .checks li::before { color: var(--brand); }
.endblk .stage { height: 500px; }

@media (max-width: 900px) {
  .endblk { grid-template-columns: minmax(0, 1fr); }
  .endblk .pitchcol, .endblk .handoff, .endblk .demo { grid-area: auto; }
  .endblk #start { max-width: none; }
  .endblk .demo { margin-top: 24px; }
  .endblk .stage { height: 480px; }
}
@media (max-width: 760px) {
  .reading h3 { font-size: 19px; margin-top: 26px; }
  .bignums.three { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .bignums.three .bn { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 12px 16px; }
  .bignums.three .bn small { grid-column: 1 / -1; }
  .bignums.three .bn b { font-size: 30px; grid-area: 1 / 2; }
  .tmpl pre { font-size: 14.5px; padding: 12px 14px; }
  /* the decoder on a phone: one card per dealer line */
  .decode thead { display: none; }
  .decode, .decode tbody, .decode tr, .decode td { display: block; width: auto; }
  .decode tr { padding: 12px 14px; border-top: 1px solid var(--line); }
  .decode tr:first-child { border-top: 0; }
  .decode td { border: 0; padding: 2px 0; }
  .decode td:last-child { margin-top: 4px; }
  .decode td:last-child::before { content: "You reply: "; font-style: normal; font-weight: 800; color: var(--deep); }
  .endblk { padding: 22px 18px; }
  .endblk .stage { height: 420px; }
}

/* the lease article */
  .reading .tight { margin-bottom: 8px; }
  /* part 1: the ad, the cash at signing, what it really costs */
  .adsum { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; margin: 20px 0 22px; }
  .adsum > div { border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 16px; display: grid; gap: 4px; align-content: start; min-width: 0; }
  .adsum > div.real { background: var(--soft); border-color: transparent; }
  .adsum b { font-family: var(--display); font-weight: 900; font-variation-settings: "wdth" 106; font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.03em; line-height: 1; }
  .adsum .real b { color: var(--deep); }
  .adsum b small { font-family: var(--body); font-size: 15px; font-weight: 700; letter-spacing: 0; }
  .adsum span { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--muted); }
  .adsum .real span { color: var(--ink); }
  .adsum i { align-self: center; font-style: normal; font-family: var(--display); font-weight: 900; font-size: 26px; }
  /* the payment formula: two lines, the price in both */
  .eq { border: 1.5px solid var(--line); border-radius: 18px; padding: 4px 18px; margin: 14px 0 18px; }
  .eq div { display: grid; grid-template-columns: 7.2em minmax(0, 1fr); gap: 2px 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 16.5px; }
  .eq div:first-child { border-top: 0; }
  .eq b { font-weight: 800; }
  .eq mark { background: var(--soft); color: var(--deep); font-weight: 800; border-radius: 6px; padding: 1px 3px; }
  /* the calculator, in the reading column; its opening values are the worked example */
  .reading .calc { border: 1.5px solid var(--line); box-shadow: none; margin: 14px 0 10px; }
  .reading .calc p { font-size: 15px; line-height: 1.5; max-width: none; }
  .reading .calc .fine { font-size: 12.5px; }
  #calc .row2, #calc .row3 { align-items: start; }
  .fld { display: grid; gap: 5px; min-width: 0; }
  .live { font-size: 12.5px; font-weight: 700; color: var(--deep); min-height: 1em; }
  .bn.mark { background: #fde8e6; color: var(--err); }
  .bn.mark small { color: var(--ink); opacity: .8; }
  .bn.ok { background: #e6f4ec; color: var(--ok); }
  .bn.ok small { color: var(--ink); opacity: .8; }
  /* what you can negotiate: a table that fits a phone */
  .neg { width: 100%; border-collapse: collapse; font-size: 15.5px; margin: 10px 0 0; }
  .neg th, .neg td { text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-top: 1px solid var(--line); }
  .neg caption { text-align: left; font-weight: 800; font-size: 17px; padding: 6px 0 12px; }
  .neg thead th { border-top: 0; padding-top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .neg tbody th { font-weight: 800; width: 30%; }
  .neg td:nth-child(2) { width: 24%; }
  .neg td:last-child { padding-right: 0; }
  /* the emails: the parts to fill in are highlighted (as on the price article) */
  .reading .tmpl pre { font-size: 15px; }
  .reading .tmpl header strong { font-size: 14.5px; }
  .soft1 { margin: 18px 0 0; }
  @media (max-width: 760px) {
    .reading h3 { font-size: 19px; }
    .adsum { gap: 6px; }
    .adsum > div { padding: 12px 10px; border-radius: 14px; }
    .adsum b { font-size: 24px; }
    .adsum b small { font-size: 12px; }
    .adsum span { font-size: 12.5px; }
    .adsum i { font-size: 18px; }
    .eq { padding: 2px 14px; }
    .eq div { grid-template-columns: minmax(0, 1fr); font-size: 15.5px; }
    .calc .row3 > :last-child { grid-column: 1 / -1; }
    .neg { font-size: 14.5px; }
    .neg th, .neg td { padding-right: 10px; }
    .reading .tmpl pre { font-size: 14px; }
  }
  /* the calculator's total row stays on one line on a phone */
  @media (max-width: 420px) { .reading .receipt .total th, .reading .receipt .total td { font-size: clamp(14px, 4.2vw, 20px); white-space: nowrap; } }
  /* narrow phones: "/mo" goes under the number so it never runs past the box */
  @media (max-width: 400px) {
    .adsum { gap: 4px; }
    .adsum > div { padding: 10px 8px; }
    .adsum b { font-size: 22px; }
    .adsum b small { display: block; margin-top: 3px; }
    .adsum i { font-size: 16px; }
  }

/* the end block's ready card (the QR code) sits under the hand-off box */
.endblk .ready { grid-column: 1; max-width: 460px; }
@media (max-width: 900px) { .endblk .ready { grid-column: auto; max-width: none; } }

/* ===== best resale value (/cars/best-resale-value): KBB is always orange (--brand), iSeeCars always blue (--imsg) ===== */
.top .updated { justify-self: start; }

/* the top-5 card: rank, car, the two bars, and a dealer-prices button on every row */
.t5 { gap: 10px; }
.rs-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; }
.rs-head span { font-size: 13px; color: var(--muted); font-weight: 600; }
.rs-t5 { list-style: none; margin: 0; padding: 0; display: grid; }
.rs-t5 li { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 6px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.rs-t5 li:first-child { border-top: 0; padding-top: 2px; }
.rs-t5 .rk { font-family: var(--display); font-weight: 900; font-size: 22px; color: var(--deep); line-height: 1; }
.rs-t5 .nm strong { display: block; font-size: 16px; line-height: 1.2; }
.rs-t5 .nm > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.rs-bars { display: grid; gap: 5px; }
.rs-br { display: grid; grid-template-columns: 58px minmax(0, 1fr) 46px; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.rs-br em { font-style: normal; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.rs-br .bar { display: block; width: 100%; height: 8px; min-width: 0; }
.bar .tr { fill: var(--field); }
.bar .fl { fill: var(--brand); }
.rs-br.i .bar .fl { fill: var(--imsg); }
.rs-foot { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.45; }
.rs-links { display: flex; flex-wrap: wrap; gap: 0 20px; margin: -4px 0 -6px; }
.rs-links a { display: inline-flex; align-items: center; min-height: 40px; color: var(--deep); font-weight: 800; font-size: 15px; text-decoration: none; }
.rs-links a + a { text-decoration: underline; font-size: 14px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; flex: none; }
.sw.k { background: var(--brand); } .sw.i { background: var(--imsg); }
.na { color: var(--muted); }
.md { white-space: nowrap; }

/* the dealer-prices button: on every row of both lists */
.getp { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 12px;
  background: var(--brand); color: var(--on); font: inherit; font-size: 14px; font-weight: 800; line-height: 1.15; white-space: nowrap; cursor: pointer; text-align: center; }
.getp:hover { background: var(--on); color: #fff; }

/* the ranking (Ahrefs-style): one line, a source line, the controls, the table */
.rk-sec h2 { margin-bottom: 8px; }
.rk-sec .src { margin: 6px 0 20px; }
.wk-sec > .src { margin: -2px 0 16px; font-size: 14px; }
.ctl { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; justify-content: space-between; margin: 0 0 14px; }
.ctl .filters { gap: 6px; }
.chip .ct { font-weight: 600; opacity: .6; margin-left: 4px; }
.opts { display: grid; grid-template-columns: 170px 170px; gap: 10px; }
.opts label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.opts input, .opts select { width: 100%; border: 1.5px solid transparent; background: var(--field); border-radius: 12px; padding: 12px 13px; font: inherit; font-size: 16px; color: var(--ink); }
.opts .money input { padding-left: 26px; }
.opts input:focus, .opts select:focus { outline: none; border-color: var(--brand); background: var(--paper); }
.ctl .toolerr { width: 100%; }

.rt { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.rt th, .rt td { padding: 7px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.rt thead th { border-top: 0; background: var(--field); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; line-height: 1.25; padding-top: 6px; padding-bottom: 6px; }
.rt .c-n { width: 50px; font-family: var(--display); font-weight: 900; color: var(--deep); font-size: 18px; }
.rt thead .c-n { font-family: var(--body); font-size: 12px; color: var(--muted); }
.rt .c-kbb, .rt .c-isee { text-align: right; white-space: nowrap; width: 16%; }
.rt .c-usd { text-align: right; white-space: nowrap; width: 14%; }
.rt thead .c-kbb, .rt thead .c-isee, .rt thead .c-usd { white-space: normal; }
/* the wrapper holds the hidden header label too (absolute), so nothing pokes out past the screen */
.rk-sec .tablewrap, .wk-sec .tablewrap { position: relative; }
.rt .c-go { text-align: right; width: 1%; }
.rt td.c-car strong { display: block; font-size: 16px; line-height: 1.25; }
.rt .sm { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: 0; text-transform: none; }
.rt .mk2 { display: none; }
.rt td.c-kbb, .rt td.c-isee { color: var(--muted); }
.rt[data-sort="kbb"] td.c-kbb, .rt[data-sort="isee"] td.c-isee { color: var(--ink); font-weight: 800; font-size: 16px; }
.rt td.c-usd b { font-size: 16px; }
/* the column sort buttons: a 40px target */
.sorter { border: 0; background: none; padding: 4px 0; min-height: 40px; min-width: 40px; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; text-align: right; line-height: 1.25; }
.sorter:hover { color: var(--ink); }
th[aria-sort] .sorter { color: var(--ink); }
th[aria-sort] .sorter::after { content: "\2193"; }
.rt tbody tr:hover td { background: color-mix(in srgb, var(--soft) 45%, transparent); }
.rt tr.hl td, .rt tr.hl:hover td { background: var(--soft); }
.rt tr.dv td, .rt tr.dv:hover td { background: var(--paper); color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding-top: 14px; padding-bottom: 6px; }
.rt tr.ad td, .rt tr.ad:hover td { background: var(--on); color: #fff; padding: 14px 16px; }
.adin { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.adin p { margin: 0; font-size: 16px; }
.adin p strong { color: var(--brand); }
.adin .getp:hover { background: #fff; color: var(--on); }
.ph { display: none; }
/* results capped at 10, like Ahrefs; one button shows the rest */
.morebtn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; margin-top: 10px; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink); border-radius: 14px; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; }
.morebtn:hover { border-color: var(--ink); }
.morebtn[hidden] { display: none; }

/* how the list is made: a short note under the tables */
.made { margin-top: 28px; max-width: 72ch; }
.made h3 { font-size: 20px; margin: 0 0 6px; }
.made p { margin: 0; }
.made .src { margin-top: 8px; }

/* the depreciation calculator, compact: the inputs in one row, the big numbers beside the chart */
.dins { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.3fr); gap: 10px; align-items: end; }
.dins .seg { display: flex; }
.dins .seg button { flex: 1 1 0; }
.dins .seg button:disabled { opacity: .4; cursor: not-allowed; }
.segnote { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.segnote:empty { display: none; }
.douts { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.douts[hidden] { display: none; }
.douts .bignums { grid-template-columns: minmax(0, 1fr); }
.douts .bn { padding: 14px 16px; }
.douts .bn b { font-size: clamp(28px, 2.8vw, 36px); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 4px; }
.legend i { display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: 4px; margin-right: 6px; }
.legend i.dash { border-top-style: dashed; border-top-width: 2px; }
.chart { position: relative; min-height: 160px; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart text { font: 600 12px var(--body); fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart text.l { font-size: 13px; font-weight: 800; fill: var(--err); paint-order: stroke; stroke: var(--paper); stroke-width: 5px; stroke-linejoin: round; }
.tip { position: absolute; top: 0; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; line-height: 1.35; padding: 7px 10px; border-radius: 10px; white-space: nowrap; transform: translateX(-50%); }
.tip[hidden] { display: none; }
/* the car depreciation calculator in its tool page's left column (its own page, Hosea 2026-10-13): two fields a row,
   the two big numbers side by side above the chart */
.calc.dep .dins { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.calc.dep .dins .wide { grid-column: 1 / -1; }
.calc.dep .douts { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.calc.dep .douts .bignums { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.calc.dep .fine { padding: 0; border: 0; margin: 0; }
.calc.dep > .dlive:has(> #douts[hidden]) { position: absolute; }


@media (max-width: 900px) {
  .dins { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .dins .wide { grid-column: 1 / -1; }
  .douts { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .douts .bignums { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .douts .bn { padding: 12px 12px; }
  .douts .bn span { font-size: 11px; letter-spacing: .06em; }
  .douts .bn b { font-size: 24px; }
  .douts .bn small { font-size: 12.5px; }
}
@media (max-width: 800px) {
  /* a phone (and a narrow tablet): the table keeps #, the car, the sorted figure and the button; nothing scrolls sideways */
  .ctl { gap: 12px; }
  .opts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
  .rt { font-size: 14px; }
  .rt th, .rt td { padding: 8px 6px; }
  .rt thead th { padding-top: 4px; padding-bottom: 4px; }
  .rt th:first-child, .rt td:first-child { padding-left: 12px; }
  .rt th:last-child, .rt td:last-child { padding-right: 10px; }
  .rt .c-n { width: 34px; font-size: 16px; }
  .rt .c-kbb, .rt .c-isee, .rt .c-usd { display: none; }
  .rt[data-sort="kbb"] .c-kbb, .rt[data-sort="isee"] .c-isee { display: table-cell; width: auto; white-space: normal; }
  .rt td.c-car strong { font-size: 15px; }
  .rt .mk { display: none; }
  .rt .md { white-space: normal; }
  .rt .mk2 { display: inline; }
  .rt thead .sw { display: none; }
  .dk { display: none; }
  .ph { display: inline; }
  .rt td .ph { display: block; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
  .rt td .ph.alt { white-space: normal; }
  .rt .getp { width: 88px; white-space: normal; min-height: 44px; padding: 6px 8px; font-size: 13px; }
  .rt tr.ad td { padding: 14px 12px; }
  .rt tr.ad .getp { width: 100%; white-space: nowrap; }
  .adin { flex-direction: column; align-items: stretch; }
  .rs-t5 li { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px 10px; }
  .rs-t5 .rs-bars { grid-column: 2 / -1; grid-row: 2; }
}
@media (max-width: 359px) {
  .rt th:first-child, .rt td:first-child { padding-left: 8px; }
  .rt .c-n { width: 28px; }
  .rt .getp { width: 78px; font-size: 12.5px; }
  .rt td.c-car .sm { overflow-wrap: anywhere; }
}
