/* Clean, text-light layout in the style of Tesla's app: big image, big numbers,
   short labels. body[data-brand] swaps the accent palette. */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #ffffff;
  --bg-alt: #f5f6f7;
  --hero-bg: #f2f3f4;
  --text: #171a20;
  --muted: #5c5e62;
  --line: #e3e4e6;
  --primary: #0b6e69;
  --primary-hover: #095a56;
  --primary-text: #ffffff;
  --radius: 8px;
  --btn-radius: 6px;
}
body[data-brand="tesla"] {
  --hero-bg: #f4f4f4;
  --primary: #3e6ae1;
  --primary-hover: #3457b1;
  --btn-radius: 4px;
}
/* Rivian configurator language: white, black pill buttons, big rounded cards,
   amber only as a small accent. */
body[data-brand="rivian"] {
  --bg: #ffffff;
  --bg-alt: #f5f5f5;
  --hero-bg: #f5f5f5;
  --text: #000000;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --primary: #000000;
  --primary-hover: #2b2b2b;
  --primary-text: #ececec;
  --accent: #f5a623;
  --radius: 16px;
  --btn-radius: 999px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.5em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
p { margin: 0 0 1em; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
.narrow { max-width: 760px; }
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.muted { color: var(--muted); }
.fine { font-size: 0.78rem; color: var(--muted); margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 56px; }
/* The header never wraps: the logo is the only item that shrinks. Its size
   scales with the screen, and app.js (fitHeader) steps it down further until
   the bar fits; an ellipsis is the last resort. */
.logo { font-weight: 600; text-decoration: none; letter-spacing: 0.04em; text-transform: uppercase; font-size: clamp(0.72rem, 3.6vw, 0.9rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.topbar-inner > :not(.logo) { flex-shrink: 0; }
.topbar-inner summary, .topbar-inner .call { white-space: nowrap; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 0.88rem; font-weight: 500; padding: 6px 12px; border-radius: var(--btn-radius); }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(0, 0, 0, 0.05); }
.call { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 0.88rem; font-weight: 500; }
.call-icon { display: none; width: 20px; height: 20px; fill: currentColor; }

/* Hero */
.hero { background: var(--hero-bg); }
.hero-head { text-align: center; padding-top: 36px; padding-bottom: 16px; }
.eyebrow { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: 8px; }
.hero-sub { color: var(--muted); margin: 0; }
.hero-media { max-width: 1000px; margin: 0 auto; aspect-ratio: 2.2 / 1; max-height: 50vh; overflow: hidden; border-radius: var(--radius); }
.hero-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 20px; padding-bottom: 28px; flex-wrap: wrap; }
.hero-ctas { display: flex; gap: 10px; align-items: center; }

/* Market hub: brand picker */
.picker { background: var(--hero-bg); padding: 48px 0 40px; text-align: center; }
.picker h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: 8px; }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; text-align: left; }
.pick { position: relative; display: flex; flex-direction: column; background: var(--bg); border-radius: 10px; overflow: hidden; text-decoration: none; transition: box-shadow 0.2s ease, transform 0.2s ease; }
.pick:hover { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1); transform: translateY(-2px); }
.pick:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pick-img { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.pick-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pick-text { display: flex; flex-direction: column; padding: 16px 18px 18px; }
.pick-text strong { font-size: 1.3rem; font-weight: 500; letter-spacing: -0.01em; }
.pick-text span { font-size: 0.85rem; color: var(--muted); }
.pick .arrow { position: absolute; right: 18px; bottom: 20px; font-size: 1.1rem; }
.pick:hover .arrow { transform: translateX(3px); }
.picker-skip { margin: 24px 0 0; font-size: 0.9rem; color: var(--muted); }
.link-btn { font: inherit; color: var(--text); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.specs-row { justify-content: space-between; }

/* Big-number spec rows */
.specs { display: flex; gap: 36px; margin: 0; }
.specs div { min-width: 0; }
.specs dt { font-size: 1.6rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.specs dd { margin: 2px 0 0; font-size: 0.8rem; color: var(--muted); }
.specs-sm dt { font-size: 1.3rem; }

/* Buttons + ZIP bar */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 22px; font: inherit; font-size: 0.92rem; font-weight: 500; text-decoration: none; border-radius: var(--btn-radius); border: 0; cursor: pointer; transition: background-color 0.2s ease; white-space: nowrap; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: rgba(0, 0, 0, 0.06); color: var(--text); }
.btn-ghost:hover { background: rgba(0, 0, 0, 0.1); }
.zip-bar { display: flex; gap: 6px; }
.zip-bar input { width: 130px; height: 44px; padding: 0 14px; font: inherit; border: 1px solid var(--line); border-radius: var(--btn-radius); background: #fff; color: var(--text); }

/* Compare */
.compare { margin-top: 20px; border-top: 1px solid var(--line); }
.compare-row { display: grid; grid-template-columns: 140px repeat(3, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.compare-row [role="rowheader"] { color: var(--muted); font-size: 0.85rem; }
.compare-head { font-weight: 500; font-size: 1rem; }

/* Price panel */
.price-panel { margin-top: 20px; background: var(--bg); border-radius: var(--radius); padding: 28px; }
.tabs { display: inline-grid; grid-auto-flow: column; background: var(--bg-alt); border-radius: var(--btn-radius); padding: 3px; }
.tabs button { font: inherit; font-size: 0.85rem; font-weight: 500; border: 0; background: transparent; color: var(--muted); padding: 8px 16px; border-radius: calc(var(--btn-radius) - 1px); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.price-main { margin: 24px 0 20px; }
.price-value { display: block; font-size: clamp(2.8rem, 7vw, 4rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.price-label { display: block; color: var(--muted); font-size: 0.88rem; margin-top: 6px; }
.more { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 14px; }
.more summary { cursor: pointer; font-size: 0.88rem; font-weight: 500; }
.breakdown { margin-top: 12px; font-size: 0.9rem; }
.breakdown .row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; }
.breakdown .row > span:last-child { white-space: nowrap; }
.breakdown small { display: block; color: var(--muted); }
.breakdown .total { border-top: 1px solid var(--line); font-weight: 500; }
.inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; margin-top: 14px; }

/* Flow */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: f; }
.flow li { counter-increment: f; border-top: 2px solid var(--text); padding-top: 12px; }
.flow li::before { content: "0" counter(f); display: block; font-size: 0.75rem; color: var(--muted); }
.flow strong { display: block; font-size: 1.15rem; font-weight: 500; }
.flow span { color: var(--muted); font-size: 0.88rem; }

/* Proof */
.proof { display: grid; grid-template-columns: auto 1fr; gap: 16px 48px; align-items: center; }
/* "Your installer" card in the proof section: name, then the installer's
   Google rating; the whole card links to their Google listing. */
.installer-card { display: flex; flex-direction: column; min-width: 220px; padding: 18px 22px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; }
a.installer-card { transition: border-color 0.15s ease; }
a.installer-card:hover { border-color: var(--text); }
a.installer-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.installer-eyebrow { font-size: 0.72rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.installer-name { font-size: 1.35rem; font-weight: 500; letter-spacing: -0.01em; margin: 2px 0 10px; }
.installer-rating { display: flex; align-items: center; gap: 10px; }
.installer-score { font-size: 1.6rem; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.stars { color: #e8a000; letter-spacing: 2px; }
.installer-reviews { margin-top: 6px; font-size: 0.9rem; color: var(--primary); }
a.installer-card:hover .installer-reviews { text-decoration: underline; }
.quote { margin: 0; }
.quote blockquote { margin: 0; font-size: 1.3rem; letter-spacing: -0.01em; }
.quote figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.chips { grid-column: 1 / -1; list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 0.82rem; padding: 6px 12px; border-radius: 999px; background: var(--bg); }

/* Guides */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.section-head a { font-size: 0.9rem; text-decoration: none; color: var(--muted); }
.guide-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.guide-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; background: var(--bg-alt); border-radius: var(--radius); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.section-alt .guide-card { background: var(--bg); }
.guide-card:hover .arrow { transform: translateX(3px); }
.arrow { transition: transform 0.2s ease; color: var(--muted); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: "+"; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { color: var(--muted); margin: 8px 0 0; }
.also { margin-top: 24px; font-size: 0.9rem; color: var(--muted); }

/* Article */
.article { padding: 40px 0 64px; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }
.crumbs a { text-decoration: none; }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.key-facts { background: var(--bg-alt); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0 32px; justify-content: space-between; }
.article section { margin-bottom: 32px; }
.article h2 { font-size: 1.35rem; }
.article p, .article li { color: #33363b; }
body[data-brand="rivian"] .article p, body[data-brand="rivian"] .article li { color: #2b2b2b; }
.article ul { padding-left: 20px; }
.t { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin-bottom: 8px; }
.t th, .t td { text-align: left; padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.t th { font-weight: 500; color: var(--muted); font-size: 0.82rem; }
/* Wide tables (county permit lists) scroll sideways on phones instead of widening the page. */
.t-scroll { overflow-x: auto; margin-bottom: 8px; }
.t-scroll .t { min-width: 560px; margin-bottom: 0; }
.cta-box { background: var(--hero-bg); border-radius: var(--radius); padding: 24px; margin: 40px 0; }
.related-h { font-size: 1.1rem; }
.legal-draft { border: 1px solid #e0b252; background: #fdf6e6; border-radius: var(--radius); padding: 12px 16px; margin: 16px 0 32px; font-size: 0.88rem; }
.legal blockquote { margin: 12px 0; padding: 10px 16px; border-left: 3px solid var(--primary); background: var(--bg-alt); font-size: 0.92rem; }
.footer-legal a { color: inherit; }

/* Footer */
.footer { padding: 48px 0 96px; background: var(--bg-alt); font-size: 0.88rem; }
.footer-cols { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 32px; margin-bottom: 24px; }
.footer-cols a { display: block; text-decoration: none; color: var(--muted); padding: 3px 0; }
.footer-cols a:hover { color: var(--text); }
.footer-h { font-size: 0.85rem; font-weight: 600; letter-spacing: 0; margin-bottom: 10px; }
.credits a { color: var(--muted); }

/* Quote sheet */
.sheet { border: 0; padding: 0; border-radius: 12px; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); background: var(--bg); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
.sheet::backdrop { background: rgba(0, 0, 0, 0.45); }
.sheet form { padding: 20px 24px 24px; }
.sheet-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.progress { flex: 1; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 33%; background: var(--primary); transition: width 0.3s ease; }
.sheet-close { border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 1.4rem; font-weight: 500; letter-spacing: -0.02em; padding: 0; margin-bottom: 16px; }
.step { display: none; }
.step.is-active { display: block; }
.sheet label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 12px; }
.sheet input:not([type="checkbox"]):not([type="radio"]), .sheet select, .inputs input, .inputs select {
  display: block; width: 100%; margin-top: 4px; height: 44px; padding: 0 12px;
  font: inherit; font-size: 1rem; color: var(--text); background: #fff;
  border: 1px solid var(--line); border-radius: var(--btn-radius);
}
.inputs label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
[aria-invalid="true"] { border-color: #c0392b !important; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--bg-alt); padding: 3px; border-radius: var(--btn-radius); margin-bottom: 18px; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 9px 4px; font-size: 0.82rem; font-weight: 500; color: var(--muted); border-radius: calc(var(--btn-radius) - 1px); cursor: pointer; }
.seg input:checked + span { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); }
.sheet .btn-primary { width: 100%; }
.step-actions { display: flex; gap: 8px; }
.step-actions .btn-primary { flex: 1; }
.consent { display: flex !important; gap: 10px; align-items: flex-start; font-size: 0.72rem !important; line-height: 1.45; }
.consent input { flex: none; margin-top: 2px; }
.consent-links { font-size: 0.72rem; color: var(--muted); margin: -4px 0 12px 26px; }
.hp { position: absolute; left: -9999px; }
.price-preview { background: var(--bg-alt); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; font-size: 0.82rem; }
.price-preview strong { display: block; font-size: 1.8rem; font-weight: 500; letter-spacing: -0.02em; }
.form-error { color: #c0392b; font-size: 0.85rem; margin: 10px 0 0; }
.step-done h2 { font-size: 1.5rem; }

.sticky-cta { display: none; }

/* Mobile */
@media (max-width: 860px) {
  .nav { display: none; }
  .topbar-inner { justify-content: space-between; }
  .picker { padding: 28px 0 28px; }
  .picks { grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
  .pick { flex-direction: row; align-items: center; }
  .pick-img { flex: 0 0 42%; aspect-ratio: 4 / 3; }
  .pick-text { padding: 12px 36px 12px 16px; }
  .pick-text strong { font-size: 1.15rem; }
  .pick .arrow { bottom: auto; top: 50%; transform: translateY(-50%); }
  .pick:hover .arrow { transform: translate(3px, -50%); }
  .specs-row { flex-wrap: wrap; row-gap: 16px; }
  .specs-row div { flex: 0 0 45%; }
  .hero-foot { flex-direction: column; align-items: stretch; gap: 18px; }
  .specs { justify-content: space-between; gap: 12px; }
  .specs dt { font-size: 1.3rem; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn-ghost { display: none; }
  .zip-bar input { flex: 1; width: auto; min-width: 0; }
  .compare-row { grid-template-columns: repeat(3, 1fr); gap: 4px 10px; font-size: 0.85rem; }
  .compare-row [role="rowheader"] { grid-column: 1 / -1; font-size: 0.75rem; }
  .compare-head { font-size: 0.85rem; }
  .compare-head > span:first-child { display: none; }
  .price-panel { padding: 20px; }
  .tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
  .tabs button { padding: 8px 4px; font-size: 0.8rem; }
  .inputs { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: 1fr 1fr; }
  .proof { grid-template-columns: 1fr; }
  .guide-cards { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  .sticky-cta { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
  .sticky-cta .btn { width: 100%; }
  .sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 14px 14px 0 0; max-height: 92dvh; }
}
@media (max-width: 520px) {
  .wrap { padding-inline: 16px; }
  .topbar-inner { gap: 10px; }
  .hero-head { padding-top: 24px; }
  .hero-media { aspect-ratio: 4 / 3; max-height: 34vh; border-radius: 0; }
  .key-facts { padding: 16px; gap: 12px; }
  .t { font-size: 0.82rem; }
  .t th, .t td { padding-right: 6px; }
  .key-facts dt { font-size: 1.15rem; }
}

/* Utility picker in the price panel */
.util-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.util-label { font-size: 0.85rem; color: var(--muted); }
.seg-inline { display: inline-grid; grid-auto-flow: column; grid-template-columns: none; margin: 0; }
.seg-inline span { padding: 7px 14px; }
.util-help { font-size: 0.85rem; color: var(--muted); }
.sources ul { padding-left: 20px; font-size: 0.88rem; }
.sources h2 { font-size: 1.1rem; }
@media (max-width: 860px) {
  .seg-inline { display: grid; grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .seg-inline span { padding: 8px 4px; font-size: 0.78rem; }
}

/* Tesla-app style charging calculator */
.calc-wrap { max-width: 760px; text-align: center; }
.calc .tabs { margin-top: 12px; }
.calc .tabs button { min-width: 110px; }
.calc-img { margin: 24px auto 8px; max-width: 560px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); }
.calc-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.calc-out { display: flex; justify-content: center; gap: 72px; margin: 24px 0 28px; }
.calc-out dt { font-size: clamp(2.2rem, 5vw, 2.8rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.calc-out dd { margin: 6px 0 0; font-size: 0.85rem; color: var(--muted); }
.calc-controls { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px 20px; align-items: end; text-align: left; }
.calc-controls > label > span { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.calc-controls select, .calc-controls input[type="number"] { width: 100%; height: 44px; padding: 0 12px; font: inherit; color: var(--text); background: var(--bg-alt); border: 0; border-radius: var(--btn-radius); }
.calc-miles { display: grid; grid-template-columns: 1fr 76px; grid-template-rows: auto auto; gap: 0 12px; align-items: center; }
.calc-miles > span { grid-column: 1 / -1; }
.calc-miles input[type="range"] { width: 100%; accent-color: var(--primary); }
.calc-check { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.88rem; }
.calc-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.calc-check.is-disabled { color: var(--muted); }
.calc-check.is-disabled span::after { content: " (not offered by this utility)"; }
.calc-payback { margin: 20px 0 16px; font-size: 0.95rem; min-height: 1.4em; }
.calc-cta { width: auto; min-width: 280px; }
.calc-more { margin: 20px auto 0; max-width: 520px; text-align: left; }
.calc-more summary { cursor: pointer; font-size: 0.85rem; color: var(--muted); text-align: center; }
.calc-more .inputs { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) {
  .calc-out { gap: 40px; }
  .calc-controls { grid-template-columns: 1fr 1fr; }
  .calc-miles { grid-column: 1 / -1; }
  .calc-cta { width: 100%; min-width: 0; }
}

/* Design studio: configurator-style top of page (Tesla design language by default) */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 440px; align-items: start; }
.studio-media { position: sticky; top: 56px; height: calc(100vh - 56px - 76px); min-height: 420px; display: flex; align-items: center; justify-content: center; padding: 24px 32px; background: var(--bg); }
.studio-media img { width: 100%; height: 100%; max-height: 640px; object-fit: cover; border-radius: var(--radius); }
.studio-panel { padding: 40px 24px 48px; }
.studio-head { text-align: center; margin-bottom: 24px; }
.studio-head h1 { font-size: 1.75rem; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 6px; }
.studio-head p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.studio-head .u { text-decoration: underline; text-underline-offset: 3px; color: var(--text); }
.utabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.utabs button { flex: 1; font: inherit; font-size: 0.95rem; font-weight: 500; background: none; border: 0; padding: 12px 0; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.utabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.spec-box { background: var(--bg-alt); border-radius: var(--radius); padding: 16px; }
.spec-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 4px 16px; }
.spec-row dt { font-size: 1.35rem; font-weight: 500; letter-spacing: -0.02em; }
.spec-row dt small { font-size: 0.8rem; margin-left: 2px; }
.spec-row dd { margin: 2px 0 0; font-size: 0.78rem; color: var(--muted); }
.opts { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.opt { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color 0.15s ease; }
.opt:hover { border-color: var(--muted); }
.opt.is-selected { border: 2px solid var(--text); padding: 15px 17px; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt input:focus-visible ~ .opt-main { outline: 2px solid var(--primary); outline-offset: 4px; }
.opt-main { display: flex; flex-direction: column; min-width: 0; }
.opt-main strong { font-weight: 500; font-size: 0.95rem; }
.opt-main span { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.opt-price { font-size: 0.9rem; font-weight: 500; white-space: nowrap; }
.opt.is-muted { opacity: 0.45; }
.opt.is-muted:hover { opacity: 0.7; }
.spec-row .is-na dt { color: var(--muted); }
.spec-row .is-na small { display: none; }
.studio-check { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.studio-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.studio-h { font-size: 1.15rem; font-weight: 500; text-align: center; margin: 36px 0 14px; }
.studio-link { display: block; text-align: center; font-size: 0.85rem; color: var(--muted); margin-top: 10px; }
.studio-included { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; }
.studio-included li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.studio-included li::before { content: "✓"; margin-right: 10px; color: var(--muted); }
.studio-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 16; background: var(--bg); box-shadow: 0 -1px 0 var(--line), 0 -8px 24px rgba(0, 0, 0, 0.06); }
.studio-bar-inner { max-width: 1440px; margin: 0 auto; height: 76px; padding: 0 24px calc(env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: flex-end; gap: 24px; }
.studio-sum { display: flex; flex-direction: column; text-align: right; }
.studio-total { font-size: 1.35rem; font-weight: 500; letter-spacing: -0.01em; }
.studio-total-label { font-size: 0.78rem; color: var(--muted); }
.studio-bar .btn { min-width: 180px; height: 40px; }
body[data-studio] { padding-bottom: 76px; }
body[data-studio] .sticky-cta { display: none !important; }
body[data-studio] .footer { padding-bottom: 48px; }
@media (max-width: 960px) {
  .studio { grid-template-columns: 1fr; }
  .studio-media { position: static; height: auto; min-height: 0; padding: 0; }
  .studio-media img { aspect-ratio: 4 / 3; height: auto; max-height: 42vh; border-radius: 0; }
  .studio-panel { padding: 24px 16px 32px; }
  .studio-bar-inner { justify-content: space-between; padding: 0 16px; }
  .studio-sum { text-align: left; }
  .studio-bar .btn { min-width: 0; padding: 0 24px; }
}

/* Studio: Rivian configurator variant */
.studio[data-style="rivian"] .studio-media img { border-radius: 24px; background: var(--bg-alt); }
.studio[data-style="rivian"] .studio-head { text-align: left; }
.studio[data-style="rivian"] .studio-head .crumbs { margin-bottom: 14px; }
.studio[data-style="rivian"] .studio-head .crumbs span { color: var(--muted); }
.studio[data-style="rivian"] .studio-head h1 { font-size: clamp(2.2rem, 4vw, 2.75rem); letter-spacing: -0.02em; margin-bottom: 8px; }
.spec-line { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 6px !important; color: var(--text) !important; font-size: 0.95rem !important; }
.spec-line span { color: var(--line); }
.est-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 8px; }
.est-title { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; margin: 0 0 12px; }
.est-card dl { display: flex; justify-content: space-between; gap: 12px; margin: 0; }
.est-card dt { font-size: 0.8rem; color: var(--muted); }
.est-card dd { margin: 2px 0 0; font-size: 1.35rem; font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; }
.studio[data-style="rivian"] .studio-h { text-align: left; font-size: 1.3rem; margin-top: 32px; }
.studio[data-style="rivian"] .spec-box { background: none; padding: 0; }
.studio[data-style="rivian"] .opt { border-radius: var(--radius); padding: 18px 20px; }
.studio[data-style="rivian"] .opt.is-selected { padding: 17px 19px; }
.studio[data-style="rivian"] .studio-link { text-align: left; }
.itemized { font-size: 0.92rem; }
.itemized .row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; }
.itemized .row.sub span:first-child { padding-left: 16px; color: var(--muted); }
.itemized .row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-weight: 500; font-size: 1rem; }
body[data-brand="rivian"] .studio-bar .btn { height: 52px; min-width: 200px; font-size: 1rem; }
body[data-brand="rivian"] .stars { color: var(--accent); }
@media (max-width: 960px) {
  .studio[data-style="rivian"] .studio-media { padding: 12px 12px 0; }
  .studio[data-style="rivian"] .studio-media img { border-radius: 20px; }
  .est-card dd { font-size: 1.1rem; }
}
@media (max-width: 960px) {
  .studio-sum { flex: 1; min-width: 0; }
  .studio-total-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body[data-brand="rivian"] .studio-bar .btn { min-width: 0; height: 48px; padding: 0 28px; }
}

/* Charging calculator: Rivian configurator variant */
.calc[data-style="rivian"] .calc-wrap { text-align: left; max-width: 820px; }
.calc[data-style="rivian"] h2 { font-size: clamp(1.9rem, 4vw, 2.5rem); letter-spacing: -0.02em; }
.calc[data-style="rivian"] .calc-img { margin: 24px 0 16px; max-width: none; border-radius: 24px; }
.calc[data-style="rivian"] .calc-out { justify-content: flex-start; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 24px; }
.calc[data-style="rivian"] .calc-out div { flex: 1; }
.calc[data-style="rivian"] .calc-out div + div { border-left: 1px solid var(--line); padding-left: 20px; }
.calc[data-style="rivian"] .calc-out dt { font-size: clamp(1.8rem, 4vw, 2.3rem); font-weight: 500; }
.calc[data-style="rivian"] .calc-out dd { order: -1; }
.calc[data-style="rivian"] .calc-out div { display: flex; flex-direction: column; }
.calc[data-style="rivian"] .calc-controls select,
.calc[data-style="rivian"] .calc-controls input[type="number"] { border-radius: 999px; padding: 0 16px; }
.calc[data-style="rivian"] .calc-controls input[type="range"] { accent-color: #000; }
.calc[data-style="rivian"] .calc-check { justify-content: flex-start; }
.calc[data-style="rivian"] .calc-cta { height: 52px; min-width: 240px; font-size: 1rem; }
.calc[data-style="rivian"] .calc-more { margin-left: 0; }
.calc[data-style="rivian"] .calc-more summary { text-align: left; }
@media (max-width: 860px) {
  .calc[data-style="rivian"] .calc-cta { min-width: 0; }
  .calc[data-style="rivian"] .calc-out { padding: 16px; }
  .calc[data-style="rivian"] .calc-out div + div { padding-left: 16px; }
}

/* EV switcher: header dropdown next to the site name. Shapes follow the brand
   theme (Tesla: 4px corners, Rivian: pills and 16px cards). */
.ev-switch { position: relative; padding-left: 16px; border-left: 1px solid var(--line); }
.ev-switch summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 14px; border-radius: var(--btn-radius); background: var(--bg-alt); font-size: 0.88rem; font-weight: 500; cursor: pointer; user-select: none; transition: background-color 0.15s ease; }
.ev-switch summary::-webkit-details-marker { display: none; }
.ev-switch summary:hover { background: color-mix(in srgb, var(--bg-alt) 85%, var(--text)); }
.ev-switch summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ev-chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
.ev-switch[open] .ev-chev { transform: rotate(180deg); }
.ev-menu { position: absolute; top: calc(100% + 10px); left: 16px; z-index: 40; width: 320px; padding: 8px; background: var(--bg); border-radius: calc(var(--radius) + 4px); box-shadow: 0 0 0 1px var(--line), 0 16px 40px rgba(0, 0, 0, 0.14); animation: ev-in 0.16s ease-out; }
@keyframes ev-in { from { opacity: 0; transform: translateY(-4px); } }
.ev-menu-h { margin: 0; padding: 8px 10px 6px; font-size: 0.78rem; color: var(--muted); }
.ev-item { display: grid; grid-template-columns: 64px 1fr 20px; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius); text-decoration: none; transition: background-color 0.15s ease; }
.ev-item:hover, .ev-item:focus-visible, .ev-item[aria-current="page"] { background: var(--bg-alt); outline: none; }
.ev-thumb { display: block; width: 64px; height: 44px; overflow: hidden; border-radius: calc(var(--radius) * 0.6); background: var(--bg-alt); }
.ev-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ev-text { display: flex; flex-direction: column; min-width: 0; }
.ev-text strong { font-size: 0.92rem; font-weight: 500; }
.ev-text small { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-check { width: 18px; height: 18px; fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.ev-item[aria-current="page"] .ev-check { opacity: 1; }
@media (max-width: 860px) {
  .call-num { display: none; }
  .call-icon { display: block; }
  .ev-switch { padding-left: 12px; }
  .ev-switch summary { height: 32px; font-size: 0.85rem; }
  .ev-menu { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .ev-menu { animation: none; } .ev-chev { transition: none; } }

/* Price bar: price + chevron toggles a Tesla-style breakdown above the bar */
.bar-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.bar-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
.bar-chev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
.bar-toggle[aria-expanded="true"] .bar-chev { transform: rotate(180deg); }
.studio-total-label { white-space: nowrap; }
.bar-details { position: absolute; bottom: 100%; right: max(24px, calc((100vw - 1440px) / 2 + 24px)); width: 380px; max-height: 70vh; overflow: auto; margin-bottom: 8px; padding: 16px 20px; background: var(--bg); border-radius: calc(var(--radius) + 4px); box-shadow: 0 0 0 1px var(--line), 0 -8px 40px rgba(0, 0, 0, 0.14); font-size: 0.9rem; animation: ev-in 0.16s ease-out; }
.bar-details-h { font-weight: 500; margin: 0 0 8px; }
.bar-details .row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
.bar-details .row > span:last-child { white-space: nowrap; text-align: right; }
.bar-details .row small { display: block; font-size: 0.76rem; color: var(--muted); }
.bar-details .row.sub span:first-child { color: var(--muted); padding-left: 12px; }
.bar-details .row.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 11px; font-weight: 500; }
.bar-details .row.credit span:last-child { color: #1a7f37; font-weight: 500; }
.bar-details .row.net { font-weight: 500; }
.bar-details .fine { margin: 10px 0 0; }
body[data-brand="rivian"] .bar-details .row.credit span:last-child { color: #2f6b3a; }
@media (max-width: 960px) {
  .bar-details { left: 12px; right: 12px; width: auto; }
}

/* Outbound document links (utility application guides) */
.doc-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.doc-link { display: inline-block; font-size: 0.88rem; font-weight: 500; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.bar-details .doc-link { margin-top: 10px; font-size: 0.82rem; }

/* Header actions: Guides menu + call */
.top-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 10px; border-radius: var(--btn-radius); font-size: 0.88rem; font-weight: 500; cursor: pointer; user-select: none; transition: background-color 0.15s ease; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary:hover, .nav-menu[open] summary { background: var(--bg-alt); }
.nav-menu summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.nav-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.call { height: 34px; padding: 0 10px; border-radius: var(--btn-radius); }
.call:hover { background: var(--bg-alt); }
.menu-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; width: 460px; padding: 16px 18px 14px; background: var(--bg); border-radius: calc(var(--radius) + 4px); box-shadow: 0 0 0 1px var(--line), 0 16px 40px rgba(0, 0, 0, 0.14); animation: ev-in 0.16s ease-out; }
.menu-h { margin: 0 0 10px; font-size: 0.78rem; color: var(--muted); }
.menu-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
.menu-group:first-child { grid-row: span 2; }
.menu-group-h { margin: 4px 0 4px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.menu-panel a { display: block; padding: 7px 8px; margin: 0 -8px; border-radius: var(--radius); font-size: 0.9rem; text-decoration: none; transition: background-color 0.15s ease; }
.menu-panel a:hover, .menu-panel a:focus-visible, .menu-panel a[aria-current="page"] { background: var(--bg-alt); outline: none; }
.menu-panel a.menu-all { margin-top: 8px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 11px; font-weight: 500; }
.menu-panel a.menu-all:hover { background: none; text-decoration: underline; }
@media (max-width: 860px) {
  .nav-menu-label { display: none; }
  .nav-menu summary { padding: 0 8px; }
  .call { padding: 0 8px; }
  .menu-panel { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 160px); overflow: auto; }
}
@media (max-width: 420px) { .menu-groups { grid-template-columns: 1fr; } .menu-group:first-child { grid-row: auto; } }
@media (prefers-reduced-motion: reduce) { .menu-panel { animation: none; } }
.done-next { font-size: 1.02rem; font-weight: 500; }

/* Header on the narrowest phones (after the 860px rules so it wins): tighter
   spacing leaves more room for the logo before fitHeader has to shrink it. */
@media (max-width: 360px) {
  .topbar-inner { gap: 6px; }
  .logo { letter-spacing: 0.01em; }
  .ev-switch { padding-left: 6px; }
  .ev-switch summary { padding: 0 8px 0 10px; }
  .nav-menu summary, .call { padding: 0 6px; }
}
