/* v2.11.09 — dark-mode contrast and surface consistency */
html[data-theme="dark"]{
  --cb91-ink:#f1f7fc;
  --cb91-muted:#b5c9da;
  --cb91-line:rgba(143,194,225,.30);
  --cb91-soft:#0b2034;
  --cb91-shadow:0 24px 58px -38px rgba(0,0,0,.88);
  --cb1106-ink:#f1f7fc;
  --cb1106-muted:#b5c9da;
  --cb1106-line:rgba(143,194,225,.30);
  --cb1106-soft:#0b2034;
  --cb1106-blue:#0878bd;
  --cb1106-blue2:#0d8bcf;
  --cb1106-green:#71d4ad;
  --cb-polish-line:rgba(143,194,225,.30);
  --cb-polish-line-strong:rgba(117,201,250,.52);
  --cb-polish-surface:#0e2942;
  --cb-polish-soft:#0a2034;
  --cb-polish-shadow:0 24px 58px -38px rgba(0,0,0,.88);
  --cb-polish-shadow-hover:0 30px 68px -38px rgba(0,0,0,.96);
}

/* Shared recent content surfaces. */
html[data-theme="dark"] body[data-page] :is(.cb91-section.tint,.cb91-home-tools,.cb96-company-process,.cb97-team-enrichment){
  background:#081b2c!important;
  border-color:rgba(143,194,225,.18)!important;
}
html[data-theme="dark"] body[data-page="home"] .cb91-home-tools{
  background:
    radial-gradient(circle at 92% 8%,rgba(68,169,231,.12),transparent 28%),
    linear-gradient(180deg,#0a2034 0%,#081a2b 100%)!important;
}
html[data-theme="dark"] body[data-page="home"] #cb91SectorGuidance{
  background:linear-gradient(180deg,#081b2c,#071827)!important;
  border-color:rgba(143,194,225,.18)!important;
}
html[data-theme="dark"] body[data-page] :is(.cb91-heading h2,.cb96-tools-head h2,.cb96-company-step h3,.cb96-company-panel h3,.cb97-team-card h3,.cb97-team-panel h3){
  color:#f1f7fc!important;
}
html[data-theme="dark"] body[data-page] :is(.cb91-heading p,.cb96-tools-head p,.cb96-company-step p,.cb96-company-list li,.cb99-company-panel-copy,.cb97-team-card p,.cb97-team-list li){
  color:#b5c9da!important;
}
html[data-theme="dark"] body[data-page] :is(.cb91-card,.cb91-scenario,.cb91-fit-panel,.cb91-form,.cb96-tool-card,.cb96-company-step,.cb96-company-panel,.cb97-team-card,.cb97-team-panel){
  background:linear-gradient(155deg,#0e2942,#0a2034)!important;
  border-color:rgba(143,194,225,.30)!important;
  color:#edf6fd!important;
  box-shadow:0 24px 58px -38px rgba(0,0,0,.88)!important;
}
html[data-theme="dark"] body[data-page] :is(.cb91-card h3,.cb91-scenario h2,.cb91-fit-question h2,.cb91-field label,.cb96-tool-card strong){
  color:#f1f7fc!important;
}
html[data-theme="dark"] body[data-page] :is(.cb91-card p,.cb91-scenario .summary,.cb91-table td,.cb96-tool-card p){
  color:#b5c9da!important;
}
html[data-theme="dark"] body[data-page] :is(.cb91-card small,.cb91-card-link,.cb96-tool-card small){
  color:#75c9fa!important;
}
html[data-theme="dark"] body[data-page] .cb91-card:hover,
html[data-theme="dark"] body[data-page] :is(.cb96-tool-card,.cb96-company-step,.cb96-company-panel,.cb97-team-card,.cb97-team-panel):hover{
  border-color:rgba(117,201,250,.52)!important;
}
html[data-theme="dark"] body[data-page] :is(.cb91-tool-icon,.cb96-company-step>span,.cb97-team-card>span,.cb96-tool-arrow){
  background:#123a58!important;
  border-color:rgba(117,201,250,.32)!important;
  color:#8dd6ff!important;
}
html[data-theme="dark"] body[data-page="home"] #cb91SectorGuidance .cb91-card small,
html[data-theme="dark"] body[data-page] .cb91-pill{
  background:#12344f!important;
  border-color:rgba(117,201,250,.26)!important;
  color:#8dd6ff!important;
}
html[data-theme="dark"] body[data-page] :is(.cb91-metric,.cb91-scenario-aside){
  background:#0a2136!important;
  border:1px solid rgba(143,194,225,.20)!important;
}
html[data-theme="dark"] body[data-page] .cb91-metric strong,
html[data-theme="dark"] body[data-page] .cb91-scenario-aside dd{
  color:#f1f7fc!important;
}
html[data-theme="dark"] body[data-page] :is(.cb91-metric span,.cb91-scenario-aside dt){
  color:#9db3c5!important;
}
html[data-theme="dark"] body[data-page] .cb91-comparison-wrap{
  background:#0e2942!important;
  border-color:rgba(143,194,225,.30)!important;
}
html[data-theme="dark"] body[data-page] .cb91-table th{
  background:#12344f!important;
  color:#f1f7fc!important;
}
html[data-theme="dark"] body[data-page] .cb91-table :is(th,td){border-color:rgba(143,194,225,.18)!important}
html[data-theme="dark"] body[data-page] .cb91-table td:first-child{color:#f1f7fc!important}

/* Trust & Standards Centre. */
html[data-theme="dark"] body[data-page="trust-standards"] .cb1106-trust-section.tint{
  background:#081b2c!important;
}
html[data-theme="dark"] body[data-page="trust-standards"] :is(.cb1106-status-card,.cb1106-trust-card){
  background:linear-gradient(155deg,#0e2942,#0a2034)!important;
  border-color:rgba(143,194,225,.30)!important;
  color:#edf6fd!important;
  box-shadow:0 24px 58px -38px rgba(0,0,0,.88)!important;
}
html[data-theme="dark"] body[data-page="trust-standards"] .cb1106-status-card small{color:#9db3c5!important}
html[data-theme="dark"] body[data-page="trust-standards"] .cb1106-status-card strong,
html[data-theme="dark"] body[data-page="trust-standards"] .cb1106-trust-card h3{color:#f1f7fc!important}
html[data-theme="dark"] body[data-page="trust-standards"] :is(.cb1106-status-card span,.cb1106-trust-card p,.cb1106-trust-list li,.cb1106-reviewed){color:#b5c9da!important}
html[data-theme="dark"] body[data-page="trust-standards"] .cb1106-trust-icon{
  background:#123a58!important;
  border-color:rgba(117,201,250,.32)!important;
  color:#8dd6ff!important;
}
html[data-theme="dark"] body[data-page="trust-standards"] .cb1106-trust-link{
  background:#0b2237!important;
  border-color:rgba(143,194,225,.36)!important;
  color:#8dd6ff!important;
}
html[data-theme="dark"] body[data-page="trust-standards"] .cb1106-trust-link:hover{
  background:#12344f!important;
  border-color:rgba(117,201,250,.56)!important;
  color:#fff!important;
}
html[data-theme="dark"] body[data-page="trust-standards"] .cb1106-trust-link.primary{
  background:linear-gradient(105deg,#0878bd,#0d8bcf)!important;
  border-color:#0878bd!important;
  color:#fff!important;
}

/* Funding-fit selector and generated handoff. */
html[data-theme="dark"] body[data-page="funding-fit"] :is(.cb91-fit-panel,.cb1106-fit-summary){
  background:linear-gradient(155deg,#0e2942,#0a2034)!important;
  border-color:rgba(143,194,225,.30)!important;
  color:#edf6fd!important;
}
html[data-theme="dark"] body[data-page="funding-fit"] .cb91-fit-progress{
  background:#173249!important;
  border-color:rgba(143,194,225,.25)!important;
}
html[data-theme="dark"] body[data-page="funding-fit"] .cb91-fit-counter{color:#9db3c5!important}
html[data-theme="dark"] body[data-page="funding-fit"] .cb91-option{
  background:#0b2237!important;
  border-color:rgba(143,194,225,.30)!important;
  color:#e8f3fb!important;
}
html[data-theme="dark"] body[data-page="funding-fit"] .cb91-option:hover,
html[data-theme="dark"] body[data-page="funding-fit"] .cb91-option.is-selected{
  background:#12344f!important;
  border-color:#4bb7f2!important;
  box-shadow:0 0 0 3px rgba(75,183,242,.14)!important;
}
html[data-theme="dark"] body[data-page="funding-fit"] .cb91-option-mark{border-color:#7898af!important}
html[data-theme="dark"] body[data-page="funding-fit"] :is(.cb1106-fit-reference,.cb1106-fit-summary-card,.cb1106-fit-handoff){
  background:#0b2237!important;
  border-color:rgba(143,194,225,.28)!important;
}
html[data-theme="dark"] body[data-page="funding-fit"] :is(.cb1106-fit-summary-head h2,.cb1106-fit-summary-card h3,.cb1106-fit-handoff strong){color:#f1f7fc!important}
html[data-theme="dark"] body[data-page="funding-fit"] :is(.cb1106-fit-summary-card li,.cb1106-fit-disclaimer,.cb1106-fit-handoff){color:#b5c9da!important}
html[data-theme="dark"] body[data-page="funding-fit"] .cb1106-fit-reference strong{color:#8dd6ff!important}
html[data-theme="dark"] body[data-page="funding-fit"] .cb1106-fit-actions-secondary{border-color:rgba(143,194,225,.20)!important}
html[data-theme="dark"] body[data-page="funding-fit"] :is(.cb1106-fit-utility,.cb1106-fit-actions .cb91-btn-secondary){
  background:#0b2237!important;
  border-color:rgba(143,194,225,.34)!important;
  color:#8dd6ff!important;
}

/* Pricing, scenarios and appointment pages. */
html[data-theme="dark"] body[data-page="pricing-decisions"] .cb91-heading h2,
html[data-theme="dark"] body[data-page="case-studies"] .cb91-heading h2{color:#f1f7fc!important}
html[data-theme="dark"] body[data-page="pricing-decisions"] .cb91-heading p,
html[data-theme="dark"] body[data-page="case-studies"] .cb91-heading p{color:#b5c9da!important}
html[data-theme="dark"] body[data-page="book-call"] .cb91-form{background:linear-gradient(155deg,#0e2942,#0a2034)!important}
html[data-theme="dark"] body[data-page="book-call"] .cb91-form :is(label,.cb91-field label){color:#eaf4fb!important}
html[data-theme="dark"] body[data-page="book-call"] .cb91-form > div:last-child span{color:#9db3c5!important}

/* Company and Team additions. */
html[data-theme="dark"] body[data-page="company"] .cb96-company-process,
html[data-theme="dark"] body[data-page="team"] .cb97-team-enrichment{background:#081b2c!important}
html[data-theme="dark"] body[data-page="company"] :is(.cb96-company-step,.cb96-company-panel),
html[data-theme="dark"] body[data-page="team"] :is(.cb97-team-card,.cb97-team-panel){
  background:linear-gradient(155deg,#0e2942,#0a2034)!important;
  border-color:rgba(143,194,225,.30)!important;
}
html[data-theme="dark"] body[data-page="company"] :is(.cb96-company-step h3,.cb96-company-panel h3),
html[data-theme="dark"] body[data-page="team"] :is(.cb97-team-card h3,.cb97-team-panel h3){color:#f1f7fc!important}
html[data-theme="dark"] body[data-page="company"] :is(.cb96-company-step p,.cb96-company-list li,.cb99-company-panel-copy),
html[data-theme="dark"] body[data-page="team"] :is(.cb97-team-card p,.cb97-team-list li){color:#b5c9da!important}
html[data-theme="dark"] body[data-page="company"] .cb96-company-panel .btn-outline,
html[data-theme="dark"] body[data-page="team"] .cb97-team-panel .btn-outline{
  background:#0b2237!important;
  border-color:rgba(143,194,225,.34)!important;
  color:#8dd6ff!important;
}

/* Portal dashboard dark working surface. */
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-dashboard-main{
  background:
    radial-gradient(circle at 86% 5%,rgba(61,165,228,.12),transparent 26%),
    linear-gradient(180deg,#081b2c 0%,#071827 100%)!important;
}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-dashboard-head h1{color:#f1f7fc!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-dashboard-head p{color:#b5c9da!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-status-badge{background:#123d32!important;color:#9ce5c5!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-dashboard-card,
html[data-theme="dark"] body[data-page="portal-dashboard"] :is(.cb91-contact-box,.cb91-action-box){
  background:linear-gradient(155deg,#0e2942,#0a2034)!important;
  border-color:rgba(143,194,225,.30)!important;
  color:#edf6fd!important;
}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-dashboard-card-head{
  background:#0d263d!important;
  border-color:rgba(143,194,225,.18)!important;
}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-dashboard-card-head h2,
html[data-theme="dark"] body[data-page="portal-dashboard"] :is(.cb91-contact-box h3,.cb91-action-box h3){color:#f1f7fc!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] :is(.cb91-contact-box p,.cb91-action-box p,.cb91-empty,.cb91-timeline-item p){color:#b5c9da!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-action-box{
  background:linear-gradient(145deg,#3b2c15,#2d2111)!important;
  border-color:#8f6a2e!important;
}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-timeline-item:not(:last-child)::after{background:rgba(143,194,225,.22)!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-timeline-dot{background:#0b2237!important;border-color:rgba(143,194,225,.36)!important;color:#b5c9da!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-timeline-item h3{color:#eaf4fb!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-message-form{
  background:#0d263d!important;
  border-color:rgba(143,194,225,.18)!important;
}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-message-form textarea{background:#081c2e!important;color:#edf6fd!important;border-color:rgba(143,194,225,.34)!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-message{background:#12344f!important;color:#e8f3fb!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-message.staff{background:#123a58!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-message.client{background:#123d32!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-message small{color:#a6bdcf!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-card-link{color:#8dd6ff!important}

/* Portal application workspace: remove white-on-white states. */
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] :is(.portal-card,.workspace-autosave,.workspace-summary-card,.workspace-readiness,.workspace-security-note,.invoice-slot,.workspace-optional-row,.vgs-security-status){
  background:linear-gradient(155deg,#0e2942,#0a2034)!important;
  border-color:rgba(143,194,225,.30)!important;
  color:#edf6fd!important;
}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .portal-card-head,
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .workspace-step-actions{
  background:#0d263d!important;
  border-color:rgba(143,194,225,.18)!important;
}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] :is(.portal-card-head h2,.workspace-section-title h3,.workspace-autosave strong,.workspace-summary-head strong,.workspace-summary-list strong,.workspace-security-note strong,.invoice-slot label,.workspace-optional-row strong,.vgs-security-status strong){color:#f1f7fc!important}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] :is(.portal-card-head p,.form-section p,.workspace-autosave small,.workspace-summary-head small,.workspace-summary-list small,.workspace-security-note p,.workspace-optional-row span,.vgs-field-state,.vgs-security-status p,.workspace-action-note){color:#b5c9da!important}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .workspace-summary-list li.is-current{background:#12344f!important}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .workspace-summary-list li>span{background:#0b2237!important;border-color:rgba(143,194,225,.34)!important;color:#b5c9da!important}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .workspace-progress-meter,
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .upload-meter{background:#173249!important;border-color:rgba(143,194,225,.22)!important}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] :is(.portal-field input,.portal-field select,.portal-field textarea,.vgs-file-mount){background:#081c2e!important;color:#edf6fd!important;border-color:rgba(143,194,225,.34)!important}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .workspace-step-actions .workspace-back{background:#0b2237!important;color:#dceaf5!important;border-color:rgba(143,194,225,.34)!important}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .workspace-readiness{background:linear-gradient(145deg,#103528,#0d2b23)!important}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .workspace-readiness strong{color:#a8e7ca!important}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .workspace-readiness p{color:#b5d7c8!important}

/* Shared primary button uses a dark enough blue for white text. */
html[data-theme="dark"] body[data-page] :is(.btn-blue,.cb91-btn-primary,.cb1106-trust-link.primary,.workspace-next,#portalSend){
  background:linear-gradient(105deg,#0878bd,#0d8bcf)!important;
  color:#fff!important;
}

/* Final contrast refinements identified by the rendered dark-mode audit. */
html[data-theme="dark"] body[data-page] .cb91-kicker{color:#75c9fa!important}
html[data-theme="dark"] body[data-page="team"] .cb97-team-panel p{color:#b5c9da!important}
html[data-theme="dark"] body[data-page="portal-dashboard"] .cb91-dashboard-card-head > span{color:#9db3c5!important}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .workspace-security-note a{color:#8dd6ff!important}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] :is(.workspace-required-count,.workspace-section-title>span){
  background:#12344f!important;
  border-color:rgba(117,201,250,.28)!important;
  color:#8dd6ff!important;
}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .invoice-slot label::after{
  background:#12344f!important;
  color:#8dd6ff!important;
}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .req{color:#ff9a8e!important}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .vgs-security-icon{background:#137f6b!important;color:#fff!important}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .workspace-autosave>span{
  background:#123d32!important;
  color:#a8e7ca!important;
}
html[data-theme="dark"] body[data-page="portal"][data-portal-view="form"] .workspace-readiness>span{
  background:#174b3b!important;
  color:#c4f5df!important;
}
