/* One shared theme layer for Resources content; light-mode styles stay in place. */
body.resource-page-theme.dark-mode .resources-theme-page { background: var(--theme-page); color: var(--theme-text); }
body.resource-page-theme.dark-mode .resources-theme-page :is(h1, h2, h3, h4, h5, h6, .head, .main-heading, .posted-blogs, .aside-heading) { color: var(--theme-heading); }
body.resource-page-theme.dark-mode .resources-theme-page :is(p, li, label, dt, dd, td, th, blockquote, figcaption, small, time, .para, .sub-para, .card-body, .accordion-body) { color: var(--theme-text); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.blue-clr, .blue-text, .text-blue, .link-clr, .blog-heading-link) { color: var(--theme-link) !important; }
body.resource-page-theme.dark-mode .resources-theme-page :is(.black-clr, .black-text-clr, .dark-text-clr, .dark-text, .grey-clr, .grey-clr-2, .grey-clr-3) { color: var(--theme-text) !important; }
body.resource-page-theme.dark-mode .resources-theme-page :is(.orange-clr, .orange-span-text, .yellow) { color: var(--theme-accent) !important; }
body.resource-page-theme.dark-mode .resources-theme-page :is(h1, h2, h3, h4) > span { color: inherit; }
body.resource-page-theme.dark-mode .resources-theme-page a:not([class*="btn"], [class*="button"], .common-signup-btn, .hero-apply-btn, .page-link) { color: var(--theme-link); }

/* Local stacking keeps image heroes and low-opacity circles visible. */
body.resource-page-theme.dark-mode .resources-theme-page :is(.inner-hero-section, .nyc-form-section, .referral-footer-nyc-section) { isolation: isolate; }
body.resource-page-theme.dark-mode .resources-theme-page :is(.section-bg-1, .company-history-div, .ps-trust, .ps-stories, .ps-benefits, .bfl-promo, .bfl-lead-options, .bfl-data-section, .bfl-targeting-section, .bfl-quality-section, .bfl-help-section, .bfl-process-section, .bfl-form-section, .bfl-calendar-section) { background: var(--theme-surface-alt); }
body.resource-page-theme.dark-mode .resources-theme-page .light-sky-bg { background: var(--theme-surface-alt) !important; }
body.resource-page-theme.dark-mode .resources-theme-page :is(.ps-featured, .ps-video-section, .bfl-overview, .bfl-partner-section) { background: var(--theme-page); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.ps-hero, .ps-cta, .bfl-hero, .bfl-buyer-section, .bfl-final-cta, .bfl-delivery-section) { background: var(--theme-surface-alt); }

/* Blog listings, articles, author/category cards and pagination. */
body.resource-page-theme.dark-mode .resources-theme-page :is(.blog-post, .each-categy-card, .author-side-div, .aside-links-box, .aside-heading, .blog-post-body, .blog-post-header, .blog-post-footer, .page-link) { border-color: var(--theme-border); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.blog-author-n-category, .blog-author-n-category > a, .author-side-div a) { color: var(--theme-link) !important; }
body.resource-page-theme.dark-mode .resources-theme-page .blog-post-body :is(p, span, li, div, h2, h3, h4)[style] { color: var(--theme-text) !important; background-color: transparent !important; }
body.resource-page-theme.dark-mode .resources-theme-page .blog-post-body a { color: var(--theme-link) !important; }
body.resource-page-theme.dark-mode .resources-theme-page .page-link { color: var(--theme-link); }
body.resource-page-theme.dark-mode .resources-theme-page .page-item.active .page-link { background: var(--theme-link); color: var(--theme-page); border-color: var(--theme-link); }
body.resource-page-theme.dark-mode .resources-theme-page .page-item.disabled .page-link { color: var(--theme-muted); background: var(--theme-surface-alt); }
body.resource-page-theme.dark-mode .resources-theme-page .blog-post-date :is(label, span) { color: var(--theme-on-accent); }

