/* Agenz Foundation V40 — final dark-theme surface and text synchronization */
:root{
  --v40-bg:#06040a;
  --v40-panel:#0d0714;
  --v40-panel-soft:#15101c;
  --v40-text:#f8f7fb;
  --v40-copy:#c8c1d1;
  --v40-muted:#a59bad;
  --v40-magenta:#ff2b7a;
  --v40-cyan:#50dfff;
  --v40-violet:#9b6cff;
  --v40-line:rgba(255,255,255,.14);
}

/* One surface contract for every legacy card and form container. */
.trust-panel,.join-form,.project-brief-form,.about-story,.founder-card,.faq-item,.policy-item,
.filter-bar,.match-shell,.match-form,.match-result,.ai-attention-card,.v24-card,.v25-card,.v26-card,.v27-card,
.dash-onboarding,.dash-roadmap article,.order-demo,.order-shell form,.recommendation-panel{
  color:var(--v40-text)!important;border-color:var(--v40-line)!important;
  background:linear-gradient(145deg,rgba(255,43,122,.035),rgba(80,223,255,.018)),var(--v40-panel)!important;
  box-shadow:0 18px 52px rgba(0,0,0,.22)!important
}
.trust-panel :where(h1,h2,h3,h4),.join-form :where(h1,h2,h3,h4),
.project-brief-form :where(h1,h2,h3,h4),.about-story :where(h1,h2,h3,h4),
.founder-card :where(h1,h2,h3,h4),.faq-item :where(h1,h2,h3,h4),
.policy-item :where(h1,h2,h3,h4),.match-shell :where(h1,h2,h3,h4),
.ai-attention-card :where(h1,h2,h3,h4),.v24-card :where(h1,h2,h3,h4),
.v25-card :where(h1,h2,h3,h4),.v26-card :where(h1,h2,h3,h4),.v27-card :where(h1,h2,h3,h4){color:var(--v40-text)!important}
.trust-panel :where(p,li,small),.join-form :where(p,li,small),.project-brief-form :where(p,li,small),
.about-story :where(p,li,small),.founder-card :where(p,li,small),.faq-item :where(p,li,small),
.policy-item :where(p,li,small),.match-shell :where(p,li,small),.ai-attention-card :where(p,li,small),
.v24-card :where(p,li,small),.v25-card :where(p,li,small),.v26-card :where(p,li,small),
.v27-card :where(p,li,small){color:var(--v40-copy)!important;opacity:1!important}

