/* Cheaper Driving EV Fuel Savings Calculator (US). Everything is scoped under .cd-evc so the theme can't leak in.
   Palette: navy #0A1A2F, green #33800A / #8FE01A, gas-amber #FF8A3D. Archivo (headings) + Inter (body). */
.cd-evc {
  --accent: #33800A;           /* green for use on white (5.0:1 with white text) */
  --accent-dk: #266306;
  --glow: #8FE01A;             /* bright green for use on the navy panels */
  --gas: #FF8A3D;              /* gas / diesel */
  --ink: #0A1A2F;
  --char: #10243D;
  --char-lt: #15304F;
  --text: #4B5868;
  --grey-lt: #F2F5F8;
  --grey-brd: #DDE3EA;
  --white: #FFFFFF;
  --box-red: #C62828;          /* "not listed" panel while empty, white text 5.6:1 */
  --box-green: #2E7D14;        /* "not listed" panel once a figure is in, white text 4.7:1 */
  --r-ctl: 8px;                /* inputs and buttons */
  --r-card: 14px;              /* cards and panels */
  --shadow: 0 1px 2px rgba(10, 26, 47, .06), 0 12px 32px -12px rgba(10, 26, 47, .25);
  --ease: cubic-bezier(.2, .7, .2, 1);


  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--grey-lt);
  padding: 0 0 56px;
  -webkit-font-smoothing: antialiased;
}
.cd-evc *, .cd-evc *::before, .cd-evc *::after { box-sizing: border-box; }
/* :where() keeps this reset at zero specificity, so the component margins below always win */
.cd-evc :where(h1, h2, h3, p, fieldset, legend, dl, dd) { margin: 0; padding: 0; }
.cd-evc [hidden] { display: none !important; }
.cd-evc__wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.cd-evc__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* ---------- hero ---------- */
.cd-evc__hero {
  background: var(--ink);
  color: var(--white);
  padding: 64px 0 120px;           /* the calculator overlaps this band */
  border-bottom: 4px solid var(--glow);
}
.cd-evc__title {
  font-family: "Archivo", "Arial Black", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2.2rem, 5.6vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -.02em;
  max-width: 22ch;
  color: var(--white);
}
.cd-evc__lede {
  margin-top: 22px;
  max-width: 56ch;
  font-size: 1.0625rem;
  color: rgba(255, 255, 255, .78);
}

/* ---------- grid ---------- */
.cd-evc__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 20px;
  margin-top: -76px;
  align-items: start;
}
.cd-evc__card {
  background: var(--white);
  border: 1px solid var(--grey-brd);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 28px;
}

/* ---------- form ---------- */
.cd-evc__car { border: 0; min-width: 0; display: grid; gap: 10px; }
.cd-evc__car + .cd-evc__car { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--grey-brd); }
.cd-evc legend {
  display: flex; align-items: center; gap: 10px;
  font-family: "Inter", sans-serif;
  font-size: .78rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 12px;
  float: left; width: 100%;          /* legend sits inside the grid flow */
}
.cd-evc legend + * { clear: both; }
.cd-evc legend svg { color: var(--gas); flex: none; }
.cd-evc__car--ev legend svg { color: var(--accent); }

