/* Follow the visitor's operating-system appearance on GreenLeaf public pages. */
@media (prefers-color-scheme: dark) {
  html:has(.greenleaf-site) {
    color-scheme: dark;
    background: #101713;
  }

  body:has(.greenleaf-site) {
    background: #101713 !important;
    color: #e6eee8;
  }

  body:has(.greenleaf-site) main,
  body:has(.greenleaf-site) .greenleaf-site,
  body:has(.greenleaf-site) :is(.metrics, .intro-section, .process-section, .model-section, .impact-section, .impact-copy, .governance-section, .terms-section, .faq-section, .closing-section, .page-hero, .detail-page, .detail-section, .calculator-section, .editorial-wrap, .article-body, .teaser-request, .redwood-panel, .story-band, .story-section, .feature-split, .feature-copy) {
    background-color: #101713 !important;
    color: #e6eee8;
  }

  body:has(.greenleaf-site) :is(.site-header, .site-nav) {
    background: #121e17 !important;
    border-color: #2d4335;
  }

  body:has(.greenleaf-site) .site-footer.finished-footer {
    background: #121e17 !important;
    border-top: 1px solid #2d4335;
    color: #e4eee7;
  }

  body:has(.greenleaf-site) .finished-footer .footer-identity p,
  body:has(.greenleaf-site) .finished-footer .footer-disclaimer {
    color: #bbc9c0;
  }

  body:has(.greenleaf-site) .finished-footer .footer-location {
    color: #9eb3a3;
  }

  body:has(.greenleaf-site) .finished-footer .footer-links > h2 {
    color: #acd391;
  }

  body:has(.greenleaf-site) .finished-footer .footer-links a {
    color: #d4e0d7;
  }

  body:has(.greenleaf-site) .finished-footer .footer-bottom {
    border-color: #34493b;
    background: #0d1b13;
  }

  body:has(.greenleaf-site) .brand,
  body:has(.greenleaf-site) .brand-name,
  body:has(.greenleaf-site) .site-nav a,
  body:has(.greenleaf-site) .nav-cta,
  body:has(.greenleaf-site) .menu-toggle {
    color: #e2ece5;
  }

  body:has(.greenleaf-site) .brand-mark {
    background: #214331;
  }

  body:has(.greenleaf-site) .brand-logo {
    content: url("/site/greenleaf-logo-white.png");
  }

  body:has(.greenleaf-site) .menu-toggle {
    border-color: #53695a;
  }

  body:has(.greenleaf-site) :is(.hero, .page-hero) {
    background-color: #111d16 !important;
    color: #eff5ef;
  }

  body:has(.greenleaf-site) :is([class~="bg-white"], [class~="bg-rw-cream"], [class~="bg-rw-paper"], [class~="bg-slate-50"], [class~="bg-gray-50"], .rw-card) {
    background-color: #17251d !important;
    color: #e4eee7;
  }

  body:has(.greenleaf-site) :is([class~="border-rw-gray"], [class~="border-rw-line"]) {
    border-color: #354b3c !important;
  }

  body:has(.greenleaf-site) [class*="text-rw-navy"] {
    color: #e2ece5 !important;
  }

  body:has(.greenleaf-site) [class*="text-rw-charcoal"] {
    color: #bdcbc2 !important;
  }

  body:has(.greenleaf-site) :is(.hero h1, .hero-lede, .hero-note, .hero-bottom, .page-hero h1, .page-hero p, .intro-content h2, .model-copy h2, .impact-copy h2, .governance-heading h2, .terms-heading h2, .faq-heading h2, .closing-section h2, .detail-heading h2, .story-content h2, .article-body h2, .editorial-wrap h1, .editorial-card h2, .redwood-intro h2) {
    color: #e9f1eb !important;
  }

  body:has(.greenleaf-site) .feature-copy h2 {
    color: #fff !important;
  }

  body:has(.greenleaf-site) :is(.section-kicker, .intro-label, .story-label, .detail-heading > span, .editorial-card span, .article-meta, .redwood-card .story-label) {
    color: #a8cf8d !important;
  }

  body:has(.greenleaf-site) :is(.hero-lede, .hero-note, .intro-content p, .model-copy > p, .impact-copy p, .governance-heading > p, .terms-heading p, .faq-heading p, .closing-section > p, .story-content p, .feature-copy p, .detail-prose, .detail-note, .detail-facts p, .step-grid p, .contact-grid p, .contact-grid a, .banking-card p, .banking-card dt, .terms-grid span, .editorial-wrap p, .editorial-card p, .article-body, .article-reviewer, .redwood-card p, .redwood-address) {
    color: #bbc9c0 !important;
  }

  body:has(.greenleaf-site) :is(.site-nav a:hover, .footer-links a:hover, .text-link, .inline-arrow, .editorial-card strong, .article-body a, .redwood-card a, .contact-grid a, .footer-bottom-main a, .legal-footer-links a) {
    color: #b8dc9e !important;
  }

  body:has(.greenleaf-site) .site-nav a[aria-current="page"],
  body:has(.greenleaf-site) .footer-links > span,
  body:has(.greenleaf-site) .detail-jump a,
  body:has(.greenleaf-site) .next-links a,
  body:has(.greenleaf-site) .detail-table caption,
  body:has(.greenleaf-site) .faq-wrap summary::after,
  body:has(.greenleaf-site) .model-facts span,
  body:has(.greenleaf-site) .detail-facts span,
  body:has(.greenleaf-site) .risk-grid article > span,
  body:has(.greenleaf-site) .risk-footer > span,
  body:has(.greenleaf-site) .contact-grid article > span {
    color: #acd391 !important;
  }

  body:has(.greenleaf-site) :is(.essential-grid > a, .journey-grid article, .model-facts article, .detail-facts article, .detail-kpis > div, .step-grid article, .contact-grid article, .party-grid article, .risk-grid article, .calculator-controls, .calculator-card, .liquidity-callout, .model-card, .redwood-card, .editorial-card, .faq-wrap details, .source-alert, .banking-card, .calculator-method) {
    background: #17251d !important;
    border-color: #354b3c !important;
    color: #e2ece5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  }

  body:has(.greenleaf-site) :is(.essential-grid h3, .essential-grid p, .essential-grid strong, .journey-grid h3, .journey-grid p, .model-facts strong, .detail-facts strong, .detail-kpis strong, .step-grid h3, .contact-grid h3, .party-grid h3, .risk-grid h3, .faq-wrap summary, .editorial-card h2, .terms-grid strong, .calculator-controls label, .calculator-method summary, .source-alert strong) {
    color: #e4eee7 !important;
  }

  body:has(.greenleaf-site) :is(.essential-grid p, .journey-grid p, .risk-grid p, .faq-wrap details p, .editorial-wrap details p, .editorial-card p, .redwood-card p, .article-body, .detail-facts p, .step-grid p, .calculator-controls > p) {
    color: #bac9c0 !important;
  }

  body:has(.greenleaf-site) :is(.detail-section, .terms-grid, .terms-grid div, .detail-table th, .detail-table td, .detail-kpis, .risk-grid, .risk-grid article, .faq-wrap details, .editorial-wrap details, .source-alert, .calculator-controls, .calculator-method, .contact-grid article, .party-grid article, .essential-grid > a) {
    border-color: #34493b !important;
  }

  body:has(.greenleaf-site) :is(.detail-table tbody, .detail-table tbody tr, .detail-table tbody tr:nth-child(even), .calculator-table .total-row) {
    background: #17251d !important;
  }

  body:has(.greenleaf-site) .detail-table :is(th, td) {
    color: #e4eee7;
  }

  body:has(.greenleaf-site) .detail-table thead th {
    background: #164676 !important;
    color: #fff !important;
  }

  body:has(.greenleaf-site) :is(input:not([type="checkbox"]), select, textarea) {
    background: #101a14 !important;
    border-color: #526a59 !important;
    color: #eef5ef !important;
  }

  body:has(.greenleaf-site) input[type="checkbox"] {
    accent-color: #8abd5b;
  }

  body:has(.greenleaf-site) .preset-row button {
    background: #15231b;
    border-color: #516a58;
    color: #e3ede6;
  }

  body:has(.greenleaf-site) .preset-row button.active,
  body:has(.greenleaf-site) .preset-row button:hover {
    background: #164676;
    border-color: #164676;
    color: #fff;
  }

  body:has(.greenleaf-site) :is(.teaser-request, .closing-section) {
    background: #17251d !important;
  }

  body:has(.greenleaf-site) .developer-pill {
    background: #17251d;
    border-color: #5c8f49;
    color: #dce8df;
  }

  body:has(.greenleaf-site) .developer-pill strong {
    color: #b8dc9e;
  }

  body:has(.greenleaf-site) .cookie-notice {
    background: #17251d;
    border-color: #405944;
    color: #e4eee7;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .42);
  }

  body:has(.greenleaf-site) .cookie-notice p {
    color: #c1cec5;
  }

  body:has(.greenleaf-site) .cookie-notice a {
    color: #b8dc9e;
  }

  body:has(.greenleaf-site) .cookie-notice button.cookie-reject {
    border-color: #536d58;
    background: transparent;
    color: #cfe2d3;
  }

  body:has(.greenleaf-site) .legal-footer-links .cookie-preferences-link {
    color: #acd391;
  }

  body:has(.greenleaf-site) .whatsapp-float {
    border-color: #8abd5b;
    box-shadow: 0 10px 32px rgba(0, 0, 0, .42);
  }
}
