html.xcg-theme-scope {
  color-scheme: light;
  --xt-page: #f7f7f8; --xt-surface: #fff; --xt-raised: #f0f2f5; --xt-stage: #e7eaef;
  --xt-text: #191c22; --xt-sub: #505968; --xt-soft: #5d6674; --xt-border: #ccd2dc;
  --xt-primary: #20242a; --xt-on-primary: #fff; --xt-accent: #414a9f;
  --xt-accent-surface: #e9ecff; --xt-focus: #4d57b8;
  --xt-success: #176743; --xt-success-bg: #e2f3e8; --xt-warning: #795000; --xt-warning-bg: #fff1cd;
  --xt-danger: #a62839; --xt-danger-bg: #ffe8ec; --xt-shadow: 0 20px 64px #1b22331f;
  --xt-backdrop: #15192370;
}
html.xcg-theme-scope[data-xcg-theme="night"] {
  color-scheme: dark;
  --xt-page: #17191d; --xt-surface: #20242a; --xt-raised: #2a3039; --xt-stage: #15191f;
  --xt-text: #f3f4f6; --xt-sub: #c0c7d2; --xt-soft: #a9b3c0; --xt-border: #485363;
  --xt-primary: #e7ebf0; --xt-on-primary: #17191d; --xt-accent: #c0c9ff;
  --xt-accent-surface: #343c60; --xt-focus: #a6b3ff;
  --xt-success: #a0e9bd; --xt-success-bg: #1a3b2d; --xt-warning: #ffe0a1; --xt-warning-bg: #443820;
  --xt-danger: #ffb2bf; --xt-danger-bg: #492a33; --xt-shadow: 0 24px 70px #0008;
  --xt-backdrop: #080c14b8;
}
html.xcg-theme-scope body { color-scheme: inherit; }
.xcg-theme-switch { position:fixed;left:22px;bottom:22px;z-index:80;width:42px;height:42px;display:grid;place-items:center;padding:9px;border:1px solid var(--xt-border);border-radius:13px;background:var(--xt-surface);color:var(--xt-text);box-shadow:var(--xt-shadow);cursor:pointer;flex:none; }
.xcg-theme-switch.in-topbar { position:static;width:36px;height:36px;box-shadow:none;border-radius:10px; }
.xcg-theme-switch svg { width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round; }
.xcg-theme-switch:hover { background:var(--xt-raised); }
.xcg-theme-switch:focus-visible { outline:2px solid var(--xt-focus);outline-offset:3px; }

/* Account controls are injected after page styles; keep their full state palette scoped. */
html.xcg-theme-scope body .nas-tools { background:var(--xt-raised);border-color:var(--xt-border);box-shadow:none; }
html.xcg-theme-scope body .nas-sep { background:var(--xt-border); }
html.xcg-theme-scope body .nas-icon { color:var(--xt-sub); }
html.xcg-theme-scope body .nas-icon:hover,html.xcg-theme-scope body .nas-icon[aria-expanded=true] { color:var(--xt-accent);background:var(--xt-accent-surface); }
html.xcg-theme-scope body .nas-icon::after { color:var(--xt-text);background:var(--xt-surface);border-color:var(--xt-border); }
html.xcg-theme-scope body .nas-panel { background:var(--xt-raised);border-color:var(--xt-border); }
html.xcg-theme-scope body .nas-row:hover,html.xcg-theme-scope body .nas-row.is-current { background:var(--xt-accent-surface);border-color:var(--xt-border); }
html.xcg-theme-scope body .nas-avatar { color:var(--xt-on-primary);background:var(--xt-primary); }
html.xcg-theme-scope body .nas-name { color:var(--xt-text); }
html.xcg-theme-scope body :is(.nas-note,.nas-add,.nas-hint,.nas-x) { color:var(--xt-sub); }
html.xcg-theme-scope body .nas-mark { color:var(--xt-accent); }
html.xcg-theme-scope body :is(.nas-icon,.nas-row):focus-visible { outline:2px solid var(--xt-focus); }
html.xcg-theme-scope body :is(.nas-danger:hover,.nas-x:hover,.nas-hint.is-error) { color:var(--xt-danger); }
html.xcg-theme-scope body :is(.nas-danger:hover,.nas-x:hover) { background:var(--xt-danger-bg); }