.cd-evc select, .cd-evc input[type="number"] {
  width: 100%;
  height: 48px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background-color: var(--white);
  border: 1px solid var(--grey-brd);
  border-radius: var(--r-ctl);
  padding: 0 14px;
  box-shadow: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.cd-evc select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230A1A2F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  text-overflow: ellipsis;
}
.cd-evc select:hover:not(:disabled), .cd-evc input[type="number"]:hover { border-color: #C9C9CF; }
.cd-evc select:focus-visible, .cd-evc input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(51, 128, 10, .25);
}
.cd-evc select:disabled { background-color: var(--grey-lt); color: #9A9AA2; cursor: not-allowed; }
.cd-evc__note { min-height: 1.3em; font-size: .8125rem; color: var(--text); }
.cd-evc__custom { margin: 0; }

/* "Not listed? Enter vehicle" panel: red while empty, green once a figure is in */
.cd-evc__custom {
  padding: 18px; border-radius: var(--r-ctl);
  background: var(--box-red); color: var(--white);
  box-shadow: 0 6px 18px -8px rgba(209, 19, 30, .55);
  transition: background-color .35s var(--ease), box-shadow .35s var(--ease);
}
.cd-evc__custom.is-complete { background: var(--box-green); box-shadow: 0 6px 18px -8px rgba(30, 132, 73, .55); }
.cd-evc .cd-evc__custom .cd-evc__lookup { padding: 0; background: transparent; }
.cd-evc .cd-evc__custom .cd-evc__lookup label,
.cd-evc .cd-evc__custom .cd-evc__lookup-note,
.cd-evc .cd-evc__custom .cd-evc__or { color: var(--white); }
.cd-evc .cd-evc__custom .cd-evc__lookup label { font-size: .875rem; font-weight: 700; }
.cd-evc .cd-evc__custom .cd-evc__or { opacity: .9; }
.cd-evc__custom.is-complete .cd-evc__lookup-note:not(:empty)::before { content: "\2713\00a0"; font-weight: 700; }
.cd-evc .cd-evc__custom input:focus-visible { border-color: var(--white); box-shadow: 0 0 0 3px rgba(255, 255, 255, .55); }
.cd-evc .cd-evc__custom .cd-evc__find:hover:not(:disabled) { background: var(--char-lt); }
.cd-evc .cd-evc__custom .cd-evc__find:focus-visible { outline: 3px solid var(--white); }

/* lookup box inside "Not listed" */
.cd-evc__lookup { padding: 16px; background: var(--grey-lt); border-radius: var(--r-ctl); }
.cd-evc__lookup label { display: block; margin-bottom: 8px; font-size: .8125rem; font-weight: 600; color: var(--ink); }
.cd-evc__lookup-row { display: flex; gap: 8px; }
.cd-evc__lookup-row input[type="text"] {
  flex: 1; min-width: 0; height: 48px; font: inherit; font-size: 1rem; color: var(--ink); background: var(--white);
  border: 1px solid var(--grey-brd); border-radius: var(--r-ctl); padding: 0 14px; box-shadow: none;
}
.cd-evc__lookup-row input[type="text"]:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(51, 128, 10, .25); }
.cd-evc__find {
  flex: none; height: 48px; padding: 0 18px; border: 0; cursor: pointer;
  font: inherit; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  color: var(--white); background: var(--ink); border-radius: var(--r-ctl);
  transition: background-color .15s var(--ease), transform .15s var(--ease);
}
.cd-evc__find:hover:not(:disabled) { background: var(--accent-dk); }
.cd-evc__find:active:not(:disabled) { transform: translateY(1px); }
.cd-evc__find:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cd-evc__find:disabled { cursor: progress; opacity: .8; }
.cd-evc__lookup-note { min-height: 1.3em; margin-top: 8px; font-size: .8125rem; color: var(--text); }
.cd-evc__or { margin: 12px 0 8px; font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text); }

.cd-evc__unit { position: relative; display: block; }
.cd-evc__unit input { padding-right: 78px !important; }
.cd-evc__unit > span {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: .8125rem; font-weight: 500; color: var(--text); pointer-events: none;
}

