The attorney's fee: compensation for the work
The contingency fee is the attorney's own compensation for handling the case — calculated as a percentage of the settlement or award. It's earnings, not a reimbursement, and it's what the attorney keeps for taking on the risk and the work of the case.
Case costs: real expenses the case required
Case costs are something entirely different: actual out-of-pocket expenses the case genuinely needed. This typically includes expert witness fees, court filing fees, the cost of obtaining medical records, deposition transcripts, and similar litigation expenses. These are reimbursed, not earned.
California's statute draws a specific line
For medical malpractice cases, Business and Professions Code § 6146 states explicitly that costs of medical care incurred by the plaintiff, and the attorney's own office-overhead costs or charges, are not deductible disbursements for purposes of calculating the capped fee. In other words, the statute closes off specific categories an attorney might otherwise try to subtract before applying the percentage — a level of detail most states' general fee rules don't bother with.
Why the order genuinely matters
Calculating the attorney's fee as a percentage of the full settlement before subtracting case costs produces a different net result than calculating the fee after costs have already been subtracted. On a meaningful settlement with real litigation costs, that difference in methodology can add up to a real dollar amount — worth confirming explicitly in the written fee agreement rather than assuming either approach.
Who fronts the money while the case is pending
Commonly, the attorney's office advances case costs as the litigation proceeds, with reimbursement coming out of the eventual settlement or award. The specific arrangement, including what happens to those advanced costs if the case doesn't result in any recovery, depends on the individual fee agreement.