/* Shared colors only. Existing page, editor, canvas and CMS geometry is retained. */
html[data-theme="dark"]{
  --site-bg:#071425;--site-surface:#10233b;--site-soft:#152c48;
  --site-ink:#edf5ff;--site-muted:#aac0d8;--site-line:#2e4968;
  --site-chrome:#07162a;--site-sidebar:#0b213a;--site-input:#0b1c32;
  --site-accent:#51b1ff;--site-accent-hover:#71bfff;--site-accent-soft:#163d66;
  --site-primary:#0874e6;--site-primary-hover:#0762c4;
  --site-shadow:0 10px 26px #00000026;--site-success:#96e8be;
  --site-success-bg:#123c30;--site-warning:#ffdc8b;--site-warning-bg:#473817;
  --site-danger:#ffb9bd;--site-danger-bg:#44232e;
  color-scheme:dark;
}
html[data-theme="light"]{
  --site-bg:#f3f7fc;--site-surface:#ffffff;--site-soft:#eaf2fb;
  --site-ink:#142b45;--site-muted:#526d88;--site-line:#c7d8eb;
  --site-chrome:#ffffff;--site-sidebar:#e8f1fb;--site-input:#ffffff;
  --site-accent:#0769cc;--site-accent-hover:#075aaa;--site-accent-soft:#deedff;
  --site-primary:#0769cc;--site-primary-hover:#075aaa;
  --site-shadow:0 8px 24px #17395c0d;--site-success:#146844;
  --site-success-bg:#e3f6eb;--site-warning:#785309;--site-warning-bg:#fff1c9;
  --site-danger:#9a263a;--site-danger-bg:#ffebee;
  color-scheme:light;
}
html[data-theme][data-site-theme] body[class]{
  --bg:var(--site-bg)!important;--panel:var(--site-surface)!important;--surface:var(--site-surface)!important;
  --ink:var(--site-ink)!important;--muted:var(--site-muted)!important;--line:var(--site-line)!important;
  --border:var(--site-line)!important;--soft:var(--site-soft)!important;--navy:var(--site-chrome)!important;
  --blue:var(--site-accent)!important;--shadow:var(--site-shadow)!important;
  --card-face:var(--site-surface)!important;--card-border:var(--site-line)!important;
  --card-depth-edge:var(--site-line)!important;--card-depth-near:#00000012!important;--card-depth-far:#00000012!important;
  background:var(--site-bg)!important;color:var(--site-ink)!important;
  font-family:Inter,"Noto Sans Khmer",system-ui,sans-serif;
}
html[data-theme][data-site-theme] body[class] :is(.public-page-main,.cms-page-main,.cms-main,.account-main,.workspace,.site-main,.page-head,.page-hero,.product-hero,.section.soft,.cms-layout,.cms-auth-panel,.auth-wrap,.auth-shell,.sticky-cms-top,.cms-top,.sticky-workspace-head,.dashboardWorkspace){
  background:var(--site-bg)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important;
}
html[data-theme][data-site-theme] body[class] :is(.account-head,.workspace-head,.coming-soon-card,.tool-how aside,.tool-detail-meta,.tool-how,.tool-catalog-card,.steps article,.business-paths article,.security-points span,.integration-status,.appearance-demo,.seo-box,.free-upgrade-hint){background:var(--site-surface)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] :is(.cookie-banner-copy span,.tool-detail-meta span,.tool-how li,.cms-footnote,.security-list span,.integration-status small){color:var(--site-muted)!important}
html[data-theme][data-site-theme] body[class] :is(.site-header,.showcase-header,.cms-header-bar,.site-footer,.showcase-footer,.showcase-mobile-drawer){
  background:var(--site-chrome)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important;
}
html[data-theme][data-site-theme] body[class] :is(.brand,.brand span,.showcase-desktop-nav a,.cms-header-shortcuts a,.site-header .btn.ghost,.site-footer b,.site-footer a,.showcase-footer a,.showcase-mobile-drawer a,.showcase-mobile-drawer .brand,.mobile-drawer-head button){color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] :is(.cms-side,.cms-sidebar,.app-sidebar,.account-side,.sticky-sidebar){background:var(--site-sidebar)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] :is(.cms-side nav a,.cms-sidebar nav a,.app-sidebar a,.account-side a,.profile-copy b,.profile-badge b,.cms-brand,.cms-brand span){color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] :is(.cms-nav-grouped a.active,.cms-nav a.active,.account-nav a.active,.app-sidebar a.active,.cms-header-shortcuts a.active){background:var(--site-accent-soft)!important;color:var(--site-ink)!important;border-color:var(--site-accent)!important;box-shadow:inset 3px 0 var(--site-accent)!important}
html[data-theme][data-site-theme] body[class] :is(.cms-nav-grouped a:hover,.cms-nav a:hover,.account-nav a:hover,.app-sidebar a:hover,.cms-header-shortcuts a:hover,.showcase-mobile-drawer nav a:hover){background:var(--site-soft)!important;color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] :is(.product-card,.panel,.info-card,.auth-card,.checkout-card,.cms-card,.cms-metrics>div,.metric-grid>article,.metric-row>div,.stat-grid>article,.template-card,.project-card,.price,.about-hero-v42,.about-values article,.team-v42-card,.guides-v42-grid article,.showcase-category,.showcase-section,.showcase-feature-panel,.showcase-app-card,.showcase-media-card,.showcase-guide-card,.search-result,.service-grid article,.business-paths article,.hire-form,.hire-side,.hire-form-wrap,.team-card,.product-tab-panel,.connection-box,.cms-login-card,.modern-cms-login,.cms-user-row,.person-card,.about-story-card,.free-allowance-card,.account-shortcuts a,.ops-launch-grid a,.product-tech-card){
  background:var(--site-surface)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important;box-shadow:var(--site-shadow)!important;
}
html[data-theme][data-site-theme] body[class] :is(.profile-badge,.sidebar-profile,.cms-profile,.preview-visual-group,.preview-visual-links,.account-profile,.cms-permission-list label,.permission-chip,.permission-check,.checkout-product,.package-option,.version-row span,.feature-list li,.plan-badge,.payment-note,.account-request-note,.cms-user-manage-form,.seo-preview-card,.builtin-font-preview span,.cms-profile-actions a,.account-nav-secondary a,.free-feature-chips span,.dashboard-mobile-nav a,.connection-summary-grid>div){
  background:var(--site-soft)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important;
}
html[data-theme][data-site-theme] body[class] :is(h1,h2,h3,h4,.showcase-category b,.showcase-section h2,.showcase-feature-panel h2,.showcase-app-card b,.showcase-guide-card b,.showcase-media-card>b,.panel b,.cms-card b,.stat-grid article b,.free-allowance-card b,.search-result b,.about-values b,.profile-copy b,.profile-badge b,.profile-detail b){color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] :is(p,.muted,.lead,.safe-note,.form-help,.showcase-trust,.showcase-category small,.showcase-app-card small,.showcase-section-head p,.cms-page-copy,.cms-nav-label,.side-section-title,.profile-copy small,.profile-badge small,.stat-grid article span,.stat-grid article small,.metric-grid article span,.metric-grid article small,.cms-metrics span,.cms-metrics small,.rank-row span,.ops-launch-grid span,.about-values p,.team-v42-card p,.guides-v42-grid p,.showcase-footer p,.showcase-footer small,.site-footer small,.profile-detail span,.product-meta,.product-meta em,.cms-card small,.request-row small,.request-handled-note){color:var(--site-muted)!important}
html[data-theme][data-site-theme] body[class] :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=color]),select,textarea){background:var(--site-input)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] :is(input,textarea)::placeholder{color:var(--site-muted)!important;opacity:1}
html[data-theme][data-site-theme] body[class] :is(input[type=checkbox],input[type=radio],input[type=range]){accent-color:var(--site-accent)}
html[data-theme][data-site-theme] body[class] :is(.preview-header-search,.header-search){background:var(--site-input)!important;color:var(--site-muted)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] .preview-header-search input[type=search]{background:transparent!important;color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] :is(.showcase-theme-toggle,.showcase-mobile-toggle,.cms-sidebar-toggle,.icon-btn,.btn.ghost,.btn.bright,.btn.secondary,.btn:not(.primary):not(.danger):not(.hire),.showcase-btn.secondary,.preview-browse-apps,.showcase-section-head>a,.cms-terminal-message,.search-hint,.profile-logout,.cookie-settings-link,.showcase-socials a){
  background:var(--site-soft)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important;
}
html[data-theme][data-site-theme] body[class] :is(.btn.primary,.showcase-btn.primary,.showcase-login,.card-action,.buy-pill){background:var(--site-primary)!important;color:#ffffff!important;border-color:var(--site-primary)!important}
html[data-theme][data-site-theme] body[class] :is(.btn.primary:hover,.showcase-btn.primary:hover,.showcase-login:hover,.card-action:hover,.buy-pill:hover){background:var(--site-primary-hover)!important}
html[data-theme][data-site-theme] body[class] :is(.eyebrow,.showcase-section-label,.preview-visual-group summary,.section-head>a,.panel-head>a,.search-result span,.mini-link,.preview-visual-links a,.guides-v42-grid a,.showcase-app-card strong){color:var(--site-accent)!important}
html[data-theme][data-site-theme] body[class] .eyebrow{background:var(--site-accent-soft)!important}
html[data-theme][data-site-theme] body[class] :is(.table-wrap,.responsive-table,.ops-table-scroll,.order-row,.rank-row,.lead-row,.health-list>div,.request-row,.profile-detail,.ops-section-head,.editor-section-head,.card-bottom){border-color:var(--site-line)!important;color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] :is(th,.cms-user-manage-form,.empty,.search-empty,.checklist label,.price-table-head){background:var(--site-soft)!important;color:var(--site-muted)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] :is(td,td code,label,legend,.permission-grid span,.cms-permission-list b){color:var(--site-ink)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] :is(.status.on,.status.paid,.status.completed,.secure-chip){background:var(--site-success-bg)!important;color:var(--site-success)!important}
html[data-theme][data-site-theme] body[class] :is(.status.pending,.status.review,.status.configuring,.inline-alert.warning){background:var(--site-warning-bg)!important;color:var(--site-warning)!important}
html[data-theme][data-site-theme] body[class] :is(.status.off,.status.cancelled,.inline-alert.danger,.inline-alert.error,.danger-soft){background:var(--site-danger-bg)!important;color:var(--site-danger)!important;border-color:var(--site-danger)!important}
html[data-theme][data-site-theme] body[class] :is(.inline-alert.success,.flash.success){background:var(--site-success-bg)!important;color:var(--site-success)!important}
html[data-theme][data-site-theme] body[class] :is(.cookie-banner,.cookie-modal,.app-toast,.app-modal-card,.editor-top,.inspector,.editor-status,.data-drawer,.editor-tool-flyout,.visual-picker-menu,.editor-sidebar){background:var(--site-surface)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] :is(.modal,.app-modal,.modal-message,.modal-head,.chat-admin-panel,.chat-thread-list,.chat-thread,.chat-messages,.message-terminal,.message-box,.chat-card){background:var(--site-surface)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] :is(.btn.danger,.btn.danger-outline){background:var(--site-danger-bg)!important;color:var(--site-danger)!important;border-color:var(--site-danger)!important}
html[data-theme][data-site-theme] body[class] .btn.hire{background:var(--site-primary)!important;color:#fff!important;border-color:var(--site-primary)!important}
html[data-theme][data-site-theme] body[class] :is(.inspector label,.section-mini-title,.turtle-workspace-head small,.data-drawer small,.data-drawer label,.editor-status,.inspector-tabs button){color:var(--site-muted)!important}
html[data-theme][data-site-theme] body[class] .visual-cms-frame{background:var(--site-bg)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] .central-cms-embedded{background:var(--site-bg)!important}
html[data-theme][data-site-theme] body[class] .showcase-hero h1{color:transparent!important}
html[data-theme="light"][data-site-theme] body[class] :is(.showcase-home:before,.showcase-hero-art){filter:none}
html[data-theme][data-site-theme] body[class] :is(.showcase-hero h2,.showcase-hero-copy>p,.about-story-v42 h2,.about-team-v42 h2,.about-long-v42 h2,.about-visual-v42 h2){color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] :is(.guides-hero-v42,.about-visual-v42,.company-page-hero,.hire-hero,.cms-auth-hero){background:var(--site-soft)!important;color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] :is(.guides-hero-v42 h1,.company-page-hero h1,.company-page-hero p,.company-page-hero .eyebrow){color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] :is(.lab-workspace,.lab-controls,.lab-stage,.lab-controls-head,.quiz-card,.lab-note,.program-panel,.lab-scorebar,.lab-header){background:var(--site-surface)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] :is(.quiz-answer,.lab-tip,.lab-status,.program-empty){background:var(--site-soft)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] .quiz-answer.correct{background:var(--site-success-bg)!important;color:var(--site-success)!important;border-color:var(--site-success)!important}
html[data-theme][data-site-theme] body[class] .quiz-answer.incorrect{background:var(--site-danger-bg)!important;color:var(--site-danger)!important;border-color:var(--site-danger)!important}
html[data-theme][data-site-theme] body[class] .showcase-theme-toggle :is(.sun,.moon){color:var(--site-muted)!important}
html[data-theme="dark"][data-site-theme] body[class] .showcase-theme-toggle .moon,html[data-theme="light"][data-site-theme] body[class] .showcase-theme-toggle .sun{color:var(--site-accent)!important}
/* Finish mapping legacy fixed colors to the shared palette. These selectors
   affect page controls and editor chrome; visual canvas colors stay editable. */
html[data-theme][data-site-theme] body[class] :is(.app-art-caption,.mini-features span,.hire-notes span,.hire-hero aside span,.learning-card-copy small,.tool-detail-meta b,.catalog-intro small,.catalog-group-name,.catalog-lock,.editor-mode-label){color:var(--site-muted)!important}
html[data-theme][data-site-theme] body[class] :is(.showcase-kicker,.card-bottom strong,.catalog-intro b,.catalog-label,.site-header nav a,.data-drawer summary){color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] :is(.card-bottom>a,.lab-start,.lab-info){color:var(--site-accent)!important}
html[data-theme][data-site-theme] body[class] .card-bottom>a{background:var(--site-soft)!important;border-color:var(--site-line)!important;box-shadow:none!important}
html[data-theme][data-site-theme] body[class] :is(.account-menu-toggle,.account-close,.template-filter button,.health-list>div,.invoice-finance-list,.key-count-grid>a,.switch-row,.security-list span,td code,.hire-hero aside){background:var(--site-soft)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] :is(.template-filter button.active,.key-count-grid>a.active){background:var(--site-accent-soft)!important;border-color:var(--site-accent)!important}
html[data-theme][data-site-theme] body[class] .key-count-grid small{color:var(--site-muted)!important}
html[data-theme][data-site-theme] body[class] :is(.cms-profile small,.cms-login-card .auth-brand span,.lab-eyebrow,.lab-scorebar>span,#saveState){color:var(--site-muted)!important}
html[data-theme][data-site-theme] body[class] :is(.cms-login-card .auth-brand,.cms-login-card .auth-brand b,.cms-login-card .auth-foot,.editor-side-bottom a,.lab-scorebar b){color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] .invoice-finance-list .vat :is(span,strong){color:var(--site-accent)!important}
html[data-theme][data-site-theme] body[class] .key-count-grid>a>span{color:var(--site-success)!important}
html[data-theme][data-site-theme] body[class] :is(.app-platform,.project-preview>span,.quiz-answer>span){background:var(--site-soft)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body.editor-page .learning-mode .canvas-card{background:var(--site-surface)!important;color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] :is(.rhythm-transport span,.typing-passages small,.program-panel>.row small,.flash-study-card small,.flash-study-card span){color:var(--site-muted)!important}
html[data-theme][data-site-theme] body[class] .flash-study-card{background:var(--site-soft)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important}
/* The editable table follows its chosen design text color, like chart and
   Turtle exports, rather than inheriting the surrounding app's text palette. */
html[data-theme][data-site-theme] body[class] .table-visual :is(td,table){color:inherit!important}
html[data-theme][data-site-theme] body[class] .table-visual th{background:#eaf2ff!important;color:#142b45!important}
html[data-theme][data-site-theme] body[class] .visual-catalog{background:var(--site-surface)!important;color:var(--site-ink)!important;scrollbar-color:var(--site-line) transparent}
html[data-theme][data-site-theme] body[class] .visual-catalog button{color:var(--site-ink)!important;background:transparent!important}
html[data-theme][data-site-theme] body[class] .visual-catalog button:is(:hover,.active){background:var(--site-accent-soft)!important;color:var(--site-ink)!important}
/* Product artwork uses fixed light gradients in the older design layer.
   Override the complete background in dark mode, including its depth edge. */
html[data-theme="dark"][data-site-theme] body[class] :is(.product-art,.main-preview){
  --app-bg:var(--site-soft);background:var(--site-soft)!important;
  color:var(--site-ink)!important;border-color:var(--site-line)!important;
  box-shadow:inset 0 1px #aac0d812,0 3px 0 #050d18,0 12px 25px #00000018!important;
}
html[data-theme="dark"][data-site-theme] body[class] .real-app-art:before{background:radial-gradient(circle,#51b1ff12,transparent 68%);border-color:var(--site-line)}
html[data-theme="dark"][data-site-theme] body[class] :is(.product-art .art-icon,.detail-art-icon){color:var(--site-muted)!important;text-shadow:none!important}
html[data-theme][data-site-theme] body[class] :is(.product-thumbs button,.download-callout,.release-list article,.product-hire-band){background:var(--site-soft)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] :is(.product-tech-card b,.package-option b,.package-option strong,.metric-row b,.account-shortcuts b,.account-request summary){color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] :is(.product-tech-card span,.package-option small,.release-list small,.metric-row span,.account-shortcuts span){color:var(--site-muted)!important}
html[data-theme][data-site-theme] body[class] .product-overview-section{border-color:var(--site-line)!important}
html[data-theme="dark"][data-site-theme] body[class] :is(.page-hero,.package-option,.details-grid>article,.product-thumbs button,.download-callout,.release-list article,.btn.ghost){border-color:var(--site-line)!important;box-shadow:var(--site-shadow)!important}
html[data-theme][data-site-theme] body[class] .download-callout strong{color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] .release-plan-label{background:var(--site-soft)!important;color:var(--site-muted)!important;border-color:var(--site-line)!important}
html[data-theme][data-site-theme] body[class] .hire-side-card{background:var(--site-surface)!important;color:var(--site-ink)!important;border-color:var(--site-line)!important;box-shadow:var(--site-shadow)!important}
html[data-theme][data-site-theme] body[class] .hire-side-card b{color:var(--site-ink)!important}
html[data-theme][data-site-theme] body[class] .hire-side-card span{color:var(--site-muted)!important}
@media print{html[data-theme][data-site-theme] body[class]{--site-bg:#fff;--site-surface:#fff;--site-soft:#f5f5f5;--site-ink:#111;--site-muted:#444;--site-line:#ccc;color-scheme:light}}
