/* Application chrome only. Never filter, invert or recolor slide/media contents. */
/* Shared primary actions. Preserve red destructive and green publish actions. */
html[data-flowdo-theme] :is(.studio,.content-workbench,.plan-workspace) button.primary:not(.danger):not(.success){background:linear-gradient(135deg,#7868ff,#585bfa)!important;border-color:#746aff!important;color:#fff!important;box-shadow:0 5px 13px #655bff30,inset 0 1px #ffffff45}
html[data-flowdo-theme] body:has(.merchant-only) :is(.btn.primary,.mini-btn.primary):not(.danger):not(.success){background:linear-gradient(135deg,#7868ff,#585bfa)!important;border-color:#746aff!important;color:#fff!important;box-shadow:0 5px 13px #655bff30,inset 0 1px #ffffff45!important}
html[data-flowdo-theme] body:has(.merchant-only) :is(.btn.primary,.mini-btn.primary):not(.danger):not(.success):hover:not(:disabled){filter:brightness(1.06)}
html[data-flowdo-theme=light]{--fd-bg:#f3f6fb;--fd-panel:#fff;--fd-soft:#eaf0f7;--fd-text:#19283d;--fd-muted:#596d84;--fd-line:#dbe3ef;--fd-accent:#315e85;--fd-selected:#dfeaf6;--fd-glow:#d5eeed;--fd-shadow:0 12px 36px #263e5810}
html[data-flowdo-theme=dark]{--fd-bg:#101827;--fd-panel:#192538;--fd-soft:#223249;--fd-text:#e5edf8;--fd-muted:#a4b5ca;--fd-line:#34455f;--fd-accent:#a5ceff;--fd-selected:#30476a;--fd-glow:#213e51;--fd-shadow:0 12px 36px #0003}
html[data-flowdo-theme]{--ink:var(--fd-text);--muted:var(--fd-muted);--line:var(--fd-line);--paper:var(--fd-panel);--wash:var(--fd-bg);--panel:var(--fd-panel);--soft:var(--fd-soft);background:var(--fd-bg);color:var(--fd-text)}
flowdo-theme-picker{display:inline-block;flex-shrink:0;max-width:100%}.flowdo-theme-control{display:flex;align-items:center;gap:10px;margin:0;color:var(--fd-muted);font-size:12px;font-weight:500;white-space:nowrap}
html[data-flowdo-theme] flowdo-theme-picker select{width:auto;min-width:100px;max-width:100%;height:34px;margin:0;border:1px solid var(--fd-line);border-radius:9px;padding:5px 26px 5px 10px;background:var(--fd-panel);color:var(--fd-text);font:inherit;cursor:pointer}
html[data-flowdo-theme] flowdo-theme-picker .flowdo-theme-control{display:flex;flex-direction:row;align-items:center;margin:0;height:100%;font-size:12px}
flowdo-theme-picker select:focus-visible{outline:2px solid var(--fd-accent);outline-offset:2px}
html[data-flowdo-theme] flowdo-theme-picker .flowdo-theme-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;min-width:0;margin:0;padding:0;border:0}
.flowdo-theme-tiles legend{padding:0;margin-bottom:10px;font-size:12px;color:var(--fd-muted)}
html[data-flowdo-theme] .flowdo-theme-tile{position:relative;display:grid;grid-template-columns:16px 1fr;align-items:center;gap:8px;margin:0;padding:10px;min-width:0;border:1px solid var(--fd-line);border-radius:11px;background:var(--fd-panel);color:var(--fd-text);cursor:pointer}
html[data-flowdo-theme] .flowdo-theme-tile:has(input:checked){border-color:var(--fd-accent);background:var(--fd-selected);box-shadow:0 0 0 1px var(--fd-accent)}
html[data-flowdo-theme] .flowdo-theme-tile input{grid-row:2;grid-column:1;width:14px;height:14px;min-height:0;margin:0;padding:0;accent-color:var(--fd-accent);cursor:pointer}
.flowdo-theme-tile input:focus-visible{outline:2px solid var(--fd-accent);outline-offset:3px}
.flowdo-theme-title{grid-row:2;grid-column:2;font-size:12px;white-space:nowrap}
.flowdo-theme-sample{grid-column:1/-1;height:34px;border:1px solid #cfd6e3;border-radius:6px;background:linear-gradient(90deg,#e9edf5 24%,#fff 24%);position:relative;overflow:hidden}
.flowdo-theme-sample:after{content:'';position:absolute;left:34%;right:12%;top:9px;height:3px;background:#bbc6d7;box-shadow:0 8px 0 #bbc6d7}
[data-mode=dark]>.flowdo-theme-sample{border-color:#47536a;background:linear-gradient(90deg,#101827 24%,#28354a 24%)}
[data-mode=system]>.flowdo-theme-sample{background:linear-gradient(110deg,#f7f9fc 50%,#28354a 50%)}
.c-account-menu>flowdo-theme-picker,.account-menu>flowdo-theme-picker{display:block;padding:12px 14px;border-bottom:1px solid var(--fd-line)}.account-menu .flowdo-theme-control,.c-account-menu .flowdo-theme-control{justify-content:space-between}
html[data-flowdo-theme] body{background:var(--fd-bg);color:var(--fd-text)}
html[data-flowdo-theme] .flowdo-v1 :is(.c-main,.c-rail){background:var(--fd-bg);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme] .flowdo-v1 .c-agent-stage{background:radial-gradient(ellipse at 50% 0,var(--fd-glow),var(--fd-panel) 75%);border-color:var(--fd-line);color:var(--fd-text)}
html[data-flowdo-theme] .flowdo-v1 :is(.c-brand,.c-account strong,.c-agent-title h2){color:var(--fd-text)}
html[data-flowdo-theme] .flowdo-v1 :is(.c-agent-title p,.c-nav button,.c-history-head,.c-chat-row,.v1-rail-toggle){color:var(--fd-muted)}
html[data-flowdo-theme] .flowdo-v1 :is(.c-agent-title small,.c-kicker){color:var(--fd-accent)}
html[data-flowdo-theme] .flowdo-v1 :is(.c-nav button.active,.c-nav button:hover,.c-account:hover,.c-account[aria-expanded=true]){background:var(--fd-selected);color:var(--fd-text)}
html[data-flowdo-theme] .flowdo-v1 :is(.c-composer,.c-new-chat,.c-starter-row button,.c-quiet,.c-product-card,.c-plan-card,.c-empty,.c-account-menu,.c-current-plan,.c-modal form,.c-settings-card,.client-main,.client-summary,.timeline,.today,.node-content-block,.client-node-page,.c-tutor-panel,.c-notice-panel,.c-delivery-modal-card,.v1-notification-trigger){background:var(--fd-panel);color:var(--fd-text);border-color:var(--fd-line);box-shadow:var(--fd-shadow)}
html[data-flowdo-theme] .flowdo-v1 :is(.c-composer textarea,.c-account-menu a,.c-account-menu button,.c-starter-row button,.c-quiet,.client-node-page h2){color:var(--fd-text)}
html[data-flowdo-theme] .flowdo-v1 :is(.c-composer textarea,.c-account-menu button,.c-account-menu a){background:transparent}
html[data-flowdo-theme] .flowdo-v1 .c-history{border-color:var(--fd-line)}
/* Merchant shell: retain status badges, primary actions and product artwork. */
html[data-flowdo-theme] body:has(.merchant-only) :is(.main,.sidebar){background:var(--fd-bg);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme] body:has(.merchant-only) :is(.card,.stat,.stats-card,.catalog-card,.product-card,.settings-card,.customer-detail-profile,.account-menu,.notice-panel,.modal-card,.modal-content,.table,.project-list,.customer-list,.client-main,.timeline,.today,.client-summary){background:var(--fd-panel);color:var(--fd-text);border-color:var(--fd-line);box-shadow:var(--fd-shadow)}
html[data-flowdo-theme] body:has(.merchant-only) :is(.nav button,.subbrand,.nav-title,.crumb){color:var(--fd-muted)}
html[data-flowdo-theme] body:has(.merchant-only) :is(.nav button.active,.nav button:hover){background:var(--fd-selected);color:var(--fd-text)}
html[data-flowdo-theme] body:has(.merchant-only) :is(.account-menu a,.account-menu button,.notice-trigger,.btn:not(.primary),.mini-btn){background:var(--fd-panel);color:var(--fd-text);border-color:var(--fd-line)}
/* Native studios and classroom chrome share the same preference in iframes. */
html[data-flowdo-theme] :is(.studio,.canvas-shell,.content-workbench-overlay,.content-workbench,.plan-workspace){background:var(--fd-bg);color:var(--fd-text)}
html[data-flowdo-theme] :is(.studio-header,.inspector,.agent-panel,.content-workbench>header,.content-workbench>footer,.content-workbench-agent,.content-workbench-preview,.design-focus,.delivery-block,.course-canvas-page,.plan-generator,.plan-workspace .course-grid article,.flowdo-classroom,.flowdo-classroom>header,.flowdo-classroom>footer,.flowdo-course-card){background:var(--fd-panel);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme] :is(.plan-workspace,.content-workbench,.studio) :is(.course-actions button,.course-canvas-toolbar button,.course-filmstrip button,.workbench-outline button,.header-actions button:not(.primary),.canvas-caption>div,.canvas-caption button,.block-add-grid button){background:var(--fd-panel);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme] :is(.plan-workspace,.content-workbench,.studio) :is(.workbench-outline,.agent-compose,.agent-quick,.agent-message,.agent-product-context){background:var(--fd-soft);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme] :is(.plan-workspace,.content-workbench,.studio) :is(.course-filmstrip button[aria-pressed=true],.workbench-outline button[aria-pressed=true],.plan-generator button[aria-pressed=true]){background:var(--fd-selected);color:var(--fd-accent);border-color:var(--fd-accent)}
html[data-flowdo-theme] :is(.plan-workspace,.content-workbench,.studio,.flowdo-classroom) :is(input:not([type=checkbox]):not([type=radio]),textarea,select){background:var(--fd-bg);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme] :is(.plan-workspace,.content-workbench,.studio) :is(header p,header small,.course-canvas-toolbar strong,.field-help,.canvas-prose,.design-focus>small){color:var(--fd-muted)}
html[data-flowdo-theme] .plan-generator :is(p,small){color:var(--fd-muted)}
html[data-flowdo-theme] .plan-generator [role=alert]{color:#d96048}
html[data-flowdo-theme] .flowdo-classroom :is(nav,.flowdo-project-task){background:var(--fd-soft);border-color:var(--fd-line)}
html[data-flowdo-theme] .flowdo-classroom :is(nav button,footer button){background:var(--fd-panel);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme] .flowdo-classroom nav button[aria-current=true]{background:var(--fd-selected);color:var(--fd-accent)}
html[data-flowdo-theme=dark] :is(.blueprint-node,.blueprint-node.type-start,.blueprint-node.type-end,.stage-boundary,.react-flow__controls-button,.react-flow__minimap){background:var(--fd-panel);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme=dark] .react-flow{--xy-background-pattern-dots-color-default:#334860;--xy-minimap-background-color-default:#192538;--xy-controls-button-background-color-default:#192538;--xy-controls-button-color-default:#e5edf8}
html[data-flowdo-theme=dark] :is(.blueprint-node>p,.node-meta,.agent-panel header small,.agent-compose-help){color:var(--fd-muted)}
html[data-flowdo-theme=dark] .state{background:var(--fd-soft)}
/* Account dialogs and forms; explicit selectors avoid changing course artwork. */
html[data-flowdo-theme=dark] :is(.flowdo-v1,.main,body:has(.merchant-only)) :is(input:not([type=checkbox]):not([type=radio]),textarea,select){background:var(--fd-bg);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme=dark] :is(.c-account-menu-head,.c-account-summary,.notice-head,.notice-subhead,.notice-footer,.notice-item,.auth-dialog,.auth-body,.read-status,.table-head,.client-node-page-head,.c-tutor-head){background:var(--fd-panel);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme=dark] :is(.c-account-menu small,.c-product-card p,.c-plan-card p,.notice-item p,.notice-item small,.client-summary p,.today p){color:var(--fd-muted)}
@media(max-width:650px){.studio-header .flowdo-theme-control>span{display:none}.studio-header flowdo-theme-picker select{min-width:82px}}
html[data-flowdo-theme] .flowdo-account-settings :is(.card,.identity,.back,.button:not(.primary),input){background:var(--fd-panel);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme] .flowdo-account-settings :is(.title p,.field label,.hint,.identity span,.security){color:var(--fd-muted)}
.flowdo-account-settings .top{flex-wrap:wrap;gap:12px}
html[data-flowdo-theme] .plan-workspace :is(p,.course-grid small){color:var(--fd-muted)}
html[data-flowdo-theme] .plan-workspace .course-grid button{background:var(--fd-panel);color:var(--fd-accent);border-color:var(--fd-line)}
html[data-flowdo-theme=dark] :is(#delivery,#products) .read-status{background:var(--fd-soft);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme=dark] :is(#delivery,#products):is([data-read-state=error],[data-read-state=stale]) .read-status{background:#3e3021;color:#ffdaa5;border-color:#795d37}
html[data-flowdo-theme=dark] :is(.account-plan-summary,.account-plan-usage>div,.page-quota,.tutor-panel,.tutor-panel>header,.tutor-action,.c-msg .bubble){background:var(--fd-panel);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme=dark] :is(.tutor-message.agent,.tutor-compose,.tutor-panel header button,.c-chat-row.active,.c-chat-row:hover){background:var(--fd-soft);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme=dark] .tutor-panel :is(textarea,input){background:var(--fd-bg);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme=dark] .tutor-messages{background:var(--fd-bg)}
html[data-flowdo-theme=dark] :is(.tutor-panel,.c-main,.sidebar,.main) ::placeholder{color:var(--fd-muted);opacity:1}
html[data-flowdo-theme=dark] :is(.c-account-menu>a:hover,.c-account-menu>button:hover,.account-trigger:hover,.account-trigger[aria-expanded=true]){background:var(--fd-selected);color:var(--fd-text)}
html[data-flowdo-theme] :is(.studio,.content-workbench) .agent-context{background:var(--fd-soft);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme] :is(.studio,.content-workbench) .agent-context span{color:var(--fd-muted)}
html[data-flowdo-theme] .content-workbench>header button:not(.primary),html[data-flowdo-theme] .content-workbench :is(.content-workbench-launch,.agent-quick button){background:var(--fd-panel);color:var(--fd-accent);border-color:var(--fd-line)}
/* Merchant directory and billing sub-surfaces. Keep light mode and course artwork intact. */
html[data-flowdo-theme=dark] #customers .directory-toolbar{background:var(--fd-panel);border-color:var(--fd-line)}
html[data-flowdo-theme=dark] #customers :is(.customer-project-chip,.directory-pagination button){background:var(--fd-soft);color:var(--fd-muted);border:1px solid var(--fd-line)}
html[data-flowdo-theme=dark] #customers .customer-project-chip b{color:var(--fd-text)}
html[data-flowdo-theme=dark] #customers :is(.customer-project-chip:hover,.directory-pagination button:not(:disabled):hover,.directory-pagination button.active){background:var(--fd-selected);color:var(--fd-text);border-color:var(--fd-accent)}
html[data-flowdo-theme=dark] #customers :is(.customer-project-chip,.directory-pagination button):focus-visible{outline:2px solid var(--fd-accent);outline-offset:2px}
html[data-flowdo-theme=dark] #customers .directory-pagination button:disabled{background:var(--fd-panel);color:var(--fd-muted);opacity:.55}
html[data-flowdo-theme=dark] #customers .cust .pic{background:var(--fd-selected);color:var(--fd-text)}
html[data-flowdo-theme=dark] #customers .customer-tags i{background:#343153;color:#d5caff}
html[data-flowdo-theme=dark] #customers .customer-state{background:#193d36;color:#97dfbe}
html[data-flowdo-theme=dark] #customers :is(.customer-state.disabled,.customer-state.archived){background:var(--fd-soft);color:var(--fd-muted)}
html[data-flowdo-theme=dark] #settings :is(.billing-plan,.billing-entitlement,.billing-manage){background:var(--fd-soft);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme=dark] #settings .billing-plan{background:linear-gradient(135deg,var(--fd-soft),var(--fd-panel)) var(--fd-soft)}
html[data-flowdo-theme=dark] #settings :is(.billing-plan-kicker,.billing-plan b small){color:var(--fd-accent)}
html[data-flowdo-theme=dark] #settings :is(.billing-plan span,.billing-entitlement span,.billing-manage span){color:var(--fd-muted)}
/* Dialog surfaces must switch together with their text and form controls. */
html[data-flowdo-theme] body:has(.merchant-only) .modal,
html[data-flowdo-theme] .fd-access-dialog{background:var(--fd-panel);color:var(--fd-text);border:1px solid var(--fd-line);box-shadow:var(--fd-shadow)}
html[data-flowdo-theme] body:has(.merchant-only) .modal :is(.modal-head,.modal-body){background:var(--fd-panel);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme] :is(.modal,.fd-access-dialog) .fd-access{background:var(--fd-soft);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme] :is(.modal,.fd-access-dialog) :is(.fd-access-stages,.fd-access select){border-color:var(--fd-line)}
html[data-flowdo-theme] .fd-access-dialog button:not(.primary){background:var(--fd-panel);color:var(--fd-text);border-color:var(--fd-line)}
html[data-flowdo-theme] .modal .customer-detail-profile>div{background:var(--fd-soft);color:var(--fd-text)}
html[data-flowdo-theme] :is(.modal,.fd-access-dialog) :is(input:not([type=checkbox]):not([type=radio]),textarea,select){background:var(--fd-bg);color:var(--fd-text);border-color:var(--fd-line);color-scheme:light}
html[data-flowdo-theme=dark] :is(.modal,.fd-access-dialog) :is(input,textarea,select){color-scheme:dark}
html[data-flowdo-theme] :is(.modal,.fd-access-dialog) ::placeholder{color:var(--fd-muted);opacity:1}
html[data-flowdo-theme] .modal .crm-detail-tabs [aria-selected=true]{background:var(--fd-selected);color:var(--fd-accent);border-color:var(--fd-accent)}
html[data-flowdo-theme=dark] .modal .danger-action{background:#472b31!important;color:#ffa5aa!important;border-color:#74404b!important}
html[data-flowdo-theme=dark] .modal-backdrop{background:rgba(3,8,18,.68)}
html[data-flowdo-theme=dark] .fd-access-dialog::backdrop{background:rgba(3,8,18,.68)}
