/* «Скільки заощаджує електромобіль» (/ekonomiia/, src/savings.js). Site tokens, .card, .seg, .select, .switch, .btn from
   site.css. Desktop: the inputs on the left (sticky), the answer on the right — the number, two receipts, five years,
   what it means. Phone: the number → the inputs → the receipts → the rest. One orchestrated motion: the receipts print. */
.sv-head { padding-bottom: 24px; }
.sv-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.sv-kicker .i { width: 18px; height: 18px; color: var(--ok); }
.sv-head h1 { margin-top: 8px; }

.sv {
  display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  grid-template-areas: "form hero" "form receipts" "form chart" "form eq" "form cta" "form .";
  grid-template-rows: auto auto auto auto auto 1fr;
  align-items: start; gap: 20px clamp(20px, 2.4vw, 32px); padding-bottom: 72px;
}
.sv-hero { grid-area: hero; }
.sv-form { grid-area: form; }
.sv-receipts { grid-area: receipts; }
.sv-chart { grid-area: chart; }
.sv-eq { grid-area: eq; }
.sv-cta { grid-area: cta; }
@media (min-width: 961px) and (min-height: 760px) { .sv-form { position: sticky; top: 96px; } }
@media (max-width: 960px) {
  .sv { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "form" "receipts" "chart" "eq" "cta"; grid-template-rows: none; }
}

