/* The two free calculators. Mobile first, no framework, no layout shift.
   Light theme, to match the warm-paper palette in style.css. */

.tool-hero {
  padding: 56px 0 24px;
}
.tool-hero h1 {
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.15;
  font-weight: 900;
  margin: 0 0 12px;
  text-wrap: balance;
}
.tool-intro {
  font-size: 16px;
  line-height: 1.6;
  color: #6b7280;
  max-width: 62ch;
  margin: 0;
}

.tool-wrap { padding-bottom: 64px; }

.tool-card {
  background: #ffffff;
  border: 1px solid #e7e5df;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
}
.tool-card h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 4px;
}
.tool-card .hint {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 16px;
}

/* A warning that cannot be missed, for sample tax rates. */
.sample-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.sample-warning strong { color: #b45309; display: block; margin-bottom: 4px; }
.sample-warning p { margin: 0; font-size: 14px; line-height: 1.55; color: #4b5563; }

/* Real rates that IFTA has not finalised yet. Deliberately NOT the orange
   box above: these are the official numbers, they are simply provisional,
   and a warning panel would overstate it and make the page look unfinished
   to somebody who arrived from an advert. A quiet line, 4.9:1 on white. */
.provisional-note {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.55;
  color: #5b6472;
}

.rates-quarter {
  font-size: 13px;
  font-weight: 700;
  color: #4CBB17;
  margin: 0 0 14px;
}

/* ── Inputs ─────────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.field input,
.field select {
  /* border-box, or the padding pushes each box into the next column. */
  box-sizing: border-box;
  width: 100%;
  /* 16px so iOS does not zoom the page on focus. */
  font-size: 16px;
  padding: 11px 12px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid #d6d3cc;
  background: #ffffff;
  color: #1c1917;
  font-family: inherit;
}
.field input:focus,
.field select:focus {
  outline: 2px solid #4CBB17;
  outline-offset: 1px;
}

/* ── The state rows on the IFTA page ────────────────────────────────── */
.state-rows { display: flex; flex-direction: column; gap: 10px; }
.state-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}
.state-row .field { margin: 0; }
/* Labels only on the first row on a wide screen; every row keeps them on a
   phone, where the columns stack and a bare box means nothing. */
@media (max-width: 640px) {
  .state-row {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
    border: 1px solid #e7e5df;
    border-radius: 12px;
  }
  .state-row .field:first-child { grid-column: 1 / -1; }
  .state-row .row-remove { grid-column: 1 / -1; }
}
.row-remove {
  box-sizing: border-box;
  min-height: 44px;
  min-width: 44px;
  border-radius: 10px;
  border: 1px solid #d6d3cc;
  background: transparent;
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.row-remove:hover { color: #EF4444; border-color: rgba(239, 68, 68, 0.5); }

.add-row {
  margin-top: 12px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px dashed #c9c5bc;
  background: transparent;
  color: #1c1917;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

/* ── Cost groups ────────────────────────────────────────────────────── */
.cost-grid { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 640px) { .cost-grid { grid-template-columns: 1fr 1fr; } }

/* ── Results ────────────────────────────────────────────────────────── */
.tool-result {
  background: rgba(76, 187, 23, 0.07);
  border: 1px solid rgba(76, 187, 23, 0.35);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
}
.result-headline {
  font-size: clamp(26px, 7vw, 38px);
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 2px;
  font-variant-numeric: tabular-nums;
}
.result-label { font-size: 13px; color: #6b7280; margin: 0 0 16px; }

.result-figures {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 640px) { .result-figures { grid-template-columns: repeat(4, 1fr); } }
.figure .v {
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: block;
}
.figure .k { font-size: 12px; color: #6b7280; }

.split-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7e5df;
  margin-bottom: 8px;
}
.split-bar span { display: block; height: 100%; }
.split-fixed { background: #4CBB17; }
.split-variable { background: #2563EB; }
.split-key { font-size: 12px; color: #6b7280; display: flex; gap: 16px; flex-wrap: wrap; }
.split-key b { color: #1c1917; }

/* The per-state table, scrollable on its own so the page never moves
   sideways. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  min-width: 520px;
}
table.tool-table th,
table.tool-table td {
  text-align: right;
  padding: 9px 10px;
  border-bottom: 1px solid #ece9e2;
  white-space: nowrap;
}
table.tool-table th:first-child,
table.tool-table td:first-child { text-align: left; }
table.tool-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  font-weight: 700;
}
td.credit { color: #4CBB17; }

/* ── The results table on a phone ───────────────────────────────────────
 *
 * The table is six columns and a 520px floor, so on a 390px screen the two
 * that matter most, Net gal and Tax, sat off the right edge behind a sideways
 * scroll nobody discovers. The tax owed is the answer the page exists to
 * give, and it was the one figure you could not see.
 *
 * Below 640px each row becomes a stacked card instead: the state as a
 * heading, then one line per figure with the label the hidden column header
 * would have given it, and the tax last and larger because it is the answer.
 *
 * Done with CSS and a data-label attribute rather than a second block of
 * markup, so there is still one table, one renderer, and the same cells for
 * a screen reader. Desktop is untouched.
 */
@media (max-width: 640px) {
  .table-scroll { overflow-x: visible; }

  table.tool-table {
    min-width: 0;
    display: block;
    font-size: 15px;
  }
  table.tool-table thead {
    /* Hidden from sight, kept for assistive tech. */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  table.tool-table tbody { display: block; }

  table.tool-table tr {
    display: block;
    border: 1px solid #e7e5df;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #ffffff;
  }

  table.tool-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    text-align: right;
    padding: 5px 0;
    border-bottom: 0;
    white-space: normal;
  }
  table.tool-table td::before {
    content: attr(data-label);
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    font-weight: 700;
    flex: 0 0 auto;
  }

  /* The state is the card's heading, so it gets no label and sits alone. */
  table.tool-table td:first-child {
    display: block;
    text-align: left;
    font-size: 16px;
    font-weight: 800;
    padding: 0 0 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid #f0eee8;
  }
  table.tool-table td:first-child::before { content: none; }

  /* The answer. Last line, bigger, and separated from the workings. */
  table.tool-table td.tax-cell {
    font-size: 18px;
    font-weight: 800;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid #f0eee8;
  }

  /* ── The surcharge chart stays a table on a phone ──────────────────
   *
   * The stacked card above is right for the IFTA result: six wide columns
   * and a handful of rows. The chart is the opposite, three short money
   * columns and 40 rows, which stack into 40 cards and a scroll that never
   * ends. Three columns fit a 390px screen once the headers may wrap, so
   * the chart keeps its table and still loses no column.
   */
  table.chart-table { min-width: 0; }
  table.chart-table tr {
    display: table-row;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
    background: none;
  }
  table.chart-table thead {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    overflow: visible;
  }
  table.chart-table tbody { display: table-row-group; }
  table.chart-table th,
  table.chart-table td {
    display: table-cell;
    white-space: normal;
    padding: 8px 6px;
    font-size: 13px;
    text-align: right;
  }
  /* The IFTA card gives its first cell a 16px heading, which is right for a
     card and oversized for a column. Matched to its neighbours instead. */
  table.chart-table th:first-child,
  table.chart-table td:first-child {
    display: table-cell;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 6px;
    margin-bottom: 0;
    border-bottom: 1px solid #ece9e2;
  }
  /* The stacked label belongs to the card layout, and the header is back. */
  table.chart-table td::before { content: none; }
  table.chart-table td.tax-cell {
    font-size: 13px;
    font-weight: 700;
    padding-top: 8px;
    margin-top: 0;
    border-top: 0;
    border-bottom: 1px solid #ece9e2;
  }
  table.chart-table tr.chart-row-current td { background: #f3faec; }
}
td.owed { color: #1c1917; }

/* ── The surcharge chart row nearest the price you typed ─────────────
 *
 * The chart is 40 rows. Highlighting the one nearest the current price is
 * what turns it from a reference table into an answer, so it carries a
 * tint, a left edge and a word rather than colour alone.
 */
tr.chart-row-current td { background: #f3faec; font-weight: 700; color: #1c1917; }
tr.chart-row-current td:first-child { box-shadow: inset 3px 0 0 #388711; }
.chart-row-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #31760F;
}

.tool-note { font-size: 13px; color: #6b7280; line-height: 1.6; }

/* ── The pitch under the result ─────────────────────────────────────── */
.tool-pitch {
  border-top: 1px solid #e7e5df;
  padding-top: 28px;
  margin-top: 8px;
}
.tool-pitch h2 { font-size: 22px; font-weight: 900; margin: 0 0 8px; }
.tool-pitch p { color: #6b7280; line-height: 1.65; max-width: 62ch; margin: 0 0 18px; }

.result-cta { display: inline-flex; align-items: center; justify-content: center; margin-top: 4px; }

/* ── The /ifta-software landing page ────────────────────────────────── */
.how-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.how-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  line-height: 1.65;
  color: #4b5563;
}
.how-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #3a9413;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.how-steps li strong { color: #111827; display: block; margin-bottom: 2px; }

.faq-item { padding: 14px 0; border-top: 1px solid #efede7; }
.faq-item:first-of-type { border-top: 0; padding-top: 0; }
.faq-item h3 { font-size: 15px; font-weight: 800; margin: 0 0 5px; color: #111827; }
.faq-item p { margin: 0; font-size: 15px; line-height: 1.65; color: #4b5563; }

/* ── The offer under a result ───────────────────────────────────────────
   Replaces a generic trial button with the person's own number. See
   assets/tool-offer.js for why: four of seven trial clicks in the week to
   2026-11-15 happened before there was a result on screen, because the
   button was the only next step the page offered. */
.offer-card {
  border-top: 1px solid rgba(76, 187, 23, 0.35);
  margin-top: 16px;
  padding-top: 16px;
}
.offer-line {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.6;
  color: #1c1917;
  max-width: 54ch;
}
.offer-card:not([data-has-result]) .offer-line { color: #6b7280; }
.offer-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 44px is the floor for a thumb, and this is the button the whole page is
     for. */
  min-height: 48px;
  text-align: center;
}
/* The inline signup in the result. Two fields and a button, stacked on a
   phone, because this is where the signup now starts: the far side of the
   page load is where six of six visitors left. */
.offer-signup { margin: 0; }
.offer-signup-field { margin: 0 0 12px; }
.offer-signup-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.offer-signup-field input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d6d3cd;
  border-radius: 10px;
  background: #fff;
  font-size: 16px; /* 16px or iOS zooms the page on focus. */
  color: #1c1917;
}
.offer-signup-field input:focus {
  outline: 2px solid #388711;
  outline-offset: 1px;
  border-color: #388711;
}
.offer-signup .offer-cta {
  width: 100%;
  /* Repeated rather than inherited from .offer-cta above: this is the rule
     that wins, so this is where the thumb target has to be guaranteed. */
  min-height: 48px;
  /* The label is a sentence, so it wraps on a narrow phone rather than
     running off the edge or shrinking to unreadable. */
  white-space: normal;
}
@media (min-width: 560px) {
  /* Off a phone the button no longer needs the full width. The 48px floor is
     restated because this is then the rule that wins, and a tap target is
     not something to leave to which rule the cascade happens to land on. */
  .offer-signup .offer-cta { width: auto; min-height: 48px; }
}
.offer-signup-note { margin: 10px 0 0; font-size: 13px; color: #6b7280; line-height: 1.5; }
.offer-signup-note.is-bad { color: #B42318; }
.offer-alt { margin: 14px 0 0; }
.offer-email-open {
  background: none;
  border: 0;
  padding: 10px 0;
  min-height: 44px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #31760F;
  text-decoration: underline;
  cursor: pointer;
}
.offer-email { margin: 10px 0 0; }
.offer-email label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.offer-email-row { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 560px) {
  .offer-email-row { flex-direction: row; align-items: stretch; }
  .offer-email-row input { flex: 1 1 auto; min-width: 0; }
}
.offer-email-row input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d6d3cd;
  border-radius: 10px;
  background: #fff;
  font-size: 16px; /* 16px or iOS zooms the page on focus. */
  color: #1c1917;
}
.offer-email-row input:focus {
  outline: 2px solid #388711;
  outline-offset: 1px;
  border-color: #388711;
}
.offer-email-row .btn-primary {
  min-height: 48px;
  white-space: nowrap;
  justify-content: center;
}
/* The marketing tick box. A full-width label so the whole line is the tap
   target, and 44px of it, because a bare checkbox is about 16px and asking
   somebody to hit that on a phone is how accidental consent happens. */
.offer-optin {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 0;
  padding: 6px 0;
  min-height: 44px;
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
  cursor: pointer;
}
.offer-optin input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: #388711;
}

.offer-email-note { margin: 10px 0 0; font-size: 13px; color: #6b7280; line-height: 1.5; }
.offer-email-note.is-bad { color: #B42318; }
.offer-email-done { margin: 10px 0 0; font-size: 14px; font-weight: 600; color: #31760F; }

/* The field no person ever sees. Off screen rather than display:none, which
   some form fillers skip. */
.offer-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── "Don't know it? Estimate it", beside the fuel field ───────────────── */
.estimate-open {
  background: none;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #31760F;
  text-decoration: underline;
  cursor: pointer;
}
.estimate-box {
  border: 1px dashed #cfd4c8;
  border-radius: 10px;
  padding: 12px 14px 4px;
  margin: 0 0 14px;
  background: #fbfcf8;
}
.estimate-box .estimate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.estimate-box .tool-note { margin: 0 0 12px; }
.estimated-flag {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #31760F;
}

/* ── The running total on a phone ─────────────────────────────────────────
   Phone only, and pinned to the bottom of the VISUAL viewport by
   assets/cpm-sticky.js so the keyboard cannot bury it. */
.cpm-sticky { display: none; }
@media (max-width: 767px) {
  .cpm-sticky {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: 100%;
    border: 0;
    border-top: 1px solid rgba(76, 187, 23, 0.5);
    background: #f2f8ec;
    box-shadow: 0 -6px 18px rgba(16, 24, 16, 0.12);
    padding: 10px 16px;
    min-height: 56px;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .cpm-sticky[hidden] { display: none; }
  .cpm-sticky-figure {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: #1c1917;
    font-variant-numeric: tabular-nums;
  }
  .cpm-sticky-next { display: block; font-size: 12px; color: #4b5563; margin-top: 2px; }
}
