/* Phase 3: dashboard paint only. No DOM, dimensions, order or breakpoint changes.
 * Scope follows the existing active navigation item, including on mobile.
 * Existing customer palette variables remain the source of interactive colors.
 */
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]){
  --mayu-dashboard-background:var(--mayu-color-background);
  --mayu-dashboard-surface:var(--mayu-color-surface);
  --mayu-dashboard-border:var(--mayu-panel-border);
  --mayu-dashboard-shadow:var(--mayu-panel-shadow);
  --mayu-dashboard-chrome:var(--mayu-brand-charcoal);
  --mayu-dashboard-chrome-text:var(--mayu-brand-ivory);
  --mayu-dashboard-chrome-muted:var(--mayu-brand-silver);
}
/* Ivory is the finish for the existing Ivory workspace; Rose, Teal and dark
 * workspaces retain their selected surfaces and every palette retains its accent. */
html[data-mayu-palette="light"] .shell:has(.nav button.active[onclick="go('Dashboard')"]){--mayu-dashboard-background:var(--mayu-brand-ivory)}
html[data-mayu-palette]:has(.shell .nav button.active[onclick="go('Dashboard')"]) body{background:var(--mayu-color-background)}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]){background:var(--mayu-dashboard-background);font-family:var(--mayu-font-family)}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) main{background:var(--mayu-dashboard-background);color:var(--mayu-color-text)}

html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) :is(.card,.profit-hero,.context-scope-v9){
  background:var(--mayu-panel-finish)!important;
  border-color:var(--mayu-dashboard-border)!important;
  box-shadow:var(--mayu-dashboard-shadow);
  border-radius:var(--mayu-radius-card);
}
/* Subtle brand ribbons are background paint; they cannot cover controls or move content. */
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) :is(.business-identity-v8137,.profit-goal-top){
  background:linear-gradient(157deg,transparent 67%,color-mix(in srgb,var(--mayu-brand-electric-blue) 13%,transparent) 76%,color-mix(in srgb,var(--mayu-brand-cyan) 35%,transparent) 76.4%,transparent 77.3%),linear-gradient(140deg,var(--mayu-dashboard-surface),color-mix(in srgb,var(--mayu-dashboard-surface) 94%,var(--mayu-brand-silver)))!important;
  border-color:var(--mayu-dashboard-border)!important;
}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) .business-logo-fallback-v8137{
  background:linear-gradient(150deg,color-mix(in srgb,var(--mayu-brand-charcoal) 82%,var(--mayu-brand-electric-blue)),var(--mayu-brand-charcoal));
  color:var(--mayu-brand-ivory);border-color:var(--mayu-brand-electric-blue);box-shadow:0 2px 8px color-mix(in srgb,var(--mayu-brand-electric-blue) 25%,transparent);
}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) :is(.top h1,.business-identity-v8137 h2){font-weight:900;color:var(--mayu-color-text)}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) :is(.profit-number,.big-money,.kpi strong){font-weight:900;font-variant-numeric:tabular-nums;color:var(--mayu-color-text)}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) .label{font-weight:850}

html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) .btn{
  background:var(--mayu-action-finish)!important;
  color:var(--mayu-color-on-action)!important;border-color:var(--mayu-color-action)!important;
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--mayu-brand-ivory) 23%,transparent),0 3px 9px color-mix(in srgb,var(--mayu-color-action) 22%,transparent);font-weight:850;
}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) :is(.btn.secondary,.mini){
  background:linear-gradient(180deg,var(--mayu-color-surface),var(--mayu-color-surface-secondary))!important;
  color:var(--mayu-color-text)!important;border-color:var(--mayu-dashboard-border)!important;box-shadow:inset 0 1px 0 color-mix(in srgb,var(--mayu-brand-ivory) 16%,transparent),0 2px 5px color-mix(in srgb,var(--mayu-brand-charcoal) 7%,transparent);
}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) :is(.mini.active,.scope-option-v9.active){background:var(--mayu-nav-active-fill,var(--mayu-color-action))!important;color:var(--mayu-color-on-action)!important;border-color:var(--mayu-color-action)!important;outline-color:var(--mayu-color-action);box-shadow:var(--mayu-nav-active-shadow,0 2px 8px color-mix(in srgb,var(--mayu-color-action) 24%,transparent))!important}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) .goal-track{background:var(--mayu-color-border)!important;box-shadow:inset 0 2px 4px color-mix(in srgb,var(--mayu-brand-charcoal) 15%,transparent)}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) .goal-fill{background:linear-gradient(180deg,color-mix(in srgb,var(--mayu-color-action) 92%,var(--mayu-brand-cyan)),var(--mayu-color-action));box-shadow:0 0 8px color-mix(in srgb,var(--mayu-color-action) 35%,transparent)}

html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) :is(.sidebar,.sidebar-account,.bottom-nav){
  background:linear-gradient(155deg,color-mix(in srgb,var(--mayu-dashboard-chrome) 92%,var(--mayu-brand-electric-blue)),var(--mayu-dashboard-chrome) 72%,color-mix(in srgb,var(--mayu-dashboard-chrome) 93%,var(--mayu-brand-cyan)))!important;
  color:var(--mayu-dashboard-chrome-text)!important;border-color:color-mix(in srgb,var(--mayu-dashboard-chrome) 72%,var(--mayu-brand-silver))!important;
}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) .sidebar :is(.brand,.sidebar-account strong){color:var(--mayu-dashboard-chrome-text);text-shadow:0 1px 0 color-mix(in srgb,var(--mayu-brand-silver) 35%,transparent)}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) .sidebar :is(.sub,.brand-version,.sidebar-account small,.muted){color:var(--mayu-dashboard-chrome-muted)!important}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) .sidebar :is(.brand-tag,.mayu-ai-nav-v931>span){color:var(--mayu-brand-cyan)!important}
/* A dark sidebar always needs the dark-surface variant, even in a light workspace. */
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) .sidebar img.mayu-brand-mark{content:url('/brand/mayu-mark-dark.png?v=brand2')}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) :is(.nav,.bottom-nav) button{color:var(--mayu-dashboard-chrome-text);font-weight:800}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) :is(.nav,.bottom-nav) button:hover{background:color-mix(in srgb,var(--mayu-color-action) 22%,var(--mayu-dashboard-chrome))!important;color:var(--mayu-dashboard-chrome-text)!important}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) :is(.nav,.bottom-nav) button.active{
  background:var(--mayu-nav-active-fill,linear-gradient(135deg,var(--mayu-color-action),color-mix(in srgb,var(--mayu-color-action) 94%,var(--mayu-brand-charcoal))))!important;color:var(--mayu-color-on-action)!important;
  border-color:var(--mayu-color-action)!important;box-shadow:var(--mayu-nav-active-shadow,inset 0 1px 0 color-mix(in srgb,var(--mayu-brand-ivory) 25%,transparent),0 0 9px color-mix(in srgb,var(--mayu-color-action) 28%,transparent))!important;
}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) .sidebar-account .btn.secondary{background:color-mix(in srgb,var(--mayu-dashboard-chrome) 87%,var(--mayu-brand-silver))!important;color:var(--mayu-dashboard-chrome-text)!important}
html[data-mayu-palette] .shell:has(.nav button.active[onclick="go('Dashboard')"]) :is(button,input,select,textarea):focus-visible{outline-color:var(--mayu-color-focus)}