.cd-evc__fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--grey-brd);
}
.cd-evc__field { display: grid; gap: 8px; align-content: start; }
.cd-evc__field--wide { grid-column: 1 / -1; }
.cd-evc__field > span:first-child, .cd-evc__field > label, .cd-evc__field--wide > label {
  font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink);
}
.cd-evc__hint { font-size: .8125rem; line-height: 1.5; color: var(--text); }
.cd-evc__tou { margin-top: 2px; padding: 12px 14px; font-size: .875rem; line-height: 1.5; color: var(--ink); background: #EEF8DC; border-left: 4px solid var(--glow); border-radius: var(--r-ctl); }
.cd-evc__tou strong { display: block; margin-bottom: 2px; }
.cd-evc__range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; margin: 10px 0 2px; padding: 0;
  background: linear-gradient(to right, var(--accent) var(--fill, 22%), var(--grey-brd) var(--fill, 22%));
  border-radius: 999px; border: 0; cursor: pointer;
}
.cd-evc__range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--accent);
  box-shadow: 0 2px 6px rgba(10, 26, 47, .25);
}
.cd-evc__range::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--accent);
  box-shadow: 0 2px 6px rgba(10, 26, 47, .25);
}
.cd-evc__range:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

/* ---------- result panel ---------- */
.cd-evc__result {
  background: var(--char-lt);
  border-color: rgba(255, 255, 255, .1);
  border-top: 4px solid var(--glow);
  color: rgba(255, 255, 255, .8);
  position: sticky; top: 24px;
  padding: 32px 28px;
}
.cd-evc__empty { display: grid; gap: 14px; min-height: 280px; align-content: center; }
.cd-evc__ghost {
  font-family: "Archivo", "Arial Black", system-ui, sans-serif; font-size: clamp(3.4rem, 8vw, 5rem); line-height: 1;
  color: rgba(255, 255, 255, .16); letter-spacing: .01em;
}
.cd-evc__empty p { max-width: 30ch; color: rgba(255, 255, 255, .78); }

.cd-evc__label { font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .62); }
.cd-evc__big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.cd-evc__num {
  font-family: "Archivo", "Arial Black", system-ui, sans-serif; font-weight: 400;
  font-size: clamp(3.6rem, 9vw, 5.6rem); line-height: 1; letter-spacing: .005em; color: var(--white);
  font-variant-numeric: tabular-nums;
}
.cd-evc__per { font-size: 1.05rem; font-weight: 600; color: var(--white); }
.cd-evc__year { margin-top: 6px; color: rgba(255, 255, 255, .78); }
.cd-evc__year b { color: var(--white); }

.cd-evc__sub { margin: 28px 0 0; font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .62); }
.cd-evc__subnote { margin: 4px 0 0; font-size: .8125rem; color: rgba(255, 255, 255, .72); }
.cd-evc__bars { display: grid; gap: 14px; margin-top: 14px; }
.cd-evc__bar-head { display: flex; justify-content: space-between; gap: 12px; font-size: .875rem; color: rgba(255, 255, 255, .78); margin-bottom: 6px; }
.cd-evc__bar-head b { color: var(--white); font-weight: 600; }
.cd-evc__track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.cd-evc__fill { display: block; height: 100%; width: var(--w, 0%); border-radius: 999px; transform-origin: left; animation: cd-evc-grow .7s var(--ease) both; }
.cd-evc__fill--ice { background: var(--gas); }
.cd-evc__fill--ev { background: var(--glow); }
@keyframes cd-evc-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.cd-evc__table { width: 100%; border-collapse: collapse; margin-top: 28px; font-size: .9rem; }
.cd-evc__table caption { caption-side: top; text-align: left; margin: 0 0 6px; padding: 0; }
.cd-evc__table th, .cd-evc__table td { padding: 10px 6px; text-align: right; border: 0; border-top: 1px solid rgba(255, 255, 255, .14); background: transparent; color: rgba(255, 255, 255, .86); font-variant-numeric: tabular-nums; }
.cd-evc__table th:first-child, .cd-evc__table td:first-child { text-align: left; padding-left: 0; }
.cd-evc__table td:last-child, .cd-evc__table th:last-child { padding-right: 0; }
.cd-evc__table thead th { border-top: 0; font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.cd-evc__table tbody th { font-weight: 500; color: rgba(255, 255, 255, .86); white-space: nowrap; }
.cd-evc__table td.s { color: var(--white); font-weight: 700; }

.cd-evc__permile { display: flex; gap: 10px; margin-top: 10px; }
.cd-evc__permile div { flex: 1; border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--r-ctl); padding: 12px 14px; font-size: .78rem; color: rgba(255, 255, 255, .68); }
.cd-evc__permile b { display: block; margin-top: 2px; font-family: "Archivo", "Arial Black", system-ui, sans-serif; font-weight: 400; font-size: 1.6rem; line-height: 1.1; color: var(--white); }

