/* CustodyProviders.com V8.6 — global contrast & UI safety layer
   Final presentation layer. Content, SEO, data and behavior remain unchanged. */

:root{
  --v86-text:#172338;
  --v86-heading:#0b1f3a;
  --v86-muted:#52657a;
  --v86-link:#1d4ed8;
  --v86-line:#d8e2ee;
  --v86-soft:#f7f9fc;
  --v86-blue-soft:#eef5ff;
  --v86-dark:#071a2f;
  --v86-dark-muted:#d7e3f4;
}

/* ---------- Light-page safety baseline ---------- */
html body:not(.ca-page){
  color:var(--v86-text)!important;
  -webkit-text-fill-color:initial;
}
html body:not(.ca-page) main :where(h1,h2,h3,h4,h5,h6,strong,b,summary,legend){
  color:var(--v86-heading)!important;
  -webkit-text-fill-color:var(--v86-heading)!important;
  opacity:1!important;
}
html body:not(.ca-page) main :where(p,li,dd,dt,figcaption,.muted,.small,.lead,.provider-sub,.provider-description,.provider-meta,.filter-hint,.micro-note,.plan-note,.tier-note,.price-period,.price-subline){
  color:var(--v86-muted)!important;
  -webkit-text-fill-color:var(--v86-muted)!important;
  opacity:1!important;
}
html body:not(.ca-page) main a:not(.btn):not(.pill):not(.badge){
  color:var(--v86-link)!important;
  -webkit-text-fill-color:var(--v86-link)!important;
}

/* Labels were a recurring legacy-CSS collision. */
html body:not(.ca-page) main label,
html body:not(.ca-page) main label > span,
html body:not(.ca-page) main .filter-field > span,
html body:not(.ca-page) main .filter-field > label,
html body:not(.ca-page) main .filters-bar label,
html body:not(.ca-page) main .filters-bar label > span,
html body:not(.ca-page) main .filters-grid label,
html body:not(.ca-page) main .filters-grid label > span{
  color:#33445a!important;
  -webkit-text-fill-color:#33445a!important;
  opacity:1!important;
}

/* Light form controls: prevents dark legacy form rules leaking into light pages. */
html body:not(.ca-page) main :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
  background:#fff!important;
  color:var(--v86-text)!important;
  -webkit-text-fill-color:var(--v86-text)!important;
  border:1px solid #c7d3e2!important;
  caret-color:var(--v86-text)!important;
  opacity:1!important;
}
html body:not(.ca-page) main :where(input,textarea)::placeholder{
  color:#52647a!important;
  -webkit-text-fill-color:#52647a!important;
  opacity:1!important;
}
html body:not(.ca-page) main select option{
  background:#fff!important;
  color:var(--v86-text)!important;
  -webkit-text-fill-color:var(--v86-text)!important;
}
html body:not(.ca-page) main :where(input,select,textarea):focus{
  border-color:#6b9cf6!important;
  box-shadow:0 0 0 4px rgba(37,99,235,.12)!important;
}

/* Chrome/Edge autofill on light-page forms. */
html body:not(.ca-page) main input:-webkit-autofill,
html body:not(.ca-page) main input:-webkit-autofill:hover,
html body:not(.ca-page) main input:-webkit-autofill:focus,
html body:not(.ca-page) main textarea:-webkit-autofill,
html body:not(.ca-page) main textarea:-webkit-autofill:hover,
html body:not(.ca-page) main textarea:-webkit-autofill:focus,
html body:not(.ca-page) main select:-webkit-autofill,
html body:not(.ca-page) main select:-webkit-autofill:hover,
html body:not(.ca-page) main select:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--v86-text)!important;
  caret-color:var(--v86-text)!important;
  -webkit-box-shadow:0 0 0 1000px #fff inset!important;
  box-shadow:0 0 0 1000px #fff inset!important;
}