/* ---------- the answer: one big number on graphite, the logo's green glowing behind it ---------- */
.sv-hero {
  position: relative; isolation: isolate; overflow: hidden; padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r-lg); background: var(--graphite); color: #fff;
}
.sv-hero::before {
  content: ""; position: absolute; z-index: -1; right: -12%; top: -55%; width: min(560px, 75%); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(64, 115, 97, 0.75), rgba(64, 115, 97, 0.25) 55%, transparent);
}
.sv-hero__t { color: rgba(255, 255, 255, 0.72); font-size: 15px; font-weight: 600; }
.sv-hero__big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin-top: 4px; }
.sv-hero__n { font-size: clamp(46px, 7vw, 92px); font-weight: 700; line-height: 1.02; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sv-hero__ap { color: rgba(255, 255, 255, 0.5); font-weight: 500; }
.sv-hero__per { color: #9ed8bd; font-size: clamp(18px, 2vw, 24px); font-weight: 600; }
.sv-hero__more { display: flex; flex-wrap: wrap; gap: 0 8px; margin-top: 12px; font-size: clamp(16px, 1.7vw, 20px); font-weight: 600; font-variant-numeric: tabular-nums; }
.sv-hero__more span { white-space: nowrap; }
.sv-hero__sep { color: rgba(255, 255, 255, 0.5); }
@media (max-width: 480px) { /* one figure per line; the dot stays for screen readers */
  .sv-hero__more { flex-direction: column; }
  .sv-hero__sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
.sv-hero__more:has([data-o="five"]:empty), .sv-hero__note:empty { display: none; } /* a loss: the note says why instead */
.sv-hero__note { max-width: 60ch; margin-top: 12px; color: rgba(255, 255, 255, 0.8); font-size: 15px; }
.sv-hero__vs { max-width: 60ch; margin-top: 6px; color: rgba(255, 255, 255, 0.64); font-size: 14px; }
.sv-hero.is-loss::before { background: radial-gradient(closest-side, rgba(180, 35, 24, 0.45), transparent); }
.sv-hero.is-loss .sv-hero__per { color: #f4b7ad; }

/* ---------- the inputs ---------- */
.sv-form { display: grid; gap: 28px; padding: clamp(20px, 2.2vw, 28px); }
.sv-f { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.sv-f__t { margin-bottom: 12px; padding: 0; font-size: 15px; font-weight: 700; }
.sv-km { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.sv-km__v { font-size: 32px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sv-km__y { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.sv-note { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

/* sliders: the filled part follows the thumb (--p, 0..1, set by the page) */
.sv-range { --p: 0.5; --fill: var(--graphite); --rest: var(--mist-2); width: 100%; height: 30px; margin: 0; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
.sv-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--fill) calc(var(--p) * 100%), var(--rest) 0); }
.sv-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--rest); }
.sv-range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--fill); }
.sv-range::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -10px; border: 3px solid #fff; border-radius: 50%; background: var(--graphite); box-shadow: 0 2px 8px rgba(15, 17, 20, 0.3); -webkit-appearance: none; appearance: none; }
.sv-range::-moz-range-thumb { width: 20px; height: 20px; border: 3px solid #fff; border-radius: 50%; background: var(--graphite); box-shadow: 0 2px 8px rgba(15, 17, 20, 0.3); }
.sv-range:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
.sv-range--home { --fill: var(--ok); --rest: #e2a83c; } /* green at home, amber on the pricier fast stations */

.sv-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.sv-chip {
  display: grid; justify-items: start; gap: 1px; min-height: 48px; padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; color: var(--graphite); font-size: 13px; font-weight: 600; line-height: 1.25; text-align: left; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.sv-chip small { color: var(--muted); font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sv-chip:hover { border-color: var(--graphite); }
.sv-chip[aria-pressed="true"] { border-color: var(--graphite); background: var(--graphite); color: #fff; }
.sv-chip[aria-pressed="true"] small { color: rgba(255, 255, 255, 0.72); }

.sv-own { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 14px; font-weight: 500; }
.sv-own input {
  width: 86px; height: 44px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff;
  font-size: 16px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.sv-own input:focus { border-color: var(--graphite); outline: none; }
.sv-own input[aria-invalid="true"] { border-color: var(--danger); }

.sv-select, .sv-select select { display: block; width: 100%; }
.sv-select select { height: 48px; border-radius: var(--r-sm); font-size: 15px; text-overflow: ellipsis; }

.sv-split { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
.sv-split > span { display: inline-flex; align-items: baseline; gap: 6px; color: var(--muted); }
.sv-split b { font-size: 16px; font-variant-numeric: tabular-nums; }
.sv-split .is-home b { color: var(--ok); }
.sv-split .is-dc b { color: var(--warn); }
.sv-switch { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.sv-switch .switch { margin-top: 1px; }
.sv-switch small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 500; }
.sv-switch .nw { white-space: nowrap; }
.sv-f .seg label { flex: 1 1 auto; } /* «Позашляховик» takes the room «Седан» doesn't need */
.sv-f .seg span { padding-inline: 10px; font-size: 13.5px; }

/* phones: the number is above the inputs — repeat it where the thumb is */
.sv-peek { display: none; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--graphite); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
@media (max-width: 960px) { .sv-peek { display: flex; } }

/* ---------- the receipts: thermal paper coming out of two printers ---------- */
.sv-receipts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: clamp(12px, 3.4vw, 48px);
  padding: clamp(20px, 3vw, 36px) clamp(12px, 3.6vw, 56px) clamp(20px, 3vw, 32px); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--mist-2), var(--mist) 70%);
}
.sv-rc { min-width: 0; width: 100%; max-width: 300px; margin: 0; justify-self: center; }
.sv-rc__cap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.sv-rc__cap .i { width: 18px; height: 18px; }
.sv-rc__cap b { margin-left: auto; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sv-rc--ev .sv-rc__cap .i, .sv-rc--ev .sv-rc__cap b { color: var(--ok); }
/* the printer's mouth: the paper comes out from under it */
.sv-rc__slot { position: relative; z-index: 1; height: 14px; margin-inline: -10px; border-radius: 7px; background: linear-gradient(180deg, #3a3d40, #1d1f21); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.18); }
.sv-rc__slot::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 3px; height: 3px; border-radius: 2px; background: #0c0d0e; }
.sv-rc__feed { margin-top: -6px; padding: 0 3px 14px; overflow: hidden; overflow: clip; }
.sv-r { filter: drop-shadow(0 6px 9px rgba(15, 17, 20, 0.12)) drop-shadow(0 1px 1px rgba(15, 17, 20, 0.08)); }
.sv-r__paper {
  --tooth: 12px;
  padding: 24px clamp(10px, 1.6vw, 18px) calc(18px + var(--tooth) / 2);
  background: linear-gradient(180deg, #f4f2ec, #fffefb 22px, #fffdf8);
  color: #2b2a28; font: 500 12.5px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
  /* torn off at the bottom: a row of teeth */
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--tooth) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--tooth) 100%;
}
.sv-r__shop { font-size: 15px; font-weight: 800; letter-spacing: 0.14em; text-align: center; text-transform: uppercase; }
.sv-r__meta { margin-top: 4px; color: #75726b; font-size: 11px; line-height: 1.45; text-align: center; }
.sv-r__lines { display: grid; gap: 9px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed #bdb9ae; }
.sv-r__lines li { display: grid; }
.sv-r__name { font-weight: 700; }
.sv-r__calc { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 8px; color: #5b5953; font-size: 11.5px; }
.sv-r__calc b { margin-left: auto; color: #23221f; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.sv-r__total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 8px; margin-top: 14px; padding-top: 10px; border-top: 1px dashed #bdb9ae; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.sv-r__total b { margin-left: auto; font-size: 15px; white-space: nowrap; }
.sv-r__foot { margin-top: 10px; color: #75726b; font-size: 11px; text-align: center; }
@media (max-width: 400px) { /* two receipts in 360 px: the units are in the header, the lines keep the numbers */
  .sv-r__paper { padding-inline: 8px; }
  .sv-r__calc .sv-r__u { display: none; }
  .sv-r__meta { font-size: 10px; }
}
@media (max-width: 480px) {
  .sv-rc__slot { margin-inline: -4px; }
  .sv-r__paper { font-size: 11.5px; }
  .sv-r__calc { font-size: 10.5px; }
  .sv-r__calc b { font-size: 11.5px; }
  .sv-r__total b { font-size: 13px; }
  .sv-rc__cap { font-size: 13px; }
  .sv-rc__cap b { width: 100%; margin-left: 0; font-size: 15px; } /* the total under the name: two columns are narrow */
}
/* the print: the paper slides out of the slot at a printer's steady speed (--feed: ms for its length, public/js/savings.js) */
@keyframes sv-feed { from { transform: translateY(-101%); } }
.sv-r.is-printing { animation: sv-feed var(--feed, 900ms) cubic-bezier(0.32, 0.06, 0.24, 1) both; }
@media (prefers-reduced-motion: reduce) { .sv-r.is-printing { animation: none; } }

/* ---------- five years ---------- */
.sv-chart { margin: 0; padding: clamp(20px, 2.6vw, 32px); }
.sv-chart__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 22px; }
.sv-chart__t { font-size: clamp(20px, 2vw, 24px); font-weight: 700; }
.sv-chart__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13px; font-weight: 600; }
.sv-chart__legend > span { display: inline-flex; align-items: center; gap: 8px; }
.sv-chart__legend i { width: 20px; height: 3px; border-radius: 2px; }
.sv-chart__legend .is-fuel { background: var(--graphite); }
.sv-chart__legend .is-ev { background: var(--ok); }
.sv-chart__plot { position: relative; height: clamp(210px, 24vw, 290px); margin-right: 6px; border-bottom: 1.5px solid #c9ccd1; }
.sv-chart__plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sv-chart__grid { fill: none; stroke: var(--line); stroke-width: 1px; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.sv-chart__gap { fill: var(--ok-bg); }
.sv-chart__gap.is-loss { fill: #fbe7e4; }
.sv-chart__line { fill: none; stroke-width: 3px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sv-chart__line--fuel { stroke: var(--graphite); }
.sv-chart__line--ev { stroke: var(--ok); }
.sv-chart__dot { position: absolute; right: 0; width: 12px; height: 12px; margin: -6px -6px 0 0; border: 2.5px solid #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.sv-chart__dot--fuel { background: var(--graphite); }
.sv-chart__dot--ev { background: var(--ok); }
.sv-chart__end { position: absolute; right: 0; padding: 2px 0; font-size: 15px; font-weight: 700; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; transform: translateY(calc(-100% - 10px)); }
.sv-chart__end.is-below { transform: translateY(10px); }
.sv-chart__end--ev { color: var(--ok); }
.sv-chart__gap-label { position: absolute; display: grid; justify-items: center; color: var(--ok); font-size: 12px; font-weight: 600; line-height: 1.3; text-align: center; white-space: nowrap; transform: translate(-50%, -50%); }
.sv-chart__gap-label b { font-size: clamp(15px, 1.6vw, 19px); font-weight: 700; font-variant-numeric: tabular-nums; }
.sv-chart__ticks { position: relative; height: 22px; margin: 8px 6px 0 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.sv-chart__ticks span { position: absolute; top: 0; white-space: nowrap; transform: translateX(-50%); }
.sv-chart__ticks span:last-child { transform: translateX(-100%); }

/* ---------- what it means ---------- */
.sv-eq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 1200px) {
  .sv-eq { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sv-eq:has(> [hidden]) { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* no price to share: three across */
}
.sv-eq__i { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 18px 20px 20px; border-radius: var(--r-md); background: var(--mist); }
.sv-eq__k { color: var(--muted); font-size: 13px; font-weight: 600; }
.sv-eq__v { font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sv-eq__s { color: #3c3f44; font-size: 13.5px; line-height: 1.4; }
.sv-eq__pair { display: flex; flex-wrap: wrap; gap: 4px 16px; color: #3c3f44; font-size: 13px; }
.sv-eq__pair > span { display: grid; }
.sv-eq__pair b { color: var(--ink); font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.sv-eq__pair .is-ev b { color: var(--ok); }
.sv-eq__i--co2 .sv-eq__v { color: var(--ok); }

.sv-cta { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 560px) { .sv-cta .btn { flex: 1 1 100%; white-space: normal; text-align: center; } }

/* ---------- how we count ---------- */
.sv-how { padding-bottom: 96px; }
.sv-how > * { max-width: 880px; }
.sv-how h2 { margin-bottom: 14px; font-size: clamp(22px, 2.4vw, 28px); }
.sv-how ul { display: grid; gap: 10px; padding-left: 20px; color: #2c2e31; font-size: 15px; list-style: disc; }
.sv-how a { color: inherit; text-underline-offset: 2px; }
.sv-src { margin-top: 18px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.sv-src + .sv-src { margin-top: 8px; }
.sv-how .linklike { color: var(--graphite); font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 420px) {
  .sv-form, .sv-chart { padding: 20px 16px; }
  .sv-eq__i { padding: 14px; }
  .sv-eq__v { font-size: 26px; }
  .sv-eq__pair b { font-size: 22px; }
}

/* without JS: the answer for the defaults; the inputs would do nothing */
html:not(.js) .sv-form { display: none; }
html:not(.js) .sv { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "receipts" "chart" "eq" "cta"; grid-template-rows: none; }

/* the lead dialog: the item on one line, the calculation under it */
.lead__item { white-space: pre-line; }