/* ISO, rewards, renewal and contact surfaces. */
body.resource-page-theme.dark-mode .resources-theme-page :is(.referral-form-div, .each-guidelines-div, .guidelines-inner-div, .div-payment, .partner-box-row .col, .partner-box-row .col:nth-child(even), .partner-box-row .col:nth-child(odd), .thank-you-contact-box) { background: var(--theme-surface); border-color: var(--theme-border); }
body.resource-page-theme.dark-mode .resources-theme-page--referral-center :is(.referal-form-border, hr) { border-color: var(--theme-border); }
body.resource-page-theme.dark-mode .resources-theme-page--referral-center .referral-form-div h4 { background: var(--theme-surface-alt); color: var(--theme-heading); }
body.resource-page-theme.dark-mode .resources-theme-page .iso-partner-hero-text .hero-head {
    color: var(--gray-980);
    text-shadow: -1px -1px 0 var(--white), 1px -1px 0 var(--white), -1px 1px 0 var(--white), 1px 1px 0 var(--white);
    -webkit-text-stroke: 1px var(--white);
}
body.resource-page-theme.dark-mode .resources-theme-page .iso-partner-hero-text .hero-head > span { color: var(--navy-240); }
body.resource-page-theme.dark-mode .resources-theme-page .iso-partner-hero-text .hero-para-2 { background: var(--theme-hero-label); color: var(--theme-text); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.hero-area, .img-div) { background-color: var(--theme-surface-alt); }
body.resource-page-theme.dark-mode .resources-theme-page .joseph-desc-text { color: var(--theme-text) !important; }
body.resource-page-theme.dark-mode .resources-theme-page .click-here-div.orange-bg :is(h3, p, a) { color: var(--theme-on-accent) !important; }

/* Partner stories and funding-lead content cards. */
body.resource-page-theme.dark-mode .resources-theme-page :is(.ps-stat-card, .ps-story-card, .ps-video-card, .ps-benefit-card, .ps-form, .bfl-side-card, .bfl-feature-card, .bfl-lead-card, .bfl-age-card, .bfl-data-card, .bfl-quality-card, .bfl-quality-note, .bfl-help-card, .bfl-audience-card, .bfl-audience-cta, .bfl-process-card, .bfl-process-cta, .bfl-partner-card, .bfl-benefit, .bfl-faq-item, .bfl-form-card, .bfl-calendar-card, .bfl-dashboard-card, .bfl-disclaimer) { background: var(--theme-surface); border-color: var(--theme-border); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.ps-pill:not(.ps-pill--dark), .ps-icon-box, .ps-benefit-icon, .bfl-badge:not(.bfl-badge--dark), .bfl-best, .bfl-note, .bfl-chip-select-control, .bfl-partner-badge, .bfl-dashboard-card > div:first-child, .bfl-dashboard-card > div:first-child > span) { background: var(--theme-surface-alt); color: var(--theme-link); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.ps-stat-card strong, .bfl-age-card > strong, .bfl-dashboard-row strong, .bfl-best strong) { color: var(--theme-link); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.ps-stat-card > span:last-child, .ps-story-card footer small, .bfl-age-card > span, .bfl-note--data span, .bfl-dashboard-row em.is-pending) { color: var(--theme-muted); }
body.resource-page-theme.dark-mode .resources-theme-page .bfl-dashboard-row em { color: var(--theme-success); }
body.resource-page-theme.dark-mode .resources-theme-page .bfl-audience-tabs .nav-link { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
body.resource-page-theme.dark-mode .resources-theme-page .bfl-audience-tabs .nav-link.active { background: var(--theme-link); color: var(--theme-page); }

/* Tables and accordions retain the existing structure and behavior. */
body.resource-page-theme.dark-mode .resources-theme-page table :is(th, td, tr, thead, tbody) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
body.resource-page-theme.dark-mode .resources-theme-page table :is(thead, tr:nth-child(even)) > * { background: var(--theme-surface-alt); }
body.resource-page-theme.dark-mode .resources-theme-page table tbody tr:hover > * { background: var(--blue-1360); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.accordion-button, .accordion-body, .accordion-collapse) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
body.resource-page-theme.dark-mode .resources-theme-page .accordion-button:not(.collapsed) { background: var(--theme-surface-alt); color: var(--theme-heading); }

/* Inputs, choices, consents and errors are themed without changing form contracts. */
body.resource-page-theme.dark-mode .resources-theme-page :is(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"], [type="button"]), select, textarea) { background: var(--theme-surface-alt); color: var(--theme-text); border: 1px solid var(--theme-input-border); color-scheme: dark; }
body.resource-page-theme.dark-mode .resources-theme-page :is(input, textarea)::placeholder { color: var(--theme-muted); opacity: 1; }
body.resource-page-theme.dark-mode .resources-theme-page select option { background: var(--theme-surface); color: var(--theme-text); }
body.resource-page-theme.dark-mode .resources-theme-page :is(input, select, textarea):focus-visible { outline: 2px solid var(--theme-link); outline-offset: 2px; border-color: var(--theme-link); box-shadow: none; }
body.resource-page-theme.dark-mode .resources-theme-page :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--theme-link); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.ps-consent, .bfl-consent, .bfl-choice, .bfl-choice span, .bfl-choice small, .bfl-choice strong, .ps-form small, .bfl-form-section small, .bfl-consent a) { color: var(--theme-text); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.bfl-choice, .bfl-consent-box) { background: var(--theme-surface-alt); border-color: var(--theme-input-border); }
body.resource-page-theme.dark-mode .resources-theme-page :is(label.error, .error-msg, .bfl-field-error, .bfl-form-feedback.is-error, .alert-danger) { color: var(--theme-error) !important; }
body.resource-page-theme.dark-mode .resources-theme-page :is(.alert-danger, .alert-success) { background: var(--theme-surface); border-color: currentColor; }
body.resource-page-theme.dark-mode .resources-theme-page :is(.alert-success, .bfl-form-feedback.is-success) { color: var(--theme-success); }
body.resource-page-theme.dark-mode .resources-theme-page :is(hr, .bfl-form-divider, .bfl-dashboard-row, .bfl-faq-item, .ps-story-card footer) { border-color: var(--theme-border); opacity: 1; }
body.resource-page-theme.dark-mode .resources-theme-page :is(a, button, [tabindex="0"]):focus-visible { outline: 3px solid var(--theme-link); outline-offset: 4px; }

/* Legacy utilities need explicit foregrounds on their existing button fills. */
body.resource-page-theme.dark-mode .resources-theme-page .blog-post-body .orange-bg-btn { color: var(--theme-on-accent) !important; }
body.resource-page-theme.dark-mode .resources-theme-page .blue-outline-btn { color: var(--theme-link); border-color: var(--theme-link); }
body.resource-page-theme.dark-mode .resources-theme-page .blue-outline-btn:is(:hover, :focus-visible) { background: var(--theme-link); color: var(--theme-page); }
body.resource-page-theme.dark-mode .resources-theme-page .blog-post-body :is(p, strong, b, i, em) { color: var(--theme-text) !important; }
body.resource-page-theme.dark-mode .resources-theme-page .div-payment { color: var(--theme-heading); }
body.resource-page-theme.dark-mode .resources-theme-page .text-decoration-underline { color: var(--theme-link) !important; }
body.resource-page-theme.dark-mode .resources-theme-page .bfl-faq-toggle { background: var(--theme-surface); color: var(--theme-heading); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.bfl-process-cta strong, .bfl-benefit strong, .bfl-inline-checks span, .bfl-consent-check span, .bfl-consent-check b) { color: var(--theme-text); }
body.resource-page-theme.dark-mode .resources-theme-page .bfl-form-group legend { color: var(--theme-link); }
body.resource-page-theme.dark-mode .resources-theme-page .bfl-partner-solutions li > span:first-child { color: var(--theme-link); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.bfl-badge--dark, .referral-get-ready-div > div, .bfl-note--data img) { background: var(--theme-surface-alt); color: var(--theme-text); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.bfl-form-divider, .contact-hero-hr) { background-color: var(--theme-border); border-color: var(--theme-border); }
body.resource-page-theme.dark-mode .resources-theme-page--referral-center hr { background-color: var(--theme-border); }
body.resource-page-theme.dark-mode .floating-free-quote-btn { color: var(--theme-on-accent); border-color: var(--theme-border); }

