/* Shared colour and label policy. Load after page and glass-control styles.
   Preserve layout, glass materials, native controls and engineering artwork.
   !important is limited to the explicit colour/decoration policy because the
   retained page families contain more-specific legacy heading/control rules. */
:root {
  --pev-foreground: #e9eef2;
  --pev-secondary: #b8c3cc;
  --pev-link: #79c9ff;
  --pev-link-hover: #acddff;
  --pev-action: #17a2ff;
  --pev-action-hover: #48b5ff;
  --pev-action-ink: #04121e;
  --pev-brand: #67e8a6;
  --pev-brand-ink: #b3f0cf;
  --pev-brand-border: #579c79;
  --pev-selected: #163629;
  --pev-selected-counter: #10291f;
  --pev-success: #67e8a6;
  --pev-error: #ffb6b6;
  --pev-warning: #f4c87a;
  --text: var(--pev-foreground);
  --muted: var(--pev-secondary);
  --accent: var(--pev-action);
  /* Legacy secondary accent was used for unrelated links, prices and labels. */
  --accent-2: var(--pev-link);
  --accent-3: var(--pev-error);
}

/* Neutral heading default; explicit complete brand phrases are selected below. */
body :is(h1, h2, h3, h4, h5, h6),
body :is(h1, h2, h3, h4, h5, h6) :is(span, em, strong),
body .capability-name {
  color: var(--pev-foreground) !important;
  -webkit-text-fill-color: currentColor;
  text-decoration: none !important;
}
body :is(.pev-stat-number, .current-price, .product-price, .shop-live-price) {
  color: var(--pev-foreground) !important;
  -webkit-text-fill-color: currentColor;
  background-image: none;
}

/* Plain labels; no ornamental dashes or underlines. Brand labels are selected below. */
body :is(.pev-eyebrow, .hero-eyebrow, .eyebrow, .tag, .solution-kicker,
  .impact-kicker, .shop-eyebrow, .banner-eyebrow, .legal-kicker,
  .home-service-label, .home-step-number, .fleet-visual figcaption span,
  .fleet-considerations dt, .impact-status, .impact-cycle) {
  color: var(--pev-secondary) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}
body :is(.pev-eyebrow, .hero-eyebrow, .eyebrow, .tag, .solution-kicker,
  .impact-kicker, .shop-eyebrow, .banner-eyebrow, .legal-kicker)::before,
body :is(.pev-eyebrow, .hero-eyebrow, .eyebrow, .tag, .solution-kicker,
  .impact-kicker, .shop-eyebrow, .banner-eyebrow, .legal-kicker)::after,
body .about-section h2::after,
body .services-subtitle::after,
body .services-main-title span::after,
body .partnership-title::after,
body .careers-title::after,
body .contact-title::after {
  content: none !important;
  display: none !important;
}
body .mv-underline { display: none !important; }

/* Green identifies the brand voice, white carries the surrounding prose.
   These labels name a subject or section; values and delivery status stay neutral. */
body.pev-refined :is(.pev-eyebrow, .hero-eyebrow, .tag, .solution-kicker, .impact-kicker,
  .shop-eyebrow, .banner-eyebrow, .legal-kicker, .home-service-label),
body.studio-home .eyebrow {
  color: var(--pev-brand) !important;
}
/* Explicit phrase map, not a blanket span/em rule:
   home: Energy Systems; impact: lower-carbon future.;
   solution heroes: the complete named service, not an isolated word. */
body.original-home #hero-heading > span,
body.impact-page .impact-hero-copy > h1 > span,
body .solution-hero #solution-heading {
  color: var(--pev-brand) !important;
}


/* The existing authored heading emphasis is part of the green/white brand.
   Keep a named selector map: prose, figures, prices and diagram keys stay neutral. */