/* ---------- White/light surfaces ---------- */
html body:not(.ca-page) :where(
  .hero-copy,.hero-card,.content-card,.sidebar-card,.contact-card,.provider-card,.directory-card,
  .topic-card,.faq-card,.legal-card,.research-card,.notice-card,.filters-shell,.results-shell,
  .matcher-shell,.matcher-result,.scope-explainer,.evidence-panel,.smart-search-summary,.cta-panel,
  .matrix-toolbar,.matrix-shell,.entity-table-shell,.entity-toolbar,.status-change-panel,
  .mini-metrics>div,.meta-box,.metric,.signal,.evidence-item,.pricing-card,.pricing-tier-clean
){
  color:var(--v86-text)!important;
}
html body:not(.ca-page) :where(
  .hero-copy,.hero-card,.content-card,.sidebar-card,.contact-card,.provider-card,.directory-card,
  .topic-card,.faq-card,.legal-card,.research-card,.notice-card,.filters-shell,.results-shell,
  .matcher-shell,.matcher-result,.scope-explainer,.evidence-panel,.smart-search-summary,.cta-panel,
  .matrix-toolbar,.matrix-shell,.entity-table-shell,.entity-toolbar,.status-change-panel,
  .mini-metrics>div,.meta-box,.metric,.signal,.evidence-item,.pricing-card,.pricing-tier-clean
) :where(h1,h2,h3,h4,strong,b,summary){
  color:var(--v86-heading)!important;
  -webkit-text-fill-color:var(--v86-heading)!important;
}
html body:not(.ca-page) :where(
  .hero-copy,.hero-card,.content-card,.sidebar-card,.contact-card,.provider-card,.directory-card,
  .topic-card,.faq-card,.legal-card,.research-card,.notice-card,.filters-shell,.results-shell,
  .matcher-shell,.matcher-result,.scope-explainer,.evidence-panel,.smart-search-summary,.cta-panel,
  .matrix-toolbar,.matrix-shell,.entity-table-shell,.entity-toolbar,.status-change-panel,
  .mini-metrics>div,.meta-box,.metric,.signal,.evidence-item,.pricing-card,.pricing-tier-clean
) :where(p,li,small,dd,dt,.muted,.lead){
  color:var(--v86-muted)!important;
  -webkit-text-fill-color:var(--v86-muted)!important;
}

/* ---------- Buttons ---------- */
html body :where(.btn-primary,.btn.primary,button.primary,.open-page-btn,[type="submit"].btn-primary){
  background:#2563eb!important;
  border-color:#2563eb!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
html body:not(.ca-page) :where(.btn-secondary,.btn.secondary,.btn.ghost,.view-profile-btn,.resource-link,#matrix-reset){
  background:#fff!important;
  border-color:#c7d3e2!important;
  color:#26364c!important;
  -webkit-text-fill-color:#26364c!important;
}
html body:not(.ca-page) :where(.btn-secondary,.btn.secondary,.btn.ghost,.view-profile-btn,.resource-link,#matrix-reset):hover{
  background:#f3f6fa!important;
  color:#0b1f3a!important;
  -webkit-text-fill-color:#0b1f3a!important;
}

/* ---------- Pills and badges on light surfaces ---------- */
html body:not(.ca-page) main :where(.pill,.badge,.badge-standard,.badge-institutional){
  background:#f7f9fc!important;
  color:#334e68!important;
  -webkit-text-fill-color:#334e68!important;
  border-color:#d8e2ee!important;
  opacity:1!important;
}
html body:not(.ca-page) main .badge-featured{
  background:#eef5ff!important;
  color:#2454b8!important;
  -webkit-text-fill-color:#2454b8!important;
  border-color:#cfe0ff!important;
}
html body:not(.ca-page) main .badge-pending{
  background:#fffbeb!important;
  color:#92400e!important;
  -webkit-text-fill-color:#92400e!important;
  border-color:#fde68a!important;
}
html body:not(.ca-page) main .badge-verified,
html body:not(.ca-page) main .qualified-badge,
html body:not(.ca-page) main .evidence-badge{
  background:#ecfdf5!important;
  color:#0f6b4d!important;
  -webkit-text-fill-color:#0f6b4d!important;
  border-color:#c6eadb!important;
}
html body:not(.ca-page) main .ecosystem-badge{
  background:#f3f5f8!important;
  color:#435269!important;
  -webkit-text-fill-color:#435269!important;
  border-color:#dce3ec!important;
}
html body:not(.ca-page) main .status-change-badge{
  background:#fff7ed!important;
  color:#8a4b08!important;
  -webkit-text-fill-color:#8a4b08!important;
  border-color:#fed7aa!important;
}

/* ---------- Regulatory Matrix: explicit fix for the screenshot issue ---------- */
html body .matrix-toolbar{
  background:#f8fafc!important;
  border-color:#d9e3ef!important;
}
html body .matrix-toolbar label,
html body .matrix-toolbar label > span{
  color:#33445a!important;
  -webkit-text-fill-color:#33445a!important;
  opacity:1!important;
}
html body .matrix-toolbar input,
html body .matrix-toolbar select{
  background:#fff!important;
  color:#172338!important;
  -webkit-text-fill-color:#172338!important;
  border-color:#c7d3e2!important;
}
html body .matrix-quickbar > span{
  color:#475569!important;
  -webkit-text-fill-color:#475569!important;
  opacity:1!important;
}
html body .matrix-quick{
  background:#fff!important;
  color:#29415f!important;
  -webkit-text-fill-color:#29415f!important;
  border-color:#d2deeb!important;
}
html body .matrix-quick:hover,
html body .matrix-quick.is-active{
  background:#eaf2ff!important;
  color:#174ea6!important;
  -webkit-text-fill-color:#174ea6!important;
  border-color:#9bb9e8!important;
}
html body .matrix-resultline,
html body .matrix-resultline > span{
  color:#52657a!important;
  -webkit-text-fill-color:#52657a!important;
}
html body .matrix-resultline strong{
  color:#0b1f3a!important;
  -webkit-text-fill-color:#0b1f3a!important;
}
html body .regime-pill{
  background:#eef5ff!important;
  color:#2454b8!important;
  -webkit-text-fill-color:#2454b8!important;
  border-color:#cfe0ff!important;
}
html body .matrix-status.regulator-backed{
  background:#ecfdf5!important;color:#0f6b4d!important;-webkit-text-fill-color:#0f6b4d!important;
}
html body .matrix-status.conditional{
  background:#fff7ed!important;color:#8a4b08!important;-webkit-text-fill-color:#8a4b08!important;
}
html body .matrix-status.scope-verification,
html body .matrix-status.entity-specific{
  background:#fef2f2!important;color:#9b2c2c!important;-webkit-text-fill-color:#9b2c2c!important;
}
html body .matrix-status.bank-csd-framework{
  background:#f0f9ff!important;color:#075985!important;-webkit-text-fill-color:#075985!important;
}
html body .matrix-status.provider-regulatory-framework{
  background:#f5f3ff!important;color:#5b21b6!important;-webkit-text-fill-color:#5b21b6!important;
}
html body .matrix-sub{
  color:#617188!important;
  -webkit-text-fill-color:#617188!important;
}
html body .regulatory-table td,
html body .regulatory-table td p{
  color:#52657a!important;
  -webkit-text-fill-color:#52657a!important;
}
html body .regulatory-table td strong,
html body .regulatory-table td b{
  color:#0b1f3a!important;
  -webkit-text-fill-color:#0b1f3a!important;
}
html body .matrix-source{
  color:#1d4ed8!important;
  -webkit-text-fill-color:#1d4ed8!important;
}

/* ---------- Regulatory Entity DB ---------- */
html body .entity-toolbar label,
html body .entity-toolbar label span{
  color:#33445a!important;
  -webkit-text-fill-color:#33445a!important;
  opacity:1!important;
}
html body .entity-toolbar input,
html body .entity-toolbar select{
  background:#fff!important;
  color:#172338!important;
  -webkit-text-fill-color:#172338!important;
  border-color:#c7d3e2!important;
}
html body .entity-status.active{
  background:#e9f9f1!important;color:#116149!important;-webkit-text-fill-color:#116149!important;
}
html body .entity-status.conditional{
  background:#fff5e8!important;color:#8a4b08!important;-webkit-text-fill-color:#8a4b08!important;
}
html body .entity-status.unresolved{
  background:#fff1f2!important;color:#9f1239!important;-webkit-text-fill-color:#9f1239!important;
}
html body .entity-sub{
  color:#617188!important;
  -webkit-text-fill-color:#617188!important;
}
html body .entity-table td{
  color:#44536a!important;
  -webkit-text-fill-color:#44536a!important;
}
html body .entity-table td strong{
  color:#0b1f3a!important;
  -webkit-text-fill-color:#0b1f3a!important;
}

/* ---------- Evidence / provider filters ---------- */
html body .filters-shell label,
html body .filters-shell label > span,
html body .filters-shell .filter-field,
html body .filters-shell .filter-field > span,
html body .filters-bar label,
html body .filters-bar label > span{
  color:#33445a!important;
  -webkit-text-fill-color:#33445a!important;
  opacity:1!important;
}
html body .filters-shell :where(input,select,textarea),
html body .filters-bar :where(input,select,textarea){
  background:#fff!important;
  color:#172338!important;
  -webkit-text-fill-color:#172338!important;
  border-color:#c7d3e2!important;
}
html body .filter-reset-btn{
  background:#fff!important;
  color:#26364c!important;
  -webkit-text-fill-color:#26364c!important;
  border-color:#c7d3e2!important;
}

/* ---------- Tables site-wide ---------- */
html body:not(.ca-page) main table{
  background:#fff!important;
}
html body:not(.ca-page) main thead th{
  background:#f5f8fc!important;
  color:#33445a!important;
  -webkit-text-fill-color:#33445a!important;
}
html body:not(.ca-page) main tbody td{
  color:#52657a!important;
  -webkit-text-fill-color:#52657a!important;
}
html body:not(.ca-page) main tbody td :where(strong,b){
  color:#0b1f3a!important;
  -webkit-text-fill-color:#0b1f3a!important;
}

/* ---------- Dark intentional surfaces: reassert after light baseline ---------- */
html body :where(.lead-panel,.steps-section,.cta-band,.dark-section,.dark-panel,.dark-card,.navy-panel,.navy-card,[data-theme="dark"],.lead-economics-card){
  background-color:var(--v86-dark)!important;
  color:#f8fbff!important;
}
html body :where(.lead-panel,.steps-section,.cta-band,.dark-section,.dark-panel,.dark-card,.navy-panel,.navy-card,[data-theme="dark"],.lead-economics-card)
  :where(h1,h2,h3,h4,h5,h6,strong,b,summary,label,legend){
  color:#f8fbff!important;
  -webkit-text-fill-color:#f8fbff!important;
}
html body :where(.lead-panel,.steps-section,.cta-band,.dark-section,.dark-panel,.dark-card,.navy-panel,.navy-card,[data-theme="dark"],.lead-economics-card)
  :where(p,li,span,small,dd,dt,.muted,.lead){
  color:var(--v86-dark-muted)!important;
  -webkit-text-fill-color:var(--v86-dark-muted)!important;
  opacity:1!important;
}
html body :where(.footer,.site-footer){
  color:#d9e3f0!important;
}
html body :where(.footer,.site-footer) :where(p,li,span,small,a){
  color:#cbd8e6!important;
  -webkit-text-fill-color:#cbd8e6!important;
}
html body :where(.footer,.site-footer) :where(h2,h3,h4,strong,b){
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}

/* ---------- Platform / verification pages ---------- */
/* Keep dark shell, but all form controls deliberately light and readable. */
body.ca-page{
  color:#f8fbff!important;
}
body.ca-page :where(h1,h2,h3,h4,h5,h6,strong,b,label,.ca-legend){
  color:#f8fbff!important;
  -webkit-text-fill-color:#f8fbff!important;
}
body.ca-page :where(p,li,span,small,dd,dt,.ca-muted,.ca-disclaimer){
  color:#d7e3f3!important;
  -webkit-text-fill-color:#d7e3f3!important;
  opacity:1!important;
}
body.ca-page .ca-form :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea),
body.ca-page .ca-field :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
  background:#f8fbff!important;
  color:#0b1f3a!important;
  -webkit-text-fill-color:#0b1f3a!important;
  border-color:#9eb2cf!important;
  caret-color:#0b1f3a!important;
}
body.ca-page .ca-form :where(input,textarea)::placeholder{
  color:#60728c!important;
  -webkit-text-fill-color:#60728c!important;
  opacity:1!important;
}
body.ca-page .ca-form select option{
  background:#fff!important;
  color:#0b1f3a!important;
  -webkit-text-fill-color:#0b1f3a!important;
}
body.ca-page .ca-form input:-webkit-autofill,
body.ca-page .ca-form input:-webkit-autofill:hover,
body.ca-page .ca-form input:-webkit-autofill:focus,
body.ca-page .ca-form textarea:-webkit-autofill,
body.ca-page .ca-form textarea:-webkit-autofill:hover,
body.ca-page .ca-form textarea:-webkit-autofill:focus,
body.ca-page .ca-form select:-webkit-autofill,
body.ca-page .ca-form select:-webkit-autofill:hover,
body.ca-page .ca-form select:-webkit-autofill:focus{
  -webkit-text-fill-color:#0b1f3a!important;
  caret-color:#0b1f3a!important;
  -webkit-box-shadow:0 0 0 1000px #f8fbff inset!important;
  box-shadow:0 0 0 1000px #f8fbff inset!important;
}

/* ---------- Mobile safeguards ---------- */
@media(max-width:760px){
  html body :where(input,select,textarea){font-size:16px!important;}
  html body main :where(.matrix-toolbar,.entity-toolbar,.filters-bar,.filters-grid){
    gap:12px!important;
  }
  html body main :where(.matrix-quick,.pill,.badge,.matrix-status,.entity-status){
    max-width:100%!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  html body main table,
  html body main th,
  html body main td{
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }
}