.cd-evc__share { margin-top: 22px; }
.cd-evc__share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cd-evc .cd-evc__sbtn {
  appearance: none; display: inline-flex; flex: 1 1 auto; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 14px;
  font: inherit; font-size: .875rem; font-weight: 700; line-height: 1; color: var(--ink); text-decoration: none; cursor: pointer;
  background: var(--white); border: 0; border-radius: var(--r-ctl); box-shadow: 0 2px 0 rgba(0, 0, 0, .35);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.cd-evc .cd-evc__sbtn .cd-evc__ico { flex: none; }
.cd-evc .cd-evc__sbtn--share { background: var(--accent); color: var(--white); }
.cd-evc .cd-evc__sbtn--wa { background: #25D366; color: #07230F; }
.cd-evc .cd-evc__sbtn--mail { background: #DCE6F5; color: var(--ink); }
.cd-evc .cd-evc__sbtn:hover { filter: brightness(1.08); transform: translateY(-1px); color: inherit; }
.cd-evc .cd-evc__sbtn--share:hover { color: var(--white); }
.cd-evc .cd-evc__sbtn:active { transform: translateY(1px); box-shadow: none; }
.cd-evc .cd-evc__sbtn:focus-visible { outline: 3px solid var(--white); outline-offset: 2px; }
.cd-evc__share-note { margin-top: 8px; min-height: 1.3em; font-size: .8125rem; color: rgba(255, 255, 255, .82); }
.cd-evc__indic { margin-top: 16px; font-size: .8125rem; color: rgba(255, 255, 255, .62); }
.cd-evc__indic a { color: rgba(255, 255, 255, .86); text-decoration: underline; text-underline-offset: 3px; }
.cd-evc__cta { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: .9375rem; color: rgba(255, 255, 255, .82); }
.cd-evc__cta + .cd-evc__cta { margin-top: 16px; padding-top: 0; border-top: 0; }
.cd-evc__cta a { color: var(--white); font-weight: 600; text-decoration: underline; text-decoration-color: var(--glow); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.cd-evc__cta a:hover { text-decoration-color: var(--white); }
.cd-evc__cta small { display: block; margin-top: 6px; font-size: .75rem; color: rgba(255, 255, 255, .55); }

.cd-evc__disclaimer { margin-top: 28px; padding: 20px 24px; background: var(--white); border: 1px solid var(--grey-brd); border-left: 4px solid var(--ink); border-radius: var(--r-ctl); }
.cd-evc__disclaimer h2 { font-family: "Inter", sans-serif; font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink); }
.cd-evc__disclaimer p { margin-top: 8px; max-width: 90ch; font-size: .8125rem; line-height: 1.6; color: var(--text); }
.cd-evc__fine { margin-top: 18px; max-width: 80ch; font-size: .78rem; color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cd-evc__grid { grid-template-columns: minmax(0, 1fr); margin-top: -64px; }
  .cd-evc__result { position: static; }
  .cd-evc__hero { padding: 44px 0 100px; }
}
@media (max-width: 520px) {
  .cd-evc__lookup-row { flex-direction: column; }
  .cd-evc__lookup-row input[type="text"] { flex: none; width: 100%; }   /* in a column, flex:1 would collapse the height */
  .cd-evc__find { width: 100%; }
  .cd-evc__card { padding: 20px; }
  .cd-evc__result { padding: 24px 20px; }
  .cd-evc__fields { grid-template-columns: 1fr; }
  .cd-evc__permile { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .cd-evc *, .cd-evc *::before, .cd-evc *::after { animation: none !important; transition: none !important; }
}