html.xcg-theme-scope body.x-cg-skin #h3-dialogue-warning-modal .history-dialog,
html.xcg-theme-scope body.x-cg-skin #video-script-guide-modal .video-script-guide-panel,
html.xcg-theme-scope body.x-cg-skin #reference-compress-modal .reference-compress-panel,
html.xcg-theme-scope body.x-cg-skin :is(#image-first-notice-modal,#video-first-notice-modal) .video-first-notice-panel {
  background:var(--xt-surface)!important;color:var(--xt-text)!important;border-color:var(--xt-border)!important;box-shadow:var(--xt-shadow);
}
html.xcg-theme-scope body.x-cg-skin .video-script-guide-panel::before,
html.xcg-theme-scope body.x-cg-skin .reference-compress-panel::after { background:none; }
html.xcg-theme-scope body.x-cg-skin :is(.video-script-guide-title,.video-first-notice-title,.video-first-notice-body,.share-confirm-title,.reference-compress-value) { color:var(--xt-text)!important; }
html.xcg-theme-scope body.x-cg-skin :is(.video-script-guide-copy,.video-script-guide-points,.video-first-notice-content,.video-first-notice-content-list,.h3-dialogue-warning-meta,.share-confirm-copy,.share-confirm-note,.reference-compress-status,.reference-compress-label) { color:var(--xt-sub)!important; }
html.xcg-theme-scope body.x-cg-skin :is(.video-script-guide-icon,.video-script-guide-kicker) { color:var(--xt-accent);border-color:var(--xt-border);background:var(--xt-accent-surface); }
html.xcg-theme-scope body.x-cg-skin .video-script-guide-kicker { background:none; }
html.xcg-theme-scope body.x-cg-skin :is(.video-script-guide-optimize,.video-first-notice-confirm) { background:var(--xt-primary)!important;color:var(--xt-on-primary)!important;border-color:var(--xt-primary)!important;box-shadow:none; }
html.xcg-theme-scope body.x-cg-skin .video-script-guide-direct { background:var(--xt-raised);color:var(--xt-text);border-color:var(--xt-border); }
html.xcg-theme-scope body.x-cg-skin .h3-dialogue-warning-banner { background:var(--xt-warning-bg);border-color:var(--xt-border); }
html.xcg-theme-scope body.x-cg-skin :is(.h3-dialogue-warning-icon,.h3-dialogue-warning-label) { color:var(--xt-warning);background:none;border-color:var(--xt-border); }
html.xcg-theme-scope body.x-cg-skin .reference-compress-stat { background:var(--xt-raised)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope body.x-cg-skin .reference-compress-progress { background:var(--xt-stage)!important; }
html.xcg-theme-scope body.x-cg-skin .reference-compress-progress span { background:var(--xt-accent)!important; }
html.xcg-theme-scope body.x-cg-skin #reference-compress-modal :is(.nano-sheet-title,.nano-sheet-kicker,.nano-sheet-sub) { color:var(--xt-sub)!important; }
html.xcg-theme-scope body.x-cg-skin #reference-compress-modal .nano-sheet-title { color:var(--xt-text)!important; }

html.xcg-theme-scope body.x-cg-skin :is(.video-frame-fit-canvas,.video-frame-fit-stage,.video-frame-fit-chip,.video-frame-fit-zoom,.video-frame-fit-canvas-hint) { background:var(--xt-raised);border-color:var(--xt-border);color:var(--xt-text); }
html.xcg-theme-scope body.x-cg-skin .video-frame-fit-stage { background:var(--xt-stage); }
html.xcg-theme-scope body.x-cg-skin :is(.video-frame-fit-chip-label,.video-frame-fit-note,.video-frame-fit-zoom-head,.video-frame-fit-mode span) { color:var(--xt-sub); }
html.xcg-theme-scope body.x-cg-skin .video-frame-fit-chip-value { color:var(--xt-text); }
html.xcg-theme-scope body.x-cg-skin :is(.video-frame-fit-mode,.video-frame-fit-tool) { background:var(--xt-surface);color:var(--xt-text);border-color:var(--xt-border); }
html.xcg-theme-scope body.x-cg-skin :is(.video-frame-fit-mode,.video-frame-fit-tool):is(.active,:hover) { background:var(--xt-accent-surface);color:var(--xt-accent);border-color:var(--xt-focus); }
html.xcg-theme-scope body.x-cg-skin .video-frame-fit-zoom input { accent-color:var(--xt-accent); }
html.xcg-theme-scope body.x-cg-skin #scheduled-generation-edit-modal :is(.scheduled-edit-dialog,.scheduled-edit-head,.scheduled-edit-footer,.scheduled-edit-body) { background:var(--xt-surface);color:var(--xt-text);border-color:var(--xt-border); }
html.xcg-theme-scope body.x-cg-skin #scheduled-generation-edit-modal :is(.scheduled-edit-row,.scheduled-edit-index) { background:var(--xt-raised);border-color:var(--xt-border);color:var(--xt-text); }
html.xcg-theme-scope body.x-cg-skin #scheduled-generation-edit-modal :is(.scheduled-edit-note,.scheduled-edit-label,.scheduled-edit-lock-note) { color:var(--xt-sub); }
html.xcg-theme-scope body.x-cg-skin #scheduled-generation-edit-modal :is(input,select,textarea,option) { background:var(--xt-surface);color:var(--xt-text);border-color:var(--xt-border);color-scheme:inherit; }
html.xcg-theme-scope body.x-cg-skin #scheduled-generation-edit-modal :is(input,textarea)::placeholder { color:var(--xt-soft); }
html.xcg-theme-scope body.x-cg-skin #scheduled-generation-modal :is(.sux-bar,.scheduled-item-thumb) { background:var(--xt-raised);border-color:var(--xt-border); }
html.xcg-theme-scope body.x-cg-skin #scheduled-generation-modal .sux-bar .is-cancelled { background:var(--xt-soft); }

html.xcg-theme-scope body.x-cg-skin :is(.local-image-preview-close,.video-skill-preview-close) { background:var(--xt-surface);color:var(--xt-text);border-color:var(--xt-border); }
html.xcg-theme-scope body.x-cg-skin :is(.local-image-preview-img,.video-skill-preview-dialog) { background:var(--xt-stage);border-color:var(--xt-border);color:var(--xt-text); }
html.xcg-theme-scope body.x-cg-skin .video-skill-preview-title { color:var(--xt-text); }
html.xcg-theme-scope body.x-cg-skin :is(.local-image-preview-close,.video-skill-preview-close):hover { background:var(--xt-raised);border-color:var(--xt-focus); }
html.xcg-theme-scope body.x-cg-skin #recharge-modal .nano-faq details { background:var(--xt-raised);border-color:var(--xt-border);color:var(--xt-text); }
html.xcg-theme-scope body.x-cg-skin #recharge-modal .nano-faq :is(summary,p,li,strong,a) { color:var(--xt-sub); }
html.xcg-theme-scope body.x-cg-skin #recharge-modal .nano-faq summary { color:var(--xt-text); }
html.xcg-theme-scope body.x-cg-skin :is(.nano-page-jump-btn,.nano-form-status) { background:var(--xt-raised);border-color:var(--xt-border);color:var(--xt-text); }
html.xcg-theme-scope body.x-cg-skin .nano-form-status:is(.warning,[data-state="warning"]) { color:var(--xt-warning);background:var(--xt-warning-bg); }
html.xcg-theme-scope body.x-cg-skin .nano-form-status:is(.success,[data-state="success"]) { color:var(--xt-success);background:var(--xt-success-bg); }
html.xcg-theme-scope body.x-cg-skin .nano-form-status:is(.error,[data-state="error"]) { color:var(--xt-danger);background:var(--xt-danger-bg); }
html.xcg-theme-scope body #daily-sign-toast > div,html.xcg-theme-scope body #nano-action-toast > div { background:var(--xt-surface)!important;color:var(--xt-text)!important;border-color:var(--xt-border)!important;box-shadow:var(--xt-shadow)!important; }
html.xcg-theme-scope body #daily-sign-toast i,html.xcg-theme-scope body #nano-action-toast i { color:var(--xt-success)!important; }
html.xcg-theme-scope body :is(.video-script-guide-direct,.video-script-guide-optimize,.video-first-notice-confirm,.video-frame-fit-mode,.video-frame-fit-tool,.video-skill-preview-close,.local-image-preview-close):focus-visible { outline:2px solid var(--xt-focus);outline-offset:3px; }
html.xcg-theme-scope body :is(.video-script-guide-direct,.video-script-guide-optimize,.video-first-notice-confirm,.video-frame-fit-mode,.video-frame-fit-tool):disabled { opacity:1;color:var(--xt-sub)!important;background:var(--xt-raised)!important;border-color:var(--xt-border)!important; }

/* Standalone pages share the same saved XCG theme as Nano. */
html.xcg-theme-scope[data-xcg-page="public"] body { background:var(--xt-page)!important;color:var(--xt-text)!important;--xcg-ink:var(--xt-text);--xcg-muted:var(--xt-sub);--xcg-soft:var(--xt-soft);--xcg-line:var(--xt-border);--xcg-panel:var(--xt-surface);--xcg-soft-panel:var(--xt-raised); }
html.xcg-theme-scope[data-xcg-page="public"] body :is(.glass-nav,nav.glass) { background:var(--xt-surface)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="public"] body :is(.glass-card,.section-card,.policy-content,.page-pill,.page-pill-ghost) { background:var(--xt-surface)!important;border-color:var(--xt-border)!important;color:var(--xt-text)!important; }
html.xcg-theme-scope[data-xcg-page="public"] body :is(h1,h2,h3,h4,strong,.brand-accent,.policy-title,.section-title) { color:var(--xt-text)!important; }
html.xcg-theme-scope[data-xcg-page="public"] body :is(p,li,.text-gray-400,.text-gray-300,.text-white\/70,.footer-meta) { color:var(--xt-sub)!important; }
html.xcg-theme-scope[data-xcg-page="public"] body :is(.page-pill-primary,.primary-button) { background:var(--xt-primary)!important;color:var(--xt-on-primary)!important;border-color:var(--xt-primary)!important; }
html.xcg-theme-scope[data-xcg-page="public"] body a { color:var(--xt-accent); }
html.xcg-theme-scope[data-xcg-page="public"] body :is(input,textarea,select,option) { background:var(--xt-surface)!important;color:var(--xt-text)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="faq"] { --bg:var(--xt-page);--panel:var(--xt-surface);--panel-strong:var(--xt-raised);--border:var(--xt-border);--text:var(--xt-text);--muted:var(--xt-sub);--soft:var(--xt-soft);--gold:var(--xt-accent);--orange:var(--xt-accent);--shadow:var(--xt-shadow); }
html.xcg-theme-scope[data-xcg-page="faq"] body.xcg-faq { background:var(--xt-page);color:var(--xt-text); }
html.xcg-theme-scope[data-xcg-page="faq"] body :is(.brand,.quick-title,h1,.faq-item summary,.answer strong) { color:var(--xt-text); }
html.xcg-theme-scope[data-xcg-page="faq"] body :is(.brand-mark,.back-link,.quick-card,.faq-item,.faq-item[open]) { color:var(--xt-text);background:var(--xt-surface);border-color:var(--xt-border);box-shadow:var(--xt-shadow); }
html.xcg-theme-scope[data-xcg-page="faq"] body :is(.intro,.quick-copy,.answer,.footer) { color:var(--xt-sub); }
html.xcg-theme-scope[data-xcg-page="faq"] body :is(.eyebrow,.note,.faq-item summary::after) { background:var(--xt-accent-surface);color:var(--xt-accent);border-color:var(--xt-border); }
html.xcg-theme-scope[data-xcg-page="faq"] body :is(.gradient-text,.footer a) { color:var(--xt-text); }
html.xcg-theme-scope :is([data-xcg-theme-switch],a,input,textarea,select,button):focus-visible { outline:2px solid var(--xt-focus);outline-offset:2px; }

/* Video workspace keeps its layout and media canvases; only its surface palette changes. */
html.xcg-theme-scope[data-xcg-page="video"] { --bg:var(--xt-page);--panel:var(--xt-surface);--panel-2:var(--xt-raised);--panel-3:var(--xt-stage);--line:var(--xt-border);--line-strong:var(--xt-focus);--text:var(--xt-text);--muted:var(--xt-sub);--soft:var(--xt-soft);--cyan:var(--xt-accent);--cyan-2:var(--xt-focus);--green:var(--xt-success);--danger:var(--xt-danger);--amber:var(--xt-warning);--rose:var(--xt-danger);--violet:var(--xt-accent);--shadow:var(--xt-shadow); }
html.xcg-theme-scope[data-xcg-page="video"] :is(html,body,.workspace) { background:var(--xt-page);color:var(--xt-text); }
html.xcg-theme-scope[data-xcg-page="video"] :is(.topbar,.global-rail,.modal-card,.modal-header,.modal-head,.modal-footer,.sidebar,.project-panel,.task-panel) { background:var(--xt-surface)!important;color:var(--xt-text);border-color:var(--xt-border); }
html.xcg-theme-scope[data-xcg-page="video"] :is(.agent-hero,.agent-input,.field,.select,.modal textarea,.modal select,.modal input,.modal option,.task-card,.asset-card,.shot-card,.project-card,.home-library-card,.xcg-flow-node) { background:var(--xt-surface)!important;color:var(--xt-text)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="video"] .agent-hero::after { background:none; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.rail-btn,.ghost-btn,.icon-btn,.top-btn.secondary,.tool-btn,.home-source-btn,.xcg-flow-switch) { background:var(--xt-raised)!important;color:var(--xt-text)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.rail-btn.active,.mode-choice.active,.home-source-btn.selected) { background:var(--xt-accent-surface)!important;color:var(--xt-accent)!important;border-color:var(--xt-focus)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.primary-btn,.top-btn.primary,.agent-send,.home-primary-action,.new-project-btn) { background:var(--xt-primary)!important;color:var(--xt-on-primary)!important;border-color:var(--xt-primary)!important;box-shadow:none; }
html.xcg-theme-scope[data-xcg-page="video"] :is(button,input,textarea,select):disabled { opacity:1;color:var(--xt-sub)!important;background:var(--xt-raised)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(input,textarea)::placeholder { color:var(--xt-soft)!important;opacity:1; }
html.xcg-theme-scope[data-xcg-page="video"] .trial-limit-overlay { background:var(--xt-backdrop); }
html.xcg-theme-scope[data-xcg-page="video"] .trial-limit-panel { color:var(--xt-text);background:var(--xt-surface);border-color:var(--xt-border);box-shadow:var(--xt-shadow); }
html.xcg-theme-scope[data-xcg-page="video"] :is(.trial-limit-title,.trial-limit-description strong) { color:var(--xt-text); }
html.xcg-theme-scope[data-xcg-page="video"] :is(.trial-limit-description,.trial-limit-close,.trial-limit-secondary) { color:var(--xt-sub); }
html.xcg-theme-scope[data-xcg-page="video"] :is(.trial-limit-symbol,.trial-limit-eyebrow) { color:var(--xt-accent);background:var(--xt-accent-surface);border-color:var(--xt-border); }
html.xcg-theme-scope[data-xcg-page="video"] .trial-limit-eyebrow { background:none; }
html.xcg-theme-scope[data-xcg-page="video"] .trial-limit-primary { background:var(--xt-primary);color:var(--xt-on-primary);border-color:var(--xt-primary); }
html.xcg-theme-scope[data-xcg-page="video"] :is(.trial-limit-close,.trial-limit-secondary):hover { background:var(--xt-raised);color:var(--xt-text); }
@media(max-width:600px) { .xcg-theme-switch:not(.in-topbar) { left:14px;bottom:18px;width:38px;height:38px; } }

html.xcg-theme-scope body.x-cg-skin .share-confirm-kicker { color:var(--xt-accent)!important; }
html.xcg-theme-scope body.x-cg-skin .video-script-guide-points li { color:var(--xt-sub)!important; }
html.xcg-theme-scope body.x-cg-skin .video-script-guide-points li::before { color:var(--xt-success);background:var(--xt-success-bg); }
html.xcg-theme-scope body.x-cg-skin .video-first-notice-media-fallback { background:var(--xt-primary);color:var(--xt-on-primary); }
html.xcg-theme-scope body.x-cg-skin .video-skill-preview-head { background:var(--xt-surface);border-color:var(--xt-border); }
html.xcg-theme-scope body.x-cg-skin :is(#wallet-modal,#orders-modal,#invoice-modal,#recharge-modal,#video-frame-fit-modal) :is(.nano-sheet-kicker,.nano-sheet-sub,.nano-stat-label,.nano-block-note,.nano-page-jump-label,.nano-invoice-summary-label,.nano-empty,.nano-recharge-faq-answer) { color:var(--xt-sub)!important; }
html.xcg-theme-scope body.x-cg-skin #wallet-modal :is(#wallet-stats-total-gens,#wallet-stats-total-cost) { color:var(--xt-sub)!important; }
html.xcg-theme-scope body.x-cg-skin :is(#wallet-modal,#orders-modal,#invoice-modal) button:disabled { opacity:1;color:var(--xt-sub)!important;background:var(--xt-raised)!important; }
html.xcg-theme-scope body.x-cg-skin .nano-required-mark { color:var(--xt-danger)!important; }
html.xcg-theme-scope body.x-cg-skin #recharge-modal :is(details,.nano-recharge-faq-item) { background:var(--xt-raised)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope body.x-cg-skin #recharge-modal :is(.nano-recharge-faq-question,summary) { color:var(--xt-text)!important; }
html.xcg-theme-scope body.x-cg-skin #recharge-modal .nano-recharge-tools span { color:var(--xt-sub); }
html.xcg-theme-scope[data-xcg-page="video"] :is(.home-canvas,.home-canvas-stage,.home-flow-editor,.home-script-form,.home-script-stage,.home-script-input,.home-project-dock) { background:var(--xt-raised)!important;color:var(--xt-text);border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="video"] .home-canvas::before { opacity:0; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.home-canvas-head,.home-canvas-context-copy span,.home-project-dock-label,.xcg-flow-copy small) { color:var(--xt-sub)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.home-canvas-context-copy strong,.xcg-flow-node-main,.xcg-flow-copy strong) { color:var(--xt-text)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.xcg-flow-node.off,.xcg-flow-node.locked) { opacity:1; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.xcg-flow-icon,.xcg-flow-status,.home-project-all) { background:var(--xt-raised)!important;color:var(--xt-sub)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="video"] .xcg-flow-node.active .xcg-flow-status { background:var(--xt-accent-surface)!important;color:var(--xt-accent)!important; }
html.xcg-theme-scope[data-xcg-page="video"] .xcg-flow-node.done .xcg-flow-status { background:var(--xt-success-bg)!important;color:var(--xt-success)!important; }
html.xcg-theme-scope[data-xcg-page="video"] .home-script-input { background:var(--xt-surface)!important;color:var(--xt-text)!important; }
html.xcg-theme-scope[data-xcg-page="video"] .home-script-input::placeholder { color:var(--xt-soft)!important; }
html.xcg-theme-scope[data-xcg-page="video"] .floating-asset-library { background:var(--xt-primary)!important;color:var(--xt-on-primary)!important;border-color:var(--xt-primary)!important; }
html.xcg-theme-scope[data-xcg-page="public"] body :is([class*="text-indigo-"],[class*="text-fuchsia-"],[class*="text-rose-"]) { color:var(--xt-accent)!important; }
html.xcg-theme-scope[data-xcg-page="public"] body [class*="text-amber-"] { color:var(--xt-warning)!important; }
html.xcg-theme-scope[data-xcg-page="public"] body [class*="bg-amber-"] { background:var(--xt-warning-bg)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="public"] body [class*="bg-white/"] { background:var(--xt-raised)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="public"] body .policy-highlight { background:var(--xt-accent-surface)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="public"] body .policy-highlight :is(p,strong) { color:var(--xt-text)!important; }
html.xcg-theme-scope[data-xcg-page="public"] body .policy-content a { color:var(--xt-accent)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.project-toolbar-btn,.side-action,.floating-library-filter,.floating-library-search,.floating-library-upload) { background:var(--xt-raised)!important;color:var(--xt-text)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.floating-library-kicker,.floating-library-sub,.floating-library-title) { color:var(--xt-text)!important; }
html.xcg-theme-scope[data-xcg-page="video"] .floating-library-toolbar { background:var(--xt-raised);border-color:var(--xt-border); }
html.xcg-theme-scope[data-xcg-page="video"] .inspector-label { color:var(--xt-sub); }
html.xcg-theme-scope[data-xcg-page="video"] .generation-confirm-warning { color:var(--xt-warning);background:var(--xt-warning-bg);border-color:var(--xt-border); }
html.xcg-theme-scope[data-xcg-page="video"] :is(button,input,textarea,select,option) { color:var(--xt-text)!important;background-color:var(--xt-raised)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.left-panel,.right-panel,.inspector,.project-sidebar,.reference-board,.storyboard,.inspector-section,.shot-more-menu,.timeline,.preset-create,.consistency-card,.reference-set-card) { background:var(--xt-surface)!important;color:var(--xt-text);border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.inspector-note,.agent-source,.mode-badge,.reference-set-empty,.track-label,.preset-composer summary,.reference-quick-create strong) { color:var(--xt-sub)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.reference-set-media,.reference-set-status,.shot-status,.shot-number) { color:var(--xt-text);background:var(--xt-raised);border-color:var(--xt-border); }
html.xcg-theme-scope[data-xcg-page="video"] .toast { color:var(--xt-text);background:var(--xt-surface);border-color:var(--xt-border); }
html.xcg-theme-scope[data-xcg-page="video"] .toast.error { color:var(--xt-danger);background:var(--xt-danger-bg); }
html.xcg-theme-scope[data-xcg-page="video"] button.danger { color:var(--xt-danger)!important;background:var(--xt-danger-bg)!important; }
html.xcg-theme-scope[data-xcg-page="video"] .react-flow { --xy-background-color:var(--xt-stage);--xy-background-pattern-dots-color:var(--xt-border);--xy-node-color:var(--xt-text);--xy-node-background-color:var(--xt-surface);--xy-edge-stroke:var(--xt-accent);--xy-edge-stroke-selected:var(--xt-focus);--xy-edge-label-background-color:var(--xt-surface);--xy-edge-label-color:var(--xt-text);--xy-controls-button-background-color:var(--xt-surface);--xy-controls-button-color:var(--xt-text);--xy-minimap-background-color:var(--xt-raised); }
html.xcg-theme-scope[data-xcg-page="video"] .react-flow__attribution a { color:var(--xt-sub); }
html.xcg-theme-scope[data-xcg-page="video"] :is(.primary-btn,.top-btn.primary,.agent-send,.home-primary-action,.new-project-btn,.floating-asset-library,.trial-limit-primary) { background:var(--xt-primary)!important;color:var(--xt-on-primary)!important;border-color:var(--xt-primary)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.primary-btn,.top-btn.primary,.agent-send,.home-primary-action,.new-project-btn,.floating-asset-library,.trial-limit-primary):disabled { color:var(--xt-sub)!important;background:var(--xt-raised)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.primary-btn,.top-btn.primary,.agent-send,.home-primary-action,.new-project-btn,.floating-asset-library,.trial-limit-primary) :is(span,strong,small) { color:inherit!important; }
html.xcg-theme-scope body.x-cg-skin #scheduled-generation-edit-modal .scheduled-edit-title { color:var(--xt-text); }
html.xcg-theme-scope[data-xcg-page="video"] :is(.project-folder-item,.project-folder-create,.project-folders) { background:var(--xt-surface)!important;border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="video"] .project-folder-item.active { background:var(--xt-accent-surface)!important;border-color:var(--xt-focus)!important; }
html.xcg-theme-scope[data-xcg-page="video"] .project-folder-name { color:var(--xt-text)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.project-folder-count,.project-folder-empty) { color:var(--xt-sub)!important; }
html.xcg-theme-scope[data-xcg-page="video"] .autosave { color:var(--xt-success); }
html.xcg-theme-scope body.x-cg-skin .video-first-notice-content-list li::before { color:var(--xt-accent);background:var(--xt-accent); }
html.xcg-theme-scope body.x-cg-skin :is(.video-first-notice-content,.video-script-guide-copy,.h3-dialogue-warning-banner) strong { color:var(--xt-text); }
html.xcg-theme-scope body.x-cg-skin .video-first-notice-content a { color:var(--xt-accent); }
html.xcg-theme-scope body.x-cg-skin #recharge-modal .nano-recharge-ticker-item span { color:var(--xt-sub)!important; }
html.xcg-theme-scope body.x-cg-skin #recharge-modal .nano-recharge-ticker-item .nano-recharge-ticker-credit { color:var(--xt-success)!important; }
html.xcg-theme-scope body.x-cg-skin #recharge-modal .nano-recharge-badge:is(.is-newcomer,.is-enterprise) { background:var(--xt-accent-surface)!important;color:var(--xt-accent)!important;border-color:var(--xt-border)!important; }

/* Full-page asset library shares the site palette with its floating view. */
html.xcg-theme-scope[data-xcg-page="video"] :is(.asset-library-toolbar,.asset-library-search,.library-project-section) { background:var(--xt-surface)!important;color:var(--xt-text);border-color:var(--xt-border)!important; }
html.xcg-theme-scope[data-xcg-page="video"] :is(.asset-library-search>span,.asset-library-count,.library-project-meta,.library-empty) { color:var(--xt-sub)!important; }
html.xcg-theme-scope[data-xcg-page="video"] .library-project-title { color:var(--xt-text)!important; }
