/* One theme contract for legacy modules and dynamically mounted portals.
   Preview iframe documents, media, brand swatches and chart strokes stay untouched. */
html[data-bk-theme] :is(#dashboard-app,#dashboard-app *,#bk-settings-root,#bk-settings-root *,#bk-team-root,#bk-team-root *,#bk-support-root,#bk-support-root *,.bk-floating-portal,.bk-floating-portal *,#portal,#portal *,#modal-root,#modal-root *,#toast-portal,#toast-portal *){
 --bk-surface:var(--bk-panel)!important;--bk-surface-2:var(--bk-card)!important;--bk-surface-soft:var(--bk-active)!important;--bk-input-bg:var(--bk-card)!important;
 --panel-bg:var(--bk-panel)!important;--input-bg:var(--bk-card)!important;--border-color:var(--bk-border)!important;
 --bk-line:var(--bk-border)!important;--bk-border-strong:var(--bk-muted)!important;--bk-hover:var(--bk-active)!important;
 --bk-sub:var(--bk-muted)!important;--bk-subtle:var(--bk-muted)!important;--bk-inverse:var(--bk-bg)!important;--bk-surface-raised:var(--bk-card)!important;--bk-text-muted:var(--bk-muted)!important;--bk-selected:var(--bk-active)!important;--bk-selected-text:var(--bk-text)!important;--bk-selected-border:var(--bk-border)!important;
}
html[data-bk-theme] #bk-settings-root :is(.bk-card,.bk-clean-card,.bk-integration-card,.bk-integration-list,.bk-integration-record,.bk-integration-drawer,.bk-panel-dialog,.bk-template-tree,.bk-template-code,.bk-template-preview,.bk-marketing-preview-window,.bk-marketing-preview-topbar,.bk-marketing-preview-meta,.bk-marketing-preview-subject){background:var(--bk-panel)!important;color:var(--bk-text)!important;border-color:var(--bk-border)!important}
html[data-bk-theme] #bk-settings-root .bk-integration-card::after{background:none!important}
html[data-bk-theme] #bk-settings-root :is(.bk-integration-drawer footer,.bk-panel-dialog-footer,.bk-template-code>header,.bk-template-preview>header,.bk-marketing-language-bar,.bk-marketing-help){background:var(--bk-active)!important;color:var(--bk-text)!important;border-color:var(--bk-border)!important}
html[data-bk-theme] #bk-settings-root :is(h1,h2,h3,h4,strong,label,.bk-template-tree>strong,.bk-marketing-preview-subject){color:var(--bk-text)!important}
html[data-bk-theme] #bk-settings-root :is(p,small,.bk-eyebrow,.bk-helper,.bk-integration-form-note,.bk-marketing-preview-topbar em,.bk-marketing-preview-meta small){color:var(--bk-muted)!important}
html[data-bk-theme] :is(#bk-settings-root,#bk-team-root,#bk-support-root,[role=dialog]) :is(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):not([type=hidden]),textarea,select,[contenteditable=true]){background:var(--bk-card)!important;color:var(--bk-text)!important;border-color:var(--bk-border)!important;caret-color:var(--bk-text)}
html[data-bk-theme] :is(#dashboard-app,#bk-settings-root,#bk-team-root,#bk-support-root,[role=dialog]) :is(input,textarea)::placeholder{color:var(--bk-muted)!important;opacity:1}
html[data-bk-theme] #bk-settings-root :is(.bk-button.secondary,.bk-icon-button,.bk-template-folder,.bk-template-file,.bk-template-preview-route,.bk-template-preview-device,.bk-marketing-language,.bk-template-collapse){background:var(--bk-panel)!important;color:var(--bk-text)!important;border-color:var(--bk-border)!important}
html[data-bk-theme] #bk-settings-root :is(.bk-template-file.active,.bk-template-record.active,.bk-template-preview-route.active,.bk-template-preview-device.active,.bk-marketing-language.active){background:var(--bk-active)!important;color:var(--bk-text)!important;border-color:var(--bk-muted)!important}
html[data-bk-theme] #bk-settings-root .bk-button.primary{background:var(--bk-text)!important;color:var(--bk-bg)!important;border-color:var(--bk-text)!important}
html[data-bk-theme] #bk-settings-root .bk-button.primary :is(span,strong,small,svg){color:inherit!important}
html[data-bk-theme] #bk-settings-root .bk-integration-drawer>header>button{background:var(--bk-panel)!important;color:var(--bk-text)!important;border:1px solid var(--bk-border)!important}
html[data-bk-theme] :is(#bk-settings-root,#bk-team-root,#bk-support-root,[role=dialog]) :is(input[type=checkbox],input[type=radio]){accent-color:var(--bk-text);border-color:var(--bk-muted)!important}
html[data-bk-theme] #bk-settings-root .bk-toggle{background:var(--bk-muted)!important}
html[data-bk-theme] #bk-settings-root .bk-toggle span{background:var(--bk-panel)!important}
html[data-bk-theme] #bk-settings-root .bk-toggle.on{background:var(--bk-text)!important}
html[data-bk-theme] #bk-settings-root .bk-toggle.on span{background:var(--bk-bg)!important}
html[data-bk-theme] #bk-settings-root :is(.bk-integration-card,.bk-integration-record):hover{background:var(--bk-panel)!important;border-color:var(--bk-border)!important;box-shadow:none!important}
html[data-bk-theme] :is(#bk-settings-root,#bk-team-root,#bk-support-root,[role=dialog]) :is(button,input,textarea,select):focus-visible{outline:2px solid var(--bk-muted);outline-offset:2px}
html[data-bk-theme] #bk-settings-root :is(.bk-event-picker,.bk-event-picker-panel,.bk-event-picker-panel section label){background:var(--bk-panel)!important;color:var(--bk-text)!important;border-color:var(--bk-border)!important}
html[data-bk-theme] #bk-settings-root .bk-preview-avatar{background:var(--bk-active)!important;color:var(--bk-text)!important}
html[data-bk-theme=light] #bk-settings-root :is(.bk-marketing-status.on,.bk-marketing-preview-live){color:color-mix(in srgb,#32d296 48%,#111 52%)!important}
html[data-bk-theme] #dashboard-app main table :is(tbody,tr,td){background-color:var(--bk-panel)!important;color:var(--bk-text)!important;transition:none!important}
html[data-bk-theme] :is(#bk-settings-root,#bk-team-root,#bk-support-root,[role=dialog]) input[type=checkbox]{width:18px!important;min-width:18px!important;height:18px!important;min-height:18px!important;padding:0!important;background:var(--bk-panel)!important;color:var(--bk-bg)!important;box-shadow:none!important;border-radius:6px!important;appearance:none!important;display:inline-grid!important;place-content:center!important}
html[data-bk-theme] :is(#bk-settings-root,#bk-team-root,#bk-support-root,[role=dialog]) input[type=checkbox]:is(:checked,:indeterminate){background:var(--bk-text)!important;border-color:var(--bk-text)!important;color:var(--bk-bg)!important}
html[data-bk-theme] :is(#bk-settings-root,#bk-team-root,#bk-support-root,[role=dialog]) input[type=checkbox]::after{box-sizing:content-box!important;flex:none;color:var(--bk-bg)!important}
html[data-bk-theme] #dashboard-app :is([class*="_insightsSkeleton_"],[class*="_dataSkeleton_"],[class*="_dataSkeletonRow_"],[class*="_skeletonCardHeader_"],[class*="_skeletonLegend_"]){background:transparent!important}
html[data-bk-theme] #dashboard-app :is([class*="_skeletonHeading_"],[class*="_skeletonChart_"],[class*="_skeletonAction_"],[class*="_skeletonLegend_"] span,[class*="_dataSkeletonRow_"] span,[class*="_metric_"]>span:empty,[class*="_metric_"]>strong:empty,[class*="_metric_"]>small:empty,.dashboard-skeleton,[data-macaw-ui-component=Skeleton]){background-color:var(--bk-skeleton)!important;background-image:linear-gradient(105deg,transparent 18%,rgba(127,127,127,.1) 50%,transparent 82%)!important;background-size:240% 100%}
/* Scoped integration polish: white glyphs and seamless webhook actions. */
html[data-bk-theme] #bk-settings-root .bk-integration-card .bk-integration-icon,
html[data-bk-theme] #bk-settings-root .bk-integration-card .bk-integration-icon svg{color:#fff!important}
html[data-bk-theme] #bk-settings-root .bk-integration-drawer:has(form[data-bk-webhook-form]) form>footer{background:transparent!important}
