It is an abuse of discretion in a civil rights or public interest case (such as this Song-Beverly Act case) to deny attorney fees altogether for time spent after the plaintiff rejects a 998 offer, so long as the plaintiff ultimately recovers more than the 998 offered. Though the trial court retains broad discretion to evaluate post-offer attorney fees and costs under a lodestar analysis, and to reduce the fee recovery in the appropriate circumstance, it may not categorically deny all fees from the date of the offer when the plaintiff’s decision to press forward with litigation has been vindicated by a more favorable judgment or award. Here, defendant ultimately settled for 10% more than its 998 offer, so it was error for the trial court to deny fees for the post-998 attorney time. Nevertheless, the trial court need not award fees for time that was not spent productively after that point.