/* ===== Charging cost (2026-11-05): after the bento. Pick a car and a charger, drag the battery to set the charge,
   read the bill. Option D (car photo + living cells) is live; option E (photo in a living ring) is kept in cost.js
   and switches on with data-v="e" on the section. Everything is scoped to .cost so nothing leaks into the page. ===== */
.cost { --c-cement: #F2F3F1; --c-line: #E6E8E5; --c-hover: #E9EBE8; --c-fill: #3BD67F; --c-live: #1E9E5A; --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  position: relative; padding: clamp(96px, 14vh, 160px) clamp(20px, 4vw, 56px); background: #fff; color: var(--ink);
  transition: background-color .6s var(--e), color .6s var(--e); }
.cost .tnum { font-variant-numeric: tabular-nums; }
.cost__sub { max-width: 34em; margin: 0; font-size: 17px; line-height: 1.55; color: var(--graphite); text-wrap: balance; }
.cost__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px clamp(24px, 4vw, 56px); align-items: start; max-width: 1200px; margin: 0 auto; }

/* controls */
.cost .calc-field { margin: 0 0 32px; padding: 0; border: 0; min-width: 0; }
.cost .calc-field legend { padding: 0; margin-bottom: 12px; font-size: 13px; font-weight: 500; color: var(--graphite); }
.cost .calc-cars { display: flex; flex-direction: column; gap: 8px; }
.cost .calc-car { position: relative; display: grid; grid-template-columns: 60px minmax(0, 1fr) auto 22px; align-items: center; gap: 14px;
  min-height: 64px; padding: 0 16px 0 14px; border-radius: 14px; cursor: pointer; background: var(--c-cement); font-family: var(--app);
  transition: background-color .2s var(--e); }
.cost .calc-car input, .cost .calc-ch input { position: absolute; opacity: 0; pointer-events: none; }
.cost .calc-car__img { display: block; width: 60px; }
.cost .calc-car__img img { display: block; width: 60px; height: auto; transition: transform .45s var(--ease-spring); }
.cost .calc-car:hover .calc-car__img img { transform: translateX(2px); }
.cost .calc-car__n { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.cost .calc-car__m { font-size: 13px; color: var(--graphite); white-space: nowrap; }
.cost .calc-car__tick { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #C7CBC6; color: transparent;
  transition: background-color .2s var(--e), color .2s var(--e), box-shadow .2s var(--e), transform .3s var(--ease-spring); }
.cost .calc-car:hover { background: var(--c-hover); }
.cost .calc-car:has(input:checked) .calc-car__tick { background: var(--ink); color: #fff; box-shadow: none; transform: scale(1.04); }
.cost .calc-car:has(input:focus-visible), .cost .calc-ch:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.cost .calc-chs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cost .calc-ch { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 13px; cursor: pointer; border-radius: 14px;
  background: var(--c-cement); font-family: var(--app); transition: box-shadow .2s var(--e), background-color .2s var(--e); }
.cost .calc-ch:hover { background: var(--c-hover); }
.cost .calc-ch b { font-size: 22px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.cost .calc-ch b small { font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--graphite); }
.cost .calc-ch > span { font-size: 13px; }
.cost .calc-ch .calc-ch__d { font-size: 12px; color: var(--graphite); }
/* selected charger: a white card with a hairline and the same check the car rows use, small, in the corner */
.cost .calc-ch:has(input:checked) { }   /* selected charger keeps the same fill, no white or border; only the check (::after) shows (2026-11-05) */
.cost .calc-ch::after { content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
  opacity: 0; transform: scale(.6); transition: opacity .2s var(--e), transform .35s var(--ease-spring); }
.cost .calc-ch:has(input:checked)::after { opacity: 1; transform: scale(1); }

/* the card */
.cost .bc { padding: clamp(22px, 2.8vw, 34px); border-radius: 24px; background: var(--c-cement); font-family: var(--app); transition: background-color .6s var(--e); }
.cost .bc-hd { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 8px; }
.cost .bc-car { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.cost .bc-car b { font-size: 16px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.cost .bc-car span { font-size: 13px; color: var(--graphite); white-space: nowrap; }
.cost .bc-hint { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--graphite); }
.cost .bc-hint svg { color: var(--mute); }
/* charger tag. Optical padding: the bolt glyph sits ~7px from top, bottom and left; text side +3px */
.cost .pw-tag { display: inline-flex; align-items: center; gap: 3px; height: 28px; margin: 0; padding: 0 10px 0 4px; border-radius: 8px; background: #fff;
  font: 600 12.5px/1 Overpass, sans-serif; color: var(--ink); white-space: nowrap; }
.cost .pw-tag span { padding-top: 2px; }
.cost .pw-tag svg { flex: none; color: var(--c-live); }

/* knobs */
.cost .kn { position: absolute; z-index: 2; width: 14px; margin: 0; padding: 0; transform: translate(-50%, -50%); border: 1.5px solid var(--ink); border-radius: 7px;
  background: #fff; cursor: grab; touch-action: none; transition: transform .2s var(--ease-spring); }
.cost .kn::before { content: ""; position: absolute; left: 50%; top: 28%; bottom: 28%; width: 1.5px; margin-left: -.75px; border-radius: 1px; background: #A9B0AC; }
.cost .kn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.cost .is-drag .kn { cursor: grabbing; }
.cost .kn__l { position: absolute; left: 50%; padding: 4px 7px 3px; border-radius: 6px; background: var(--ink); color: #fff; font: 700 12px/1 Overpass, sans-serif;
  letter-spacing: .01em; white-space: nowrap; transform: translateX(-50%); pointer-events: none; }

/* readouts */
.cost .bc-out { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 28px; margin-top: 4px; }
.cost .bc-big { display: flex; align-items: baseline; gap: 8px; margin: 0; line-height: .86; }
.cost .bc-big span { font: 500 26px var(--display); color: var(--graphite); }
.cost .bc-big b { font: 500 clamp(56px, 6.2vw, 84px) var(--display); letter-spacing: -.045em; }
.cost .bc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.cost .bc-stats div { padding: 0 0 4px 14px; border-left: 1px solid #DCDFDB; }
.cost .bc-stats dt { margin-bottom: 8px; font-size: 12px; color: var(--graphite); }
.cost .bc-stats dd { margin: 0; font: 700 16px/1 Overpass, sans-serif; letter-spacing: -.005em; white-space: nowrap; }

/* D: real car photo + living cells */
.cost .dv { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; margin: 22px 0 34px; }
.cost .cells { position: relative; display: flex; flex-direction: column-reverse; gap: 4px; height: 300px; padding: 6px; border-radius: 14px; background: #fff;
  box-shadow: inset 0 0 0 1.2px var(--ink); touch-action: none; user-select: none; cursor: ns-resize; }
.cost .cells__cap { position: absolute; left: 50%; top: -9px; width: 24px; height: 6px; margin-left: -12px; border-radius: 3px 3px 0 0; background: var(--ink); }
.cost .cell { position: relative; flex: 1; overflow: hidden; border-radius: 4px; background: #EDEFEC; transform-origin: center; will-change: transform; }
.cost .cell i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; }
.cost .c-had { background: #CBD0CB; }
.cost .c-add { background: var(--c-fill); }
.cost .bc--d .kn { left: 50%; width: 82px; height: 14px; }
.cost .bc--d .kn::before { left: 28%; right: 28%; top: 50%; bottom: auto; width: auto; height: 1.5px; margin: -.75px 0 0; }
.cost .bc--d .kn__l { left: calc(100% + 8px); top: 50%; transform: translateY(-50%); }
.cost .cells__hint { position: absolute; left: 0; right: 0; top: calc(100% + 10px); display: flex; justify-content: center; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 500; color: var(--graphite); pointer-events: none; }
.cost .cells__hint svg { color: var(--mute); }
.cost .photo { position: relative; margin: 0; text-align: center; }
.cost .photo img { position: relative; z-index: 1; display: block; width: min(100%, 470px); height: auto; margin: 0 auto; transform-origin: 50% 88%; }
.cost .photo__floor { position: absolute; left: 12%; right: 12%; bottom: 4px; height: 22px; border-radius: 50%; background: rgba(13,18,16,.08); filter: blur(6px); }

/* E (kept for later): real car photo inside a living ring, numbers below */
.cost .ring-wrap { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; margin: 10px 0 0; }
.cost .ring { position: relative; aspect-ratio: 1; width: min(100%, 400px); margin-bottom: calc(min(100%, 400px) * -.14); touch-action: none; user-select: none; cursor: grab; }
.cost .ring > svg:first-child { display: block; width: 100%; height: 100%; }
.cost .tk { stroke: #D6DAD5; stroke-width: 3.2; stroke-linecap: round; transition: stroke .15s; }
.cost .tk.is-had { stroke: #A9B0AC; } .cost .tk.is-add { stroke: var(--c-fill); }
.cost .ring-mid { position: absolute; left: 0; right: 0; top: 18%; text-align: center; pointer-events: none; }
.cost .ring-pct { display: flex; justify-content: center; align-items: baseline; gap: 6px; margin: 0; font: 500 clamp(34px, 4vw, 50px)/1 var(--display); letter-spacing: -.04em; }
.cost .ring-pct span { font-size: .5em; color: #A9B0AC; transform: translateY(-.2em); }
.cost .ring-pct i { font-style: normal; font-size: .5em; color: var(--graphite); margin-left: -2px; }
.cost .ring-sub { position: absolute; left: 0; right: 0; bottom: 21%; margin: 0; text-align: center; pointer-events: none; font: 700 13px Overpass, sans-serif; color: var(--c-live); }
.cost .ring-photo { position: absolute; left: 50%; top: 56%; width: 60%; height: auto; translate: -50% -50%; pointer-events: none; }
.cost .bc--e .kn { width: 24px; height: 24px; border-radius: 50%; border-width: 2px; box-shadow: 0 1px 2px rgba(13,18,16,.12); }
.cost .bc--e .kn::before { display: none; }
.cost .bc--e .kn::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--ink); }
.cost .bc--e .kn__l { display: none; }

@media (max-width: 1024px) { .cost__grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .cost .bc-out { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .cost .bc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 0; }
  .cost .bc-hint { display: none; }
  .cost .dv { grid-template-columns: 52px minmax(0, 1fr); } .cost .cells { height: 220px; } .cost .bc--d .kn { width: 66px; }
  .cost .pw-tag__long { display: none; } .cost .bc-car { flex-wrap: wrap; row-gap: 2px; }
  .cost .calc-chs { grid-template-columns: minmax(0, 1fr); }
  .cost .calc-ch { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding-right: 44px; }
  .cost .calc-ch::after { top: 50%; margin-top: -9px; }
  .cost .calc-car__m { display: none; }
  .cost .calc-car { grid-template-columns: 56px minmax(0, 1fr) 22px; }
  .cost .calc-car__img, .cost .calc-car__img img { width: 56px; }
}

/* page-wide dark theme (while the dark bento is mid-screen): the section's top edge melts into the bento */
html.dark .cost { background-color: #0A0C0B; color: #fff; }
html.dark .cost .bc, html.dark .cost .calc-car, html.dark .cost .calc-ch { background: #151918; }
html.dark .cost .cost__sub, html.dark .cost legend { color: rgba(255,255,255,.6); }

/* readouts, one clean row (2026-11-05, Raahi session): the price shrinks a step, the four stats size to their content
   with even gaps and never wrap, and small dots sit between them (on the value line) instead of vertical rules */
.cost .bc-out:not(.bc-out--stack) { grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 2.4vw, 32px); align-items: end; }
.cost .bc-out:not(.bc-out--stack) .bc-big b { font-size: clamp(48px, 4.8vw, 68px); }
.cost .bc-out:not(.bc-out--stack) .bc-big span { font-size: 22px; }
.cost .bc-out:not(.bc-out--stack) .bc-stats { display: flex; justify-content: space-between; align-items: flex-end; gap: 0; padding-bottom: 6px; }
.cost .bc-out:not(.bc-out--stack) .bc-stats div { position: relative; padding: 0; border: 0; }
.cost .bc-out:not(.bc-out--stack) .bc-stats div + div::before { content: ""; position: absolute; left: calc(-1 * var(--sg, 14px) - 2px); bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: #C9CDCA; }
.cost .bc-out:not(.bc-out--stack) .bc-stats { --sg: clamp(9px, 1.1vw, 16px); }
.cost .bc-stats dt { white-space: nowrap; }
@media (max-width: 1100px) { .cost .bc-out:not(.bc-out--stack) { grid-template-columns: minmax(0, 1fr); } }
.cost .bc-out:not(.bc-out--stack) .bc-stats { --sg: clamp(12px, 1.3vw, 18px); justify-content: flex-end; gap: calc(var(--sg) * 2); }   /* fixed gaps, so each dot sits dead centre between two stats */

/* white cards (2026-11-05, Raahi session, user ask): the section sits on the same white → #FAFAFA band as benefits
   and testimonials; car rows, charger cards and the battery panel go white with the page's hairline; grey stays
   only for inner details (empty cells, the power tag) */
.cost { background: #fff; background-image: linear-gradient(#FFFFFF 0%, #FAFAFA 28%, #FAFAFA 88%, #FFFFFF 100%); }
.cost .calc-car, .cost .calc-ch, .cost .bc { background: #fff; box-shadow: 0 0 0 1px rgba(13,18,16,.055), 0 1px 2px rgba(13,18,16,.02); }
.cost .calc-car:hover, .cost .calc-ch:hover { background: #fff; box-shadow: 0 0 0 1px rgba(13,18,16,.09), 0 6px 18px -12px rgba(13,18,16,.16); }
.cost .calc-car__tick { background: #fff; }
.cost .pw-tag { background: #F2F3F1; }
.cost .cells { box-shadow: inset 0 0 0 1.2px var(--ink); }
html.dark .cost { background-image: none; }

/* dark (2026-11-05, Raahi session): the battery calculator is now part of the dark run after the bento.
   Same tiles as the bento (#151918), hairlines in white, text in white/60 */
html.dark .cost .bc, html.dark .cost .calc-car, html.dark .cost .calc-ch { background: #151918; box-shadow: 0 0 0 1px rgba(255,255,255,.06); }
html.dark .cost .calc-car:hover, html.dark .cost .calc-ch:hover { background: #1B201E; box-shadow: 0 0 0 1px rgba(255,255,255,.1); }
html.dark .cost .calc-car__tick { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.28); }
html.dark .cost .calc-car:has(input:checked) .calc-car__tick { background: #fff; color: var(--ink); box-shadow: none; }
html.dark .cost .calc-ch::after { filter: invert(1); }   /* ink circle + white check → white circle + dark check */
html.dark .cost .calc-car__n, html.dark .cost .calc-ch, html.dark .cost .bc-car b, html.dark .cost .bc-big b, html.dark .cost .bc-stats dd { color: #fff; }
html.dark .cost .calc-car span, html.dark .cost .calc-ch__d, html.dark .cost .bc-car span, html.dark .cost .bc-big span, html.dark .cost .bc-stats dt, html.dark .cost .bc-hint { color: rgba(255,255,255,.6); }
html.dark .cost .pw-tag { background: rgba(255,255,255,.08); color: #fff; }
html.dark .cost .cells { background: #0E1110; box-shadow: inset 0 0 0 1.2px rgba(255,255,255,.7); }
html.dark .cost .cells__cap { background: rgba(255,255,255,.7); }
html.dark .cost .cell { background: #232826; } html.dark .cost .c-had { background: #3A403D; }
html.dark .cost .bc-out:not(.bc-out--stack) .bc-stats div + div::before { background: rgba(255,255,255,.25); }
html.dark .cost .photo__floor { background: rgba(0,0,0,.5); }
.cost .calc-car, .cost .calc-ch, .cost .bc, .cost .cell, .cost .cells { transition: background-color .6s var(--e), box-shadow .6s var(--e), color .6s var(--e); }
html.dark .cost .calc-car__tick { color: transparent; } html.dark .cost .calc-car:has(input:checked) .calc-car__tick { color: var(--ink); }
html.dark .cost .calc-car span.calc-car__tick { color: transparent; } html.dark .cost .calc-car:has(input:checked) span.calc-car__tick { color: var(--ink); }   /* beat the muted-text rule for spans */
/* dark, battery parts (battery-card session): the % chips flip to white so they don't vanish on the dark card,
   the drag hint lifts, and the dormant ring (option E) gets dark ticks so a later swap works in dark too */
html.dark .cost .kn__l { background: #fff; color: var(--ink); }
html.dark .cost .cells__hint, html.dark .cost .cells__hint svg { color: rgba(255,255,255,.55); }
html.dark .cost .tk { stroke: #2C322F; } html.dark .cost .tk.is-had { stroke: #5A615D; }
html.dark .cost .ring-pct span { color: rgba(255,255,255,.35); } html.dark .cost .ring-pct i { color: rgba(255,255,255,.6); }

/* mobile (2026-11-05, Raahi session): stats wrap into a 2×2 grid instead of overflowing; drag knobs get a 44px tap area */
@media (max-width: 760px) {
  .cost .bc-out:not(.bc-out--stack) .bc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; justify-content: stretch; }
  .cost .bc-out:not(.bc-out--stack) .bc-stats div + div::before { display: none; }
}
.cost .bc:not(.bc--e) .kn::after { content: ""; position: absolute; inset: -15px -10px; }


/* readout row v2 (2026-11-05): one row when it fits; when long values (e.g. "7 h 29 min") would collide with the
   price, sections.js adds .is-stack and the stats drop below the price as one even line */
.cost .bc-out:not(.bc-out--stack) .bc-stats { --sg: clamp(8px, 1vw, 14px); min-width: 0; }
.cost .bc-out.is-stack:not(.bc-out--stack) { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.cost .bc-out.is-stack:not(.bc-out--stack) .bc-stats { justify-content: space-between; }
