/* Switch guides and the template page (Wrenchly). Loaded after site.css and app.css, which provide
   the variables, the zafiro header and hero, the pill button and .label. Hero colours are fixed in
   both themes; everything below the hero follows the theme. */

/* The two dark blocks below must stay identical (a test checks it), like in site.css. */
:root {
  --chip-bg: #FFE5DE;
  --chip-text: #8F2813;
  --alert: #C2412D;
  --warn-bg: #FFF3D6;
  --warn-text: #6B4A00;
  --hl-bg: #EAF1FC;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --chip-bg: rgb(255 107 74 / 16%);
    --chip-text: #FFB8A8;
    --alert: #FF8A70;
    --warn-bg: rgb(255 200 80 / 14%);
    --warn-text: #FFD98A;
    --hl-bg: rgb(31 95 191 / 22%);
  }
}
:root[data-theme="dark"] {
  --chip-bg: rgb(255 107 74 / 16%);
  --chip-text: #FFB8A8;
  --alert: #FF8A70;
  --warn-bg: rgb(255 200 80 / 14%);
  --warn-text: #FFD98A;
  --hl-bg: rgb(31 95 191 / 22%);
}

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Hero ------------------------------------------------------------------- */
.guide-hero .app-copy { max-width: 700px; padding: 8px 0 44px; }
.guide-back { display: inline-flex; align-items: center; min-height: 44px; color: #FFFFFF; font-weight: 600; font-size: 15px; text-decoration: none; }
.guide-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.guide-back:focus-visible { outline-color: #FFFFFF; }
.swap { display: flex; align-items: center; gap: 12px; margin: 4px 0 6px; color: #FFFFFF; }
.swap-icon { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 15px; background: #FFFFFF; box-shadow: 0 8px 24px rgb(0 0 0 / 25%); }
.swap-icon svg { width: 34px; height: 34px; }
.swap-arrow { flex: none; }
.guide-hero h1 { margin-top: 14px; }

/* Steps ------------------------------------------------------------------ */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px; padding: 22px 24px; }
.step-num {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: #1F5FBF; color: #FFFFFF; font-weight: 800; font-size: 16px;
}
.step h3 { margin: 4px 0 14px; font-size: 20px; line-height: 1.25; letter-spacing: -0.01em; }
.subs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.sub { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 16px; align-items: start; padding-left: 18px; }
.sub::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.sub p { margin: 0; font-size: 16px; }
.sub img { width: 100%; max-width: 150px; height: auto; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
/* Steps with screenshots: a numbered gallery, text above each shot */
.subs:has(img) { counter-reset: shot; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px 18px; }
.subs:has(img) .sub { display: flex; flex-direction: column; gap: 10px; padding-left: 0; counter-increment: shot; }
.subs:has(img) .sub::before {
  position: static; display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--soft); color: var(--text); content: counter(shot); font-size: 13px; font-weight: 700;
}
.subs:has(img) .sub p { flex: 1; font-size: 15px; }
.step-note { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.step-note a { color: var(--text); }
@media (max-width: 560px) {
  .step { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 18px 16px; }
  .step h3 { margin: 0 0 12px; }
  .subs:has(img) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
}

/* Why people switch ------------------------------------------------------- */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--chip-bg); color: var(--chip-text); font-size: 14px; font-weight: 600; line-height: 1.4; }

/* FAQ --------------------------------------------------------------------- */
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px;
  padding: 10px 0; cursor: pointer; list-style: none; font-weight: 700; font-size: 17px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; flex: none; font-size: 22px; font-weight: 700; color: var(--muted); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin: 0 0 16px; max-width: 46em; color: var(--muted); }

/* Call to action and links ------------------------------------------------- */
.cta h2, .promo h2 { margin: 0 0 6px; font-size: 20px; line-height: 1.25; }
.cta p, .promo p { margin: 0 0 12px; color: var(--muted); }
.cta p:last-child, .promo p:last-child { margin-bottom: 0; }
.promo-note { font-size: 15px; }
.guide-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.guide-link { display: block; height: 100%; color: var(--text); text-decoration: none; }
.guide-link strong { display: block; font-size: 17px; }
.guide-link span { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; }
.guide-link:hover strong { text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Template: the sheet in the hero ------------------------------------------- */
.template-hero .app-copy { max-width: 760px; }
.sheet-wrap { margin-top: 22px; overflow-x: auto; border-radius: 14px; background: #FFFFFF; box-shadow: 0 8px 24px rgb(0 0 0 / 25%); }
.sheet-table { width: 100%; border-collapse: collapse; color: #141821; font-size: 14px; }
.sheet-table th { padding: 9px 12px; background: #1F4E78; color: #FFFFFF; text-align: left; font-weight: 700; white-space: nowrap; }
.sheet-table td { padding: 9px 12px; border-bottom: 1px solid #E6E9EE; white-space: nowrap; }
.sheet-table tr:last-child td { border-bottom: 0; }
.sheet-table td:nth-child(4) { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.sheet-table :is(th, td):nth-child(3), .sheet-table :is(th, td):nth-child(5) { text-align: right; }
@media (max-width: 480px) {
  .sheet-table { font-size: 12.5px; }
  .sheet-table :is(th, td) { padding: 8px 6px; }
  .sheet-table td:nth-child(4) { max-width: 84px; }
}

/* Template: downloads and the Wrenchly card --------------------------------- */
.dl-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.dl-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 20px 12px; text-align: center; color: var(--text); text-decoration: none; }
.dl-card strong { font-size: 17px; }
.dl-card:hover strong { text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.dl-sub { color: var(--muted); font-size: 14px; }
.dl-ico { display: grid; place-items: center; width: 46px; height: 54px; margin-bottom: 8px; border-radius: 9px; color: #FFFFFF; font-weight: 800; font-size: 13px; letter-spacing: 0.02em; }
.dl-xlsx { background: #1D7044; }
.dl-sheets { background: #188038; font-size: 26px; }
.dl-pdf { background: #C2412D; }
.fill-list { margin: 0; padding-left: 20px; }
.fill-list li { margin: 6px 0; }
.promo { display: flex; gap: 18px; align-items: flex-start; }
.promo-icon { flex: none; width: 56px; height: 56px; border-radius: 15px; }
@media (max-width: 480px) { .promo { flex-direction: column; gap: 12px; } }

/* Calculator: form in the hero ------------------------------------------------ */
.calc-hero .app-copy { max-width: 560px; padding-bottom: 28px; }
.calc-hero h1 { margin: 6px 0 14px; font-size: clamp(28px, 6vw, 40px); }
.calc-nojs { margin-bottom: 0; }
html.js .calc-nojs { display: none; }
html:not(.js) .calc-form, html:not(.js) .calc-cards { display: none; }
.calc-form { display: grid; gap: 8px; }
.calc-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; min-width: 0; margin: 0 0 4px; padding: 3px; border: 0; border-radius: 12px; background: rgb(255 255 255 / 16%); }
.calc-seg label { display: block; cursor: pointer; }
.calc-seg span { display: grid; place-items: center; min-height: 44px; padding: 4px 6px; border-radius: 9px; color: #FFFFFF; font-weight: 700; font-size: 14px; line-height: 1.2; text-align: center; }
.calc-seg input:checked + span { background: #FFFFFF; color: #174C99; }
.calc-seg input:focus-visible + span { outline: 3px solid #FFFFFF; outline-offset: 2px; }
.calc-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 12px; padding: 4px 14px; border-radius: 12px; background: #FFFFFF; color: #141821; }
.calc-field[hidden], .calc-error[hidden], .calc-date[hidden], .calc-note[hidden] { display: none; }
.calc-field label { font-weight: 700; font-size: 15px; }
.calc-field small { color: #5A6372; font-weight: 600; font-size: 12px; }
.calc-field input { min-width: 0; min-height: 44px; border: 0; background: transparent; color: #141821; color-scheme: light; font: 600 16px/1.2 "Jakarta", system-ui, sans-serif; text-align: right; }
.calc-field input:focus-visible { outline: 3px solid #1F5FBF; outline-offset: 2px; }
.calc-field:has(input[aria-invalid="true"]) { box-shadow: inset 0 0 0 2px #C2412D; }
.calc-error { grid-column: 1 / -1; margin: 0 0 8px; color: #C2412D; font-weight: 700; font-size: 14px; }

/* Calculator: results ------------------------------------------------------------ */
.calc-results { padding-top: 24px; }
.calc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.calc-card { padding: 16px; }
.calc-card .label { margin: 0 0 6px; font-size: 12px; }
.calc-date { margin: 0; }
.calc-dm { display: block; font-size: clamp(28px, 8.5vw, 38px); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.calc-y { display: block; font-size: 18px; font-weight: 700; }
.calc-line { margin: 2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.35; }
.calc-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.calc-card.is-alert .calc-dm, .calc-card.is-alert .calc-y, .calc-card.is-alert .calc-line { color: var(--alert); }
.calc-runt { margin: 12px 0; padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-text); font-size: 15px; font-weight: 600; }
.calc-runt a { color: inherit; text-decoration-color: currentColor; }
.calc-cta .btn { text-decoration: none; }
.calc-rules-note { margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.app-section .calc-sources-label { margin-top: 28px; }
.calc-sources { margin: 0; padding-left: 20px; font-size: 15px; }
.calc-sources li { margin: 6px 0; }
.calc-sources span { color: var(--muted); font-size: 14px; }
@media (max-width: 420px) { .calc-card { padding: 14px 12px; } }

/* Comparison pages: the table, sources, chips with sources and the "which one to pick" cards ----------- */
.cmp-card { padding: 0; overflow: hidden; }
.cmp-wrap { overflow-x: auto; }
.cmp-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.cmp-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; }
.cmp-table :is(th, td) { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp-table td { min-width: 150px; }
.cmp-table thead th { background: var(--soft); font-weight: 700; white-space: nowrap; }
.cmp-table thead th.col-wrenchly { background: #1F5FBF; color: #FFFFFF; }
.cmp-table tbody th { position: sticky; left: 0; z-index: 1; width: 1%; min-width: 112px; background: var(--surface); font-weight: 700; box-shadow: 1px 0 0 var(--line); }
.cmp-table thead th.cmp-corner { position: sticky; left: 0; z-index: 1; min-width: 112px; }
.cmp-table td.col-wrenchly { background: var(--hl-bg); }
.cmp-table tbody tr:last-child :is(th, td) { border-bottom: 0; }
.cmp-guide { display: inline-block; margin-top: 4px; color: var(--text); font-weight: 600; }
.cmp-hint { display: none; margin: 0; padding: 10px 14px 0; color: var(--muted); font-size: 13px; }
.cmp-checked { margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.src { margin-left: 2px; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; }
.src a { display: inline-block; padding: 7px 5px; margin: -7px -2px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.src a:hover { color: var(--text); }
.chip .src a { color: inherit; }
.sources-title { margin: 28px 0 10px; font-size: 17px; }
.sources { margin: 0; padding-left: 24px; color: var(--muted); font-size: 14px; }
.sources li { margin: 6px 0; padding-left: 4px; }
.sources a { color: inherit; overflow-wrap: anywhere; }
.pick-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.pick { padding-top: 22px; }
.pick-wrenchly { box-shadow: inset 0 4px 0 #1F5FBF; }
.pick-fuelio { box-shadow: inset 0 4px 0 var(--muted); }
.pick h3 { margin: 0 0 10px; font-size: 20px; line-height: 1.25; letter-spacing: -0.01em; }
.pick ul { margin: 0; padding-left: 20px; }
.pick li { margin: 8px 0; }
@media (max-width: 640px) { .cmp-hint { display: block; } }
@media (max-width: 480px) {
  .cmp-table { font-size: 14px; }
  .cmp-table :is(th, td) { padding: 10px 10px; }
  .cmp-table td { min-width: 140px; }
}
