/* SWISO 0.20.304: Forge Current dark-mode correction, isolated from all other palettes and portals. */
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"]{
  --p304-canvas:#071c28;--p304-surface:#102b38;--p304-surface-2:#173744;
  --p304-field:#0b2430;--p304-border:#3b606b;--p304-border-strong:#56808a;
  --p304-text:#f2f8f9;--p304-muted:#b9cdd3;--p304-link:#73d7e3;
}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #managementView,
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView{color:var(--p304-text)}

/* Overview: visual289.css wins late on these exact components in 0.20.302. */
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #managementView :is(.control-grid>article,.dashboard-panel,.role-work-panel,.role-queue>*,.management-areas,.management-areas>div){background:var(--p304-surface)!important;background-image:none!important;border-color:var(--p304-border)!important;color:var(--p304-text)!important}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #managementView :is(h2,h3,strong,b,.section-kicker,.boundary-badge){color:var(--p304-text)!important}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #managementView :is(p,small){color:var(--p304-muted)!important}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView .forge209-grid>article{background:var(--p304-surface)!important;background-image:none!important;border-color:var(--p304-border)!important;color:var(--p304-text)!important}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView .forge209-grid>article :is(h1,h2,h3,h4,p,small,strong){color:inherit!important}

/* Route-owned workbenches and guidance components. */
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView :is(.module-heading,.module-workbench,.special-workspace,.filter-strip,.workflow-summary,.register-toolbar,.register-frame,.register-card-grid,.empty-register,.page-status,.panel,.audit-notice,.learning-notice,.v291-workflow-banner,.v291-workflow-intro,.v291-workflow-step,.v292-guidance-hero,.v292-guidance-note,.v292-journey>article,.v292-guide-grid>article,.v293-guidance-hero,.v293-guidance-note,.v293-journey>article,.v293-guide-grid>article,.v294-guidance-hero,.v294-guidance-note,.v294-journey>article,.v294-guide-grid>article){background:var(--p304-surface)!important;background-image:none!important;border-color:var(--p304-border)!important;color:var(--p304-text)!important}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView :is(h1,h2,h3,h4,h5,h6,legend,label,strong,th,.title,.card-title){color:var(--p304-text)!important}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView :is(p,small,.muted,.helper,.hint,.description,td){color:var(--p304-muted)!important}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView a:not(.button):not([role="button"]){color:var(--p304-link)!important}

/* EA codes, Users, Licence and profile routes have explicit late white surfaces. */
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView :is([data-forge-layout="industry-ea-codes"],.forge226-profile-bar,fieldset.r65-ea,fieldset.r65-ea>label:not(.v290-file-field),.forge218-industry,[data-forge-layout="users"],[data-users],.forge209-user,[data-forge-layout="my-licence"],.pathway-licence-card,.licence-holder,.licence-meta>article,.licensed-products,.licensed-product-grid>a,.forge210-modules,.forge210-module-grid>*,.forge209-metrics>article,.pathway-market-links,.licence-terms-grid>article){background:var(--p304-surface)!important;background-image:none!important;border-color:var(--p304-border)!important;color:var(--p304-text)!important;box-shadow:none!important}

/* Controls, including native file selector. */
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){background:var(--p304-field)!important;border-color:var(--p304-border-strong)!important;color:var(--p304-text)!important;color-scheme:dark}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView input[type="file"]::file-selector-button{background:var(--p304-surface-2)!important;border-color:var(--p304-border)!important;color:var(--p304-text)!important}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView ::placeholder{color:#98b3bb!important;opacity:1}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView :is(button,.button,[role="button"]):not(.primary){background:var(--p304-surface-2)!important;border-color:var(--p304-border-strong)!important;color:var(--p304-text)!important}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView :is(button,.button,[role="button"]):focus-visible{outline:3px solid #70d7e3!important;outline-offset:2px}

/* Tables, modals, state panels and navigation within Forge only. */
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView :is(table,tbody,tr,td,th){background-color:var(--p304-surface)!important;border-color:var(--p304-border)!important}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView thead th{background:var(--p304-surface-2)!important;color:var(--p304-text)!important}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] :is(.modal,.dialog,[role="dialog"],.empty-state,.loading-state,.notice,.callout){background:var(--p304-surface)!important;border-color:var(--p304-border)!important;color:var(--p304-text)!important}
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #r65SidebarNav :is(a,button,.nav-item,[data-module]):is(:hover,:focus-visible,[aria-current="page"],.active){background:#20505c!important;color:#fff!important}

/* Output previews intentionally retain paper semantics. */
html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] #moduleView :is(.r58-preview,.document-preview,.page-preview,.paper-preview){background:#fff!important;color:#17354a!important}
@media(prefers-reduced-motion:reduce){html[data-theme="dark"][data-swiso-palette="forge-current"] body[data-portal="forge"] *{transition-duration:.01ms!important;animation-duration:.01ms!important}}