/* Long form labels and the ISO comparison remain contained on narrow screens. */
.resources-theme-page--referral-center form label { white-space: normal !important; max-width: 100%; overflow-wrap: anywhere; }
.resources-theme-page--iso-partners .table-responsive { max-width: 100%; }
@media (max-width: 767.98px) {
    .resources-theme-page--iso-partners .custom-container > .row { --bs-gutter-x: 20px; }
}

body.resource-page-theme.dark-mode .resources-theme-page .big-heading { color: var(--theme-heading); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.author-side-div, .single-blog-author-box) :is(p, span, div)[style] { color: var(--theme-text) !important; background-color: transparent !important; }
body.resource-page-theme.dark-mode .resources-theme-page .about-author-text { color: var(--theme-heading); }

/* Contrast corrections stay local to these pages in light mode as well. */
body.resource-page-theme:not(.dark-mode) .resources-theme-page .blog-post-body .orange-bg-btn,
body.resource-page-theme:not(.dark-mode) .resources-theme-page .blog-post-date label,
body.resource-page-theme:not(.dark-mode) .floating-free-quote-btn { color: var(--theme-on-accent) !important; }
body.resource-page-theme:not(.dark-mode) .resources-theme-page :is(.blog-author-n-cateogry label, .blog-author-n-category, .blog-author-n-category > a, .blog-author-n-category label, .ps-benefits .ps-section-heading > p, .bfl-section-heading > p, .bfl-partner-cta > small) { color: var(--blue-1360) !important; }
body.resource-page-theme:not(.dark-mode) .resources-theme-page :is(.bfl-age-card > span, .bfl-data-section .bfl-badge, .bfl-process-number, .bfl-partner-badge--gold) { color: var(--brand-blue); }
body.resource-page-theme:not(.dark-mode) .resources-theme-page .bfl-dashboard-row em:not(.is-pending) { color: var(--theme-success); }
body.resource-page-theme:not(.dark-mode) .resources-theme-page .aside-links-box .footer-latest-news-time { color: var(--white); }
body.resource-page-theme:not(.dark-mode) .resources-theme-page .twitter-tweet a { color: var(--brand-blue); }
body.resource-page-theme:not(.dark-mode) .resources-theme-page .about-author-text,
body.resource-page-theme:not(.dark-mode) .resources-theme-page .about-author-text > span { color: var(--brand-blue); }

/* Expanded dropdowns, selected choices and booking-dialog chrome. */
body.resource-page-theme.dark-mode .resources-theme-page :is(.bfl-chip-dropdown, .bfl-meet-modal-dialog) { background: var(--theme-surface); border-color: var(--theme-border); color: var(--theme-text); }
body.resource-page-theme.dark-mode .resources-theme-page .bfl-chip-option { color: var(--theme-text); }
body.resource-page-theme.dark-mode .resources-theme-page .bfl-chip-option:is(:hover, :focus-visible, .is-selected) { background: var(--theme-surface-alt); color: var(--theme-link); }
body.resource-page-theme.dark-mode .resources-theme-page .bfl-choice:has(input:checked) { background: var(--theme-surface-alt); border-color: var(--theme-link); box-shadow: inset 0 0 0 1px var(--theme-link); }
body.resource-page-theme.dark-mode .resources-theme-page .bfl-meet-modal-header { border-color: var(--theme-border); }
body.resource-page-theme.dark-mode .resources-theme-page .bfl-meet-modal-close { background: var(--theme-surface-alt); border-color: var(--theme-input-border); }
body.resource-page-theme.dark-mode .resources-theme-page .bfl-meet-modal-close::before,
body.resource-page-theme.dark-mode .resources-theme-page .bfl-meet-modal-close::after { background: var(--theme-text); }
body.resource-page-theme.dark-mode .resources-theme-page .bfl-form-divider::before { border-color: var(--theme-border); }
body.resource-page-theme.dark-mode .resources-theme-page .contact-call-us-text { color: var(--theme-heading) !important; }
body.resource-page-theme:not(.dark-mode) .resources-theme-page--renewals .orange-span-text { color: var(--theme-accent) !important; }
body.resource-page-theme:not(.dark-mode) .resources-theme-page--iso-partners :is(.text-blue, .table-area th) { color: var(--brand-blue); }
body.resource-page-theme:not(.dark-mode) .resources-theme-page--contact-funderial .contact-call-us-text a { color: var(--brand-blue); }
body.resource-page-theme:not(.dark-mode) .resources-theme-page--contact-funderial .click-here-heading { color: var(--theme-on-accent); }
body.resource-page-theme.dark-mode .resources-theme-page :is(.bfl-inline-checks, .bfl-google-meet-check) input:not(:checked) { background-color: var(--theme-surface-alt); border-color: var(--theme-input-border); }
body.resource-page-theme.dark-mode .business-funding-leads-page .bfl-note{border-color: var(--white-alpha-25);}

/* Keep yellow CTA copy dark and soften decorative rules on partner-lead cards. */
body.resource-page-theme.dark-mode .business-funding-leads-page .bfl-inline-cta :is(h3, p) { color: var(--black); }
body.resource-page-theme.dark-mode .business-funding-leads-page .bfl-age-card > p { border-color: var(--theme-border); }
body.resource-page-theme.dark-mode .business-funding-leads-page .bfl-dashboard-card {
    border: 1px solid var(--theme-border);
    box-shadow: 0 16px 48px var(--black-alpha-20);
}
body.resource-page-theme.dark-mode .business-funding-leads-page .bfl-dashboard-card > div:first-child,
body.resource-page-theme.dark-mode .business-funding-leads-page .bfl-dashboard-row { box-shadow: inset 0 -1px 0 var(--theme-border); }
body.resource-page-theme.dark-mode .business-funding-leads-page .bfl-dashboard-row:last-child { box-shadow: none; }
body.resource-page-theme.dark-mode .business-funding-leads-page .bfl-faq-symbol { color: var(--theme-link); }

/* Quiet outline buttons on the two partner pages, including interactive states. */
body.resource-page-theme.dark-mode :is(.partner-success-page .ps-btn--outline, .business-funding-leads-page .bfl-btn--outline-light) {
    background: transparent;
    border-color: var(--theme-input-border);
    color: var(--theme-heading);
}
body.resource-page-theme.dark-mode :is(.partner-success-page .ps-btn--outline, .business-funding-leads-page .bfl-btn--outline-light):is(:hover, :active) {
    background: var(--theme-border);
    border-color: var(--theme-input-border);
    color: var(--theme-heading);
}
body.resource-page-theme.dark-mode :is(.partner-success-page .ps-btn--outline, .business-funding-leads-page .bfl-btn--outline-light):focus-visible {
    outline: 2px solid var(--theme-input-border);
    outline-offset: 3px;
    box-shadow: none;
}

/* Treat each chip search as one input, without a second blue outline inside it. */
body.resource-page-theme.dark-mode .business-funding-leads-page .bfl-chip-select-control { border-color: var(--theme-input-border); }
body.resource-page-theme.dark-mode .business-funding-leads-page .bfl-chip-select.is-open .bfl-chip-select-control,
body.resource-page-theme.dark-mode .business-funding-leads-page .bfl-chip-select-control:focus-within {
    border-color: var(--theme-input-border);
    box-shadow: inset 0 0 0 1px var(--theme-input-border);
}
body.resource-page-theme.dark-mode .business-funding-leads-page .bfl-chip-select-control .bfl-chip-search:is(:focus, :focus-visible) {
    outline: 0 !important;
    outline-offset: 0;
    box-shadow: none !important;
}