/* Exact form selectors override the former high-specificity light theme. */
.project-brief-form input,.project-brief-form select,.project-brief-form textarea,
.design-intake input,.design-intake select,.design-intake textarea,
.join-form input,.join-form select,.join-form textarea,.match-form input,.match-form select,.match-form textarea,
.filter-bar input,.filter-bar select,.order-shell input,.dash-onboarding input,.dash-fields input,
.dash-fields select,.dash-fields textarea,.v25-form input,.v25-form textarea,.v25-form select{
  color:#fff!important;background:#0d0913!important;border-color:rgba(255,255,255,.18)!important;
  box-shadow:none!important
}
.project-brief-form input::placeholder,.project-brief-form textarea::placeholder,
.design-intake input::placeholder,.design-intake textarea::placeholder,.join-form input::placeholder,
.join-form textarea::placeholder,.match-form input::placeholder,.match-form textarea::placeholder,
.filter-bar input::placeholder,.dash-fields input::placeholder,.dash-fields textarea::placeholder{
  color:#aaa0b3!important;opacity:1!important
}
.project-brief-form label>span,.design-intake label>span,.join-form label>span,.match-form label>span,
.dash-onboarding label>span,.dash-fields label>span,.v25-form label{color:#d7d0dd!important}
.privacy-notice,.form-truth{color:var(--v40-copy)!important;border-color:rgba(80,223,255,.22)!important;background:rgba(80,223,255,.055)!important}
.privacy-notice :where(p,code,strong),.form-truth{color:var(--v40-copy)!important}

/* AI companion and chat now match the site instead of opening a white panel. */
.ai-chat,.companion-panel{
  color:#fff!important;border-color:rgba(255,255,255,.2)!important;background:rgba(8,5,13,.97)!important;
  box-shadow:0 32px 90px rgba(0,0,0,.66),0 0 70px rgba(139,92,246,.13)!important
}
.ai-chat-header,.companion-head{color:#fff!important;border-color:var(--v40-line)!important;background:linear-gradient(110deg,rgba(255,43,122,.13),rgba(80,223,255,.065))!important}
.ai-chat-title strong,.companion-panel :where(h2,h3,strong){color:#fff!important}
.ai-chat-title span,.ai-disclaimer,.companion-panel :where(p,small){color:var(--v40-muted)!important}
.ai-chat-close,.companion-close{color:#fff!important;border-color:var(--v40-line)!important;background:rgba(255,255,255,.035)!important}
.ai-message.assistant{color:#eee9f2!important;border-color:var(--v40-line)!important;background:#17101e!important}
.ai-message.user{color:#effcff!important;border-color:rgba(80,223,255,.2)!important;background:rgba(80,223,255,.085)!important}
.ai-chat-form,.ai-input-shell{color:#fff!important;border-color:var(--v40-line)!important;background:rgba(5,3,8,.88)!important}
.ai-chat-form textarea{color:#fff!important;background:transparent!important}.ai-chat-form textarea::placeholder{color:#a59bad!important}
.ai-suggestions button,.companion-choices button{color:#eee9f2!important;border-color:var(--v40-line)!important;background:rgba(255,255,255,.035)!important}
.ai-suggestions button:hover,.companion-choices button:hover{color:var(--v40-cyan)!important;border-color:rgba(80,223,255,.35)!important;background:rgba(80,223,255,.06)!important}

/* Design catalogue controls, selection bars, and modal text share the same dark surface. */
.template-toolbar,.selected-template-bar,.category-menu,.template-modal,.compare-drawer,.compare-modal article{
  color:#fff!important;border-color:var(--v40-line)!important;background:rgba(10,6,15,.96)!important;
  box-shadow:0 20px 62px rgba(0,0,0,.35)!important
}
.template-toolbar :where(button,select),.category-item>button{color:var(--v40-copy)!important;border-color:var(--v40-line)!important;background:rgba(255,255,255,.035)!important}
.template-toolbar :where(button,select):hover,.category-item>button:hover,.category-item>button.active{color:#fff!important;border-color:rgba(80,223,255,.3)!important;background:rgba(80,223,255,.065)!important}
.template-info :where(b,strong),.selected-template-bar :where(b,strong),.template-modal :where(h2,h3,strong){color:#fff!important}
.template-info :where(span,small),.selected-template-bar :where(span,small,em),.template-modal :where(p,small){color:var(--v40-copy)!important}

/* Social tabs, actions, and dialogs no longer inherit white-theme controls. */
.social-tabs{border-color:var(--v40-line)!important}
.social-tabs button{color:var(--v40-muted)!important;background:transparent!important}
.social-tabs button:hover,.social-tabs button.active{color:#fff!important;background:rgba(255,255,255,.07)!important}
.social-action:not(.primary),.social-dialog-close,.social-safety-links button{color:var(--v40-copy)!important;border-color:var(--v40-line)!important;background:rgba(255,255,255,.035)!important}
.social-action:not(.primary):hover,.social-safety-links button:hover{color:var(--v40-cyan)!important}
.social-dialog-card textarea{color:#fff!important;background:#0d0913!important;border-color:var(--v40-line)!important}

/* Dashboard controls and finance modules: dark panel, light text, clear active state. */
.dash-sidebar nav button,.dash-sidebar a,.dash-nav a,.v25-tabs button,.notification-item button,
.admin-review-actions button,.account-role-grid button{color:var(--v40-copy)!important;border-color:var(--v40-line)!important;background:transparent!important}
.dash-sidebar nav button:hover,.dash-sidebar nav button.active,.dash-sidebar a.active,.dash-nav a.active,
.v25-tabs button:hover,.v25-tabs button.active,.account-role-grid button:hover,.account-role-grid button.active{
  color:#fff!important;border-color:rgba(80,223,255,.3)!important;background:rgba(80,223,255,.07)!important
}
.notification-item button:hover,.admin-review-actions button:hover{color:var(--v40-cyan)!important;border-color:rgba(80,223,255,.3)!important}
.v25-card dd,.v25-status,.lock-chip{color:var(--v40-cyan)!important}
.v25-card dt,.v25-head p,.v25-card p,.v25-card li,.account-role-grid small{color:var(--v40-copy)!important}
.preview-wrap{background:#08050c!important}.preview-watermark{color:rgba(255,255,255,.22)!important;text-shadow:0 1px 8px rgba(0,0,0,.8)!important}
table{color:#fff!important}th{color:#d9d2df!important;background:#17101e!important}td{color:#f3eff5!important}td,th{border-color:var(--v40-line)!important}

/* Academy classroom controls and progress elements follow the restored theme. */
.classroom-progress{background:#201827!important}.classroom-progress i{background:linear-gradient(90deg,var(--v40-magenta),var(--v40-cyan))!important}
.curriculum-item>button i,.academy-faq-list summary i{color:var(--v40-cyan)!important;background:#17101e!important}
.course-facts,.academy-faq-list,.curriculum-list,.lesson-nav{border-color:var(--v40-line)!important}
.course-facts span{color:var(--v40-copy)!important;border-color:var(--v40-line)!important}.course-facts b{color:#fff!important}

/* Contextual light sections keep their own ink; nested dark cards keep light text. */
.section-light{color:#0d0714!important}
.section-light :where(.section-heading,.about-story)>:where(h1,h2,h3,h4),.section-light>.section-inner>:where(h1,h2,h3,h4){color:#0d0714!important}
.section-light .section-heading>p,.section-light>.section-inner>p{color:#554d5d!important}
.section-light :where(.preview-card,.service-card,.article-card,.value-card,.founder-card,.trust-panel) :where(h1,h2,h3,h4,strong,b){color:#fff!important}
.section-light :where(.preview-card,.service-card,.article-card,.value-card,.founder-card,.trust-panel) :where(p,li,small){color:var(--v40-copy)!important}

/* Prevent accidental low-opacity text from becoming unreadable. */
.hero-meta,.hero-chip,.footer-end,.legal-meta,.market-meta,.article-meta,.research-note,
.developer-sign span,.course-back,.pricing-note{opacity:1!important}
.site-footer :where(p,a,small),.section-dark :where(p,li,small),.cta-band p{color:var(--v40-copy)!important}
.site-footer .footer-col>span,.section-dark .eyebrow.cyan,.cta-band .eyebrow{color:var(--v40-cyan)!important}

@media(max-width:760px){
  .template-toolbar{background:rgba(10,6,15,.985)!important}
  .project-brief-form,.join-form,.match-form,.match-result{box-shadow:none!important}
  .ai-chat{background:rgba(8,5,13,.99)!important}
}