body.original-home :is(#about-heading, #services-heading, #start-heading,
  #impact-heading, #contact-heading) > span,
body.original-home .home-service-content > h3 > span,
body.original-home :is(.home-careers, .home-partnerships) > h2 > span,
body.impact-page :is(#approach-title, #lifecycle-title, #investment-title,
  #progress-title) > span,
body :is(#solution-overview-heading, #related-solutions-heading, #fleet-heading) > span,
body.studio-home #hero-heading > em {
  color: var(--pev-brand) !important;
}
/* Page and section landmarks add rhythm where the original heading has no span. */
body :is(.mv-header, .job-header) > h2,
body .about-section > h2,
body .card-header > h1,
body #categoryBannerTitle,
body #productsTitle,
body #productTitle {
  color: var(--pev-brand) !important;
}
/* Product categories use the secondary brand tone; footer groups remain white. */
body :is(.product-category, .meta-badge, .mv-num) {
  color: var(--pev-brand-ink) !important;
}
/* The same selected/hover convention covers the mobile and submenu navigation. */
body .nav-menu .dropdown > li > a:is(:hover, :focus-visible, .active, [aria-current='page']),
body .nav-menu > li > a:not(.shop-btn)[aria-current='page'] {
  color: var(--pev-brand-ink) !important;
  background-color: var(--pev-selected) !important;
}

/* Inline prose links remain identifiable without relying on hue alone.
   Navigation, buttons, image links and cards retain their own geometry. */
body :is(.home-text-link, .home-secondary-link, .solution-secondary-link,
  .fleet-assessment-link, .contact-draft-link, .text-link, .caption-link),
body :is(.impact-pathways, .impact-sources, .impact-brief-contact, .rd-faq,
  .legal-copy, .legal-help, .footer-links, .footer-contact-info) a,
body .impact-actions > a:not(.btn),
body .shop-detail-navigation > a,
body :is(main, footer) :is(p, li, dd) > a:not([class]) {
  color: var(--pev-link) !important;
  text-decoration: underline !important;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  text-decoration-skip-ink: auto;
}
body :is(.home-text-link, .home-secondary-link, .solution-secondary-link,
  .fleet-assessment-link, .contact-draft-link, .text-link, .caption-link):is(:hover, :focus-visible),
body :is(.impact-pathways, .impact-sources, .impact-brief-contact, .rd-faq,
  .legal-copy, .legal-help, .footer-links, .footer-contact-info) a:is(:hover, :focus-visible),
body .impact-actions > a:not(.btn):is(:hover, :focus-visible),
body .shop-detail-navigation > a:is(:hover, :focus-visible),
body :is(main, footer) :is(p, li, dd) > a:not([class]):is(:hover, :focus-visible) {
  color: var(--pev-link-hover) !important;
}

/* Blue remains the action/focus colour; green identifies the selected context. */
body :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--pev-link) !important;
  outline-offset: 4px;
}
body :is(input, select, textarea)::placeholder { color: #9babb8; opacity: 1; }
body :is(input, select, textarea)[aria-invalid='true'] { border-color: var(--pev-error); }
body .nav-menu > li > a:not(.shop-btn):is(:hover, :focus-visible, .active, [aria-expanded='true']) {
  color: var(--pev-brand-ink) !important;
  background-color: var(--pev-selected) !important;
}
body .nav-menu > li > a:not(.shop-btn)::after { background: var(--pev-brand); }
body :is(.tab-btn.active, .categories-list li.active, .dropdown-content li.active, .shop-button[aria-pressed='true']) {
  color: var(--pev-brand-ink) !important;
  background: var(--pev-selected) !important;
  border-color: var(--pev-brand-border);
}
body :is(.categories-list, .dropdown-content) .category-count {
  color: var(--pev-secondary);
  background: #0f151c;
}
body :is(.categories-list, .dropdown-content) li.active .category-count {
  color: var(--pev-brand-ink) !important;
  background: var(--pev-selected-counter) !important;
  border-color: var(--pev-brand-border) !important;
}
body .active-category-display .category-name { color: var(--pev-brand-ink); }
body .pev-service-tab[aria-selected='true'] {
  color: var(--pev-brand-ink) !important;
  background: var(--pev-selected) !important;
  border-color: var(--pev-brand-border);
}

/* Primary actions use a dark label on blue; glass radius/blur/shadows remain. */
body :is(.btn-primary, .read-btn, .submit-btn, .apply-btn, .cta-button,
  .shop-btn, .product-quote-btn, .catalogue-quote-link, .primary-button,
  .checkout-btn, .add-to-cart-btn):not(:disabled) {
  color: var(--pev-action-ink) !important;
  background: var(--pev-action) !important;
}
body :is(.btn-primary, .read-btn, .submit-btn, .apply-btn, .cta-button,
  .shop-btn, .product-quote-btn, .catalogue-quote-link, .primary-button,
  .checkout-btn, .add-to-cart-btn):not(:disabled):hover {
  background: var(--pev-action-hover) !important;
}
body .add-to-cart-btn.added:not(:disabled) {
  color: var(--pev-action-ink) !important;
  background: var(--pev-success) !important;
}

/* Informational output is neutral: a price, estimate or message is not success. */
body :is(.shop-form-result, .shop-dialog-status, .availability, .shop-availability) {
  color: var(--pev-foreground) !important;
}
body .availability {
  background: #17232f;
  border-color: #536377;
}
/* Existing contact delivery uses status-success while sending as well as for
   its receipt. Keep this shared state neutral until the source distinguishes it. */
body .status-success {
  color: var(--pev-foreground);
  background: #17232f;
  border-color: #536377;
}
body :is(.status-error, .customer-error) { color: var(--pev-error); }
body .status-error { background: #34222a; border-color: #b87380; }

/* Customer pages share the policy while keeping their private workflow intact. */
body:has(#customer-account) { color: var(--pev-foreground); }
body:has(#customer-account) a { color: var(--pev-link); }
body:has(#customer-account) a:is(:hover, :focus-visible) { color: var(--pev-link-hover); }
body:has(#customer-account) :is(input, select, textarea) { color: var(--pev-foreground); }
body:has(#customer-account) button:not(:disabled) {
  color: var(--pev-link-hover); background: #234869;
}
body:has(#customer-account) button:not(:disabled):hover { background: #2b5277; }

/* Retain system-colour accessibility overrides from the underlying theme. */
@media (forced-colors: active) {
  :root {
    --pev-foreground: CanvasText; --pev-secondary: CanvasText;
    --pev-link: LinkText; --pev-link-hover: LinkText;
    --pev-action: ButtonFace; --pev-action-hover: ButtonFace;
    --pev-action-ink: ButtonText; --pev-selected: Canvas;
    --pev-success: CanvasText; --pev-error: CanvasText;
    --pev-brand: CanvasText; --pev-brand-ink: CanvasText;
    --pev-brand-border: CanvasText; --pev-selected-counter: Canvas;
  }
  body :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline-color: Highlight !important; }
}
@media print {
  :root { --pev-foreground: #000; --pev-secondary: #333; --pev-link: #000; --pev-link-hover: #000; --pev-brand: #000; --pev-brand-ink: #000; }
}

/* White footer headings are shared across all public page templates. */
body .footer-section > h3 { color: var(--pev-text, #edf5f8) !important; }
