/* IDX-01 (Design Lead, 2026-11-13): "Example calculations" + "How we calculate" on /tools/fuel-cost-calculator/, /tools/ev-trip-cost/,
   /tools/split-gas-cost/, /ev-vs-gas/; calculator link cards on /. Loaded ONLY on these 5 pages; shared CSS/JS untouched; no JS.
   Card style: uiverse-adapt v2 (soft layered shadows, radius 16/12, 8px grid, warm gradient total #cc4a12→#b93d0b, white text 4.61:1+). */
html[data-theme]{--idx-warm-a:#cc4a12;--idx-warm-b:#b93d0b;--idx-shadow:0 1px 2px rgba(0,0,0,.18),0 8px 24px rgba(0,0,0,.22)}
html[data-theme=light]{--idx-shadow:0 1px 2px rgba(15,23,42,.06),0 8px 24px rgba(15,23,42,.08)}

/* Links in running text are underlined (these 5 pages only). */
html[data-theme] main p a:not([class]),html[data-theme] main li a:not([class]),html[data-theme] main dd a:not([class]){text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
/* Inline links in the new blocks: one rectangular box, so a tap at its centre always lands on the link even when it wraps. */
html[data-theme] .idx p a:not([class]){display:inline-block}

.idx{margin:32px 0;min-width:0}
.idx>h2{margin-bottom:8px}
.idx-lead{margin:0 0 16px;color:var(--t-text2)}

/* Example cards: one column on phone (no table, no horizontal scroll); 2–3 across when there is room. */
html[data-theme] .idx ol.idx-cards,html[data-theme] .idx ul.idx-links,html[data-theme] .idx ol.idx-stepl{margin-left:0;padding-left:0}
.idx-cards{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
@media (min-width:1024px){.idx-cards{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}}
html[data-theme] .idx .idx-cards>li,html[data-theme] .idx .idx-links>li{margin:0;min-width:0}
.idx-card{display:flex;flex-direction:column;min-width:0;padding:16px;border:1px solid var(--t-border);border-radius:16px;background:var(--t-surface);color:var(--t-text);box-shadow:var(--idx-shadow)}
.idx-card h3{margin:0 0 8px;font-size:17px;line-height:1.4;color:var(--t-text)}
.idx-sub{margin:16px 0 0;font-size:13px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--t-text2)}
.idx-rows{margin:0;padding:0}
.idx-rows>div{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:8px 0;border-bottom:1px solid var(--t-border)}
.idx-rows>div:last-child{border-bottom:0}
.idx-rows dt{margin:0;color:var(--t-text2);font-size:15px;line-height:1.4;min-width:0}
.idx-rows dd{margin:0;color:var(--t-text);font-weight:650;font-size:15px;line-height:1.4;text-align:right;font-variant-numeric:tabular-nums;min-width:0;overflow-wrap:anywhere}
.idx-src-tag{display:block;font-weight:400;font-size:13px;color:var(--t-text2)}
.idx-total{margin:16px 0 0}
.idx-total>div{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;border-radius:12px;background:linear-gradient(135deg,var(--idx-warm-a),var(--idx-warm-b));color:#fff}
.idx-total dt{margin:0;font-size:14px;font-weight:600;line-height:1.35;color:#fff;min-width:0}
.idx-total dd{margin:0;font-size:22px;line-height:1.2;font-weight:800;color:#fff;font-variant-numeric:tabular-nums;white-space:nowrap}
.idx-math{margin:12px 0 0;font-size:14px;line-height:1.5;color:var(--t-text2);overflow-wrap:anywhere}
.idx-note{margin:12px 0 0;padding:8px 12px;border-radius:12px;background:var(--t-action-soft);color:var(--t-text);font-size:14px;line-height:1.5;font-weight:600}
.idx-stepl{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:8px;counter-reset:idx}
.idx-stepl li{counter-increment:idx;display:grid;grid-template-columns:24px minmax(0,1fr);gap:8px;align-items:start;margin:0;font-size:14px;line-height:1.5;color:var(--t-text);overflow-wrap:anywhere}
.idx-stepl li::before{content:counter(idx);display:grid;place-items:center;width:24px;height:24px;border-radius:999px;background:linear-gradient(135deg,var(--idx-warm-a),var(--idx-warm-b));color:#fff;font-weight:800;font-size:13px}

/* How we calculate (Forge text): soft panel. */
.idx-how{padding:16px;border:1px solid var(--t-border);border-radius:16px;background:var(--t-elevated);color:var(--t-text)}
.idx-how p{margin:8px 0 0;line-height:1.6}
.idx-how a{color:var(--t-action)}
@media (min-width:640px){.idx-how{padding:24px}}

/* Existing worked examples on the pilot pages: same card look, text untouched. */
html[data-theme] .example.idx-prev{display:block;padding:16px;border:1px solid var(--t-border);border-radius:16px;background:var(--t-surface);color:var(--t-text);box-shadow:var(--idx-shadow);line-height:1.6}

/* Home: calculator link cards (whole card is the link, >=44px). */
.idx-links{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
@media (min-width:640px){.idx-links{grid-template-columns:repeat(2,minmax(0,1fr))}}
.idx-links a.idx-link{display:flex;flex-direction:column;justify-content:center;gap:4px;min-height:72px;height:100%;box-sizing:border-box;padding:12px 16px;border:1px solid var(--t-border);border-radius:16px;background:var(--t-surface);color:var(--t-text);text-decoration:none;box-shadow:var(--idx-shadow)}
.idx-link-t{font-weight:750;font-size:16px;line-height:1.35;color:var(--t-action);text-decoration:underline;text-underline-offset:3px}
.idx-link-d{font-size:14px;line-height:1.45;color:var(--t-text2)}
.idx-links a.idx-link:focus-visible{outline:3px solid var(--t-action);outline-offset:2px}
.idx-links li.idx-extra a.idx-link{border-style:dashed}

/* Motion only when the user has not asked to reduce it; transform only (CLS 0). */
@media (prefers-reduced-motion:no-preference){
 .idx-card,.idx-links a.idx-link{transition:transform .18s ease,box-shadow .18s ease}
 .idx-card:hover,.idx-links a.idx-link:hover{transform:translateY(-2px)}
 .idx-links a.idx-link:active{transform:translateY(1px)}
}
/* Light theme has a global dd colour rule; keep the total white (contrast 4.61:1+ on the gradient). */
html[data-theme] .idx .idx-total dt,html[data-theme] .idx .idx-total dd{color:#fff}
/* Keep new source/methodology links clear of the fixed mobile bars when scrolled to (tap/focus). */
html[data-theme] .idx a{scroll-margin-block:100px}
