
179 Cal.App.4th 1082 (2009)
ONE STAR, INC., Plaintiff, Cross-defendant, and Respondent,
v.
STAAR SURGICAL COMPANY, Defendant, Cross-complainant, and Appellant.
No. B212098.
Court of Appeals of California, Second District, Division Four.
November 30, 2009.
*1085 Scheper Kim & Overland, Diann H. Kim, Annah S. Kim and William Forman for Defendant, Cross-complainant and Appellant.
Davis Zfaty, Isaac R. Zfaty; Jeffer Mangels Butler & Marmaro, Mark S. Adams and Monica Vu for Plaintiff, Cross-defendant and Respondent.

OPINION
SUZUKAWA, J. 

INTRODUCTION
Code of Civil Procedure section 998 (section 998) provides that if a plaintiff does not accept a defendant's pretrial settlement offer and then fails to obtain a more favorable judgment at trial, the defendant may recover its costs incurred after the settlement offer. Here, defendant/appellant STAAR Surgical Company (STAAR) made two separate pretrial offers to settle plaintiff/respondent One Star, Inc.'s claims against it, but withdrew the second settlement offer before its statutory expiration. One Star did not accept either offer, and ultimately recovered less at trial than either of STAAR's pretrial offers. The present appeal thus presents the following issue: If a defendant makes two separate pretrial settlement offers but withdraws the second offer, against which offer, if either, is the ultimate judgment measured for purposes of section 998's cost-shifting provisions?
We conclude, contrary to the trial court, that where a defendant withdraws a second section 998 settlement offer, the plaintiff's recovery must be measured against the defendant's first settlement offer for section 998 purposes. Thus, we reverse the judgment with directions to the trial court to calculate the postoffer costs to which STAAR is entitled.

PROCEDURAL HISTORY

I. The Pleadings

STAAR manufactures and sells medical products and devices. One Star is a regional representative for medical equipment and supply companies, and it formerly represented STAAR.
*1086 On November 27, 2006, One Star filed a complaint against STAAR for breach of contract, intentional interference with contractual relations, intentional interference with prospective economic advantage, misappropriation of trade secrets, and unfair competition. The complaint alleged that STAAR improperly withheld One Star's commissions and solicited One Star's employees and independent contractors. STAAR filed a cross-complaint for breach of contract against One Star and James Greiling, One Star's principal, on April 4, 2007.
The trial court dismissed several of One Star's claims prior to trial. Thus, at trial One Star pursued only two claims: breach of written contract (for wrongfully deducting "consulting fees" from One Star's commissions from Aug. 2003 to Dec. 31, 2005) and common counts (for services performed from Jan. 1, 2006, to the date of trial). STAAR pursued its cross-claim for breach of written contract.

II. STAAR's Section 998 Offers to Compromise

On September 12, 2007, STAAR made a statutory offer to compromise pursuant to section 998. STAAR offered "to allow judgment to be taken against STAAR and in favor of [One Star] in the amount of Sixty Five Thousand Dollars ($65,000)." One Star did not accept the offer, and it lapsed by operation of law 30 days later. (§ 998, subd. (b)(2).)
STAAR made a second offer to compromise (captioned "Code of Civil Procedure Section 998 Second Offer to Compromise") on December 7, 2007. STAAR offered "to allow judgment to be taken against STAAR and in favor of [One Star] in the amount of Sixty Five Thousand Dollars ($65,000), including the legal applicable rate of interest, commencing from October 3, 2006." While that offer was pending, STAAR made a third offer to compromise (captioned "Code of Civil Procedure Section 998 Offer to Compromise by Complainant on Cross-Complaint") on December 14, 2007, offering "to allow judgment to be taken against Cross-Complainants and an award entered in favor of [Cross-Defendants] on the Cross-Complaint in the amount of Sixty Five Thousand Dollars ($65,000), including the legal applicable rate of interest, commencing from October 3, 2006."
One Star did not accept either the second or third offer to compromise. On December 20, 2007, STAAR withdrew its second offer.

III. Trial

The case was tried to the court. The court found that STAAR was authorized to subtract consulting fees from One Star's commissions, and thus *1087 it denied One Star's claim for breach of written contract. However, it found that One Star was entitled to recover some unpaid commissions, and it awarded One Star $41,400 on its common counts. As to STAAR's cross-complaint, the court found that STAAR had failed to establish breach of contract or damages.

IV. The Motions for Attorney Fees and Costs

STAAR moved for prevailing party attorney fees and costs pursuant to Civil Code section 1717 and, in the alternative, for postsettlement offer costs pursuant to section 998. One Star opposed the motion, urging that (1) STAAR did not "prevail" on the contract causes of action within the meaning of Civil Code section 1717; (2) STAAR's section 998 offers were irrelevant because the first offer was extinguished by the withdrawn (and therefore ineffectual) second offer; and (3) the fees STAAR sought were "patently excessive." One Star and Greiling also filed their own motion for attorney fees and costs, urging that they were the prevailing parties because they achieved greater relief.
The court granted One Star and Greiling's motion for fees and costs and denied STAAR's. It found as follows: (1) One Star was the prevailing party in the action and thus was entitled to its costs under Code of Civil Procedure section 1032. (2) As between STAAR and One Star, neither One Star nor STAAR "prevailed" on its contract claims, and thus neither was entitled to attorney fees under Civil Code section 1717. (3) As between STAAR and Greiling, Greiling had prevailed on STAAR's breach of contract claim, and thus Greiling was entitled to recover his attorney fees pursuant to Civil Code section 1717. (4) STAAR was not entitled to recover any of its costs pursuant to section 998. With regard to the section 998 issue, the court explained: "[A] second 998 offer extinguishes a prior 998 offer even if the subsequent 998 offer is invalid. Once a second 998 offer is made, the prior 998 offer is extinguished. Palmer v. Schindler Elevator Corp. (2003) 108 Cal.App.4th [154], 158-159 [133 Cal.Rptr.2d 339]. (`A later offer under 998 extinguishes any earlier offers, regardless of the validity of the offer.') STAAR[] argues that Palmer is not applicable because, in this case, the first 998 offer had expired before the second 998 offer was made. Wilson v. Wal-Mart [Stores, Inc.] (1999) 72 Cal.App.4th 382 [85 Cal.Rptr.2d 4] effectively undercuts STAAR's argument. In Wilson the court found that a second offer extinguished a first offer that had expired over a year before the second offer was made. In this case, there was a third 998 offer made 12/14/07 in which *1088 STAAR agreed to accept $65,000 from One Star to compromise the complaint. [¶] Thus, One Star obtained a `better' result at trial, and is therefore entitled to all of its costs."
The court entered judgment on October 20, 2008, as follows: (1) "Judgment shall be entered in favor of [One Star], and against STAAR, in the total amount of $52,650 (which includes costs in the amount of $11,250.00) plus interest from and after the date of entry of judgment at the legal rate of 10% per annum, pursuant to Code of Civil Procedure Section 685.010(a). This relief is awarded under [One Star's] cause of action for unjust enrichment in the Complaint"; (2) "The Court ruled in favor of STAAR, and against [One Star], on [One Star's] causes of action for breach of written contract and accounting in the Complaint"; (3) "Judgment shall be entered in favor of [One Star] and Greiling, and against STAAR, on STAAR's sole cause of action for breach of written contract in the Cross-Complaint"; (4) "[One Star] shall recover its costs pursuant to Code of Civil Procedure sections 1032(a)(4) and 1033.5 in the amount of $11,250.00 as a prevailing party because [One Star] received the `greater relief' and a `net monetary award' as between [One Star] and STAAR; however, [One Star] is not entitled to attorneys' fees as an item of costs"; (5) "Greiling shall recover his costs pursuant to Code of Civil Procedure sections 1032(a)(4) and 1033.5 and Civil Code section 1717 in the amount of $54,552.38 (including attorneys' fees in the amount of $50,802.38 as an item of costs) plus interest from and after the date of entry of Judgment at the legal rate of 10% per annum, pursuant to Code of Civil Procedure Section 685.010(a)"; and (6) "STAAR is not entitled to recover its attorneys' fees and costs pursuant to either (a) Civil Code section 1717 and Code of Civil Procedure sections 1032, 1033.5 or (b) Code of Civil Procedure section 998."
STAAR filed a notice of appeal from the judgment on November 5, 2008.

DISCUSSION
Although STAAR appealed from the judgment generally, it asserts error only as to the trial court's denial of its request for attorney fees and costs incurred after One Star rejected its first section 998 offer. Specifically, STAAR contends that the trial court erred in denying its request for attorney fees and costs because its first section 998 offer (which it characterizes as the "completed offer") exceeded One Star's recovery at trial.[1] The instant appeal *1089 thus presents the following issue: Whether the trial court properly found that STAAR's second offer to compromise extinguished the first offer, or whether STAAR is correct that its first offer to compromise remained relevant for section 998 cost-shifting purposes after STAAR withdrew its second offer. STAAR's contention presents an issue of statutory interpretation that we review de novo. (Steinfeld v. Foote-Goldman Proctologic Medical Group, Inc. (1997) 60 Cal.App.4th 13, 17 [70 Cal.Rptr.2d 41].)

I. Section 998

Section 998 provides that not less than 10 days prior to trial, any party "may serve an offer in writing upon any other party to the action to allow judgment to be taken or an award to be entered in accordance with the terms and conditions stated." (§ 998, subd. (b).) If the offer is accepted, the court "shall enter judgment accordingly." (Id., subd. (b)(1).) If the offer is not accepted prior to trial or within 30 days after it is made, whichever occurs first, "it shall be deemed withdrawn." (Id., subd. (b)(2).)
If a plaintiff does not accept the defendant's offer and fails to obtain a more favorable judgment, the plaintiff "shall not recover his or her postoffer costs and shall pay the defendant's costs from the time of the offer." (§ 998, subd. (c)(1).) In that case, the defendant's recoverable costs "shall be deducted from any damages awarded in favor of the plaintiff." (Id., subd. (e).)
(1) The "very essence" of section 998 is its encouragement of settlement. (Scott Co. v. Blount, Inc., supra, 20 Cal.4th 1103, 1114; see Mangano v. Verity, Inc. (2008) 167 Cal.App.4th 944, 950 [84 Cal.Rptr.3d 526].) Thus, "to encourage both the making and the acceptance of reasonable settlement offers, a losing defendant whose settlement offer exceeds the judgment is treated for purposes of postoffer costs as if it were the prevailing party." (Scott Co. v. Blount, Inc., supra, 20 Cal.4th at p. 1114.) (2) "In construing section 998, we follow the fundamental rule of statutory construction `"that the court should ascertain the intent of the Legislature so as to effectuate the purpose of the law. [Citations.]" [Citations.]'" (Wilson v. Wal-Mart Stores, Inc., supra, 72 Cal.App.4th 382, 389.)
(3) "[B]ecause `. . . section 998 involves the process of settlement and compromise and[,] since this process is a contractual one, it is appropriate for contract law principles to govern the offer and acceptance process under section 998.' [Citations.]" (Wilson v. Wal-Mart Stores, Inc., supra, 72 Cal.App.4th at p. 389.) However, "general contract principles should be *1090 invoked in applying section 998 `only where such principles neither conflict with the statute nor defeat its purpose,' which purpose is the encouragement of pretrial settlements." (Ibid.)

II. Revocability of Section 998 Settlement Offers

(4) Section 998 is "completely silent as to the revocability or irrevocability of offers made pursuant to that section." (T. M. Cobb Co. v. Superior Court (1984) 36 Cal.3d 273, 277 [204 Cal.Rptr. 143, 682 P.2d 338].) Nonetheless, our Supreme Court has held that section 998 offers are fully revocable prior to acceptance. (36 Cal.3d at pp. 277-278.) The court explained: "It is a well-established principle of contract law that an offer may be revoked by the offeror any time prior to acceptance. [Citations.] In light of this firmly established principle of contract law, it is clear that if the Legislature intended to make section 998 offers irrevocable, it would have expressly and unequivocally said so. [Fn. omitted.] It did not." (Id. at p. 278.) Further, the court said, interpreting section 998 to permit revocation of offers prior to acceptance is consistent with the policy of encouraging settlements. "A party is more likely to make an offer pursuant to section 998 if that party knows that the offer may be revised if circumstances change or new evidence develops. Conversely, a party who knows that he or she is strictly bound to the terms of the first offer made may be reluctant to make such an offer for fear of being locked into a position which becomes unfavorable upon the discovery of additional information. If a party is more likely to make a revocable offer, and less likely to make an irrevocable one, then more offers will be made if revocation is permitted. The more offers that are made, the more likely the chance for settlement. Thus, it is apparent that the general contract law principle that offers are revocable until accepted serves rather than defeats the statutory purpose of encouraging settlements." (36 Cal.3d at p. 281.)
The court noted that its determination that section 998 offers are revocable also promotes the public policy of compensating injured parties. It explained: "This policy would be frustrated if section 998 offers were irrevocable. As previously noted, newly discovered evidence may indicate that a certain defendant is more or less culpable than originally thought. It might also indicate that a plaintiff is more seriously injured than appeared from the initial evidence. Under such circumstances, an offer made prior to the discovery of the additional evidence might no longer be adequate to fairly compensate a plaintiff. If the offer is irrevocable, an injured party-offeror would be bound to an offer which will not compensate him or her fairly. However, if the offer may be revoked, the offeror can either propose a new offer in light of the newly discovered evidence or proceed to trial and present all the evidence in an attempt to be compensated fairly by the trier of fact's *1091 decision. Thus, the public policy of compensating an injured party is best served if section 998 offers are revocable." (T. M. Cobb Co. v. Superior Court, supra, 36 Cal.3d at pp. 281-282; see also Brown v. Labow (2007) 157 Cal.App.4th 795, 816 [69 Cal.Rptr.3d 417] ["Once a Code of Civil Procedure section 998 statutory settlement offer is made, it is subject to revocation."].)
(5) Although a section 998 offer may be revoked before it is accepted, if it is revoked prior to the expiration of the statutory period, "it no longer functions as an `offer' for purposes of the cost benefits of section 998." (Marina Glencoe, L.P. v. Neue Sentimental Film AG (2008) 168 Cal.App.4th 874, 880 [85 Cal.Rptr.3d 800]; see also T. M. Cobb Co. v. Superior Court, supra, 36 Cal.3d at p. 283, fn. 13 ["It should be apparent that an offer that is revoked prior to acceptance no longer functions as an `offer' for purposes of the cost benefit provisions."]; Marcey v. Romero (2007) 148 Cal.App.4th 1211, 1216 [56 Cal.Rptr.3d 402] ["We agree with the T. M. Cobb court's observation that an offer revoked before the expiration of the period statutorily specified by section 998 forfeits its status as an `offer' under the remaining provisions of section 998."]; Peterson v. John Crane, Inc. (2007) 154 Cal.App.4th 498, 505, fn. 7 [65 Cal.Rptr.3d 185] ["The second section 998 offer extinguished the first."].) According to one court: "[T]he statute appears to contemplate the offeree has a statutorily prescribed window of opportunity within which to weigh the consequences and make an election . . . . However, when the offeror unilaterally revokes the offer, the offeror deprives the offeree of the principal benefit and protection afforded to the offeree by the statute, e.g., the legislatively prescribed period to weigh the risks and select between the two options. [Under these circumstances,] an offeror should [not] be entitled to reap the full benefits afforded by the statute after diminishing the benefits afforded to the offeree by the statute." (Marcey v. Romero, supra, 148 Cal.App.4th at p. 1216.)

III. Multiple Section 998 Settlement Offers

No case has considered the question presented by the present appeal: the effect of a withdrawn section 998 settlement offer on earlier offers. However, two cases cited by the trial courtWilson v. Wal-Mart Stores, Inc., supra, 72 Cal.App.4th 382, and Palmer v. Schindler Elevator Corp., supra, 108 Cal.App.4th 154considered whether, in circumstances different from those presented by the instant case, a subsequent section 998 offer to settle supersedes a prior one.
(6) In Wilson v. Wal-Mart Stores, Inc., supra, 72 Cal.App.4th 382, the court held that in most circumstances, a second section 998 offer supersedes a first offer for purposes of the cost-shifting provisions of the statute. There, the plaintiff served an initial offer to compromise for $150,000; a year later, she *1092 made a second offer, for $249,000. (72 Cal.App.4th at p. 387.) The defendant rejected both offers, and a jury awarded the plaintiff $175,000. (Ibid.) The plaintiff then sought prejudgment interest pursuant to section 998 and Civil Code section 3291[2] from the date of the first settlement offer, urging that, consistent with the statutory purposes of section 998, the first offer should control. The court disagreed. It concluded that the interpretation urged by the plaintiff would not necessarily encourage pretrial settlement: "The factual situation before us is a good example. A plaintiff might be encouraged to maintain a higher settlement demand on the eve of trial and refuse to settle a case that should otherwise be settled if the plaintiff finds comfort in the knowledge that, even if the plaintiff receives an award less than his or her last demand, the plaintiff might still enjoy the cost reimbursement benefits of section 998 so long as the award exceeded a lower demand made by the plaintiff sometime during the course of the litigation. The reverse might be true of the defendant. `Rolling the dice' then becomes somewhat less risky and we note that lawsuits are not often settled by reducing the risk of trial." (72 Cal.App.4th at p. 391.)
Further, the court said, "there is some dissembling in [the plaintiff's] argument that we are reluctant to endorse. On the eve of trial she was unwilling to save the parties and the trial court the cost of trial for anything less than $249,000, yet she now asks to be reimbursed `998' costs as if she would have been willing to do so for $150,000. While we do not suggest impropriety, such fictions tend to undermine respect for our system of justice." (Wilson v. Wal-Mart Stores, Inc., supra, 72 Cal.App.4th at p. 391.) The court concluded: "In addition to the above considerations, the legislative purpose of section 998 is generally better served by a bright line rule in which the parties know that any judgment will be measured against a single valid statutory offeri.e., the statutory offer most recently rejectedregardless of offers made earlier in the litigation. [Citation.] [The plaintiff's] argument that the proper measure should be her first offer could logically be extended to a rule that a party is entitled to section 998 costs if it does better at trial than it would have under any offer made at anytime before judgment. While a rule such as that arguably might promote settlement in some cases, its potential for mischief, or at least confusion, is apparent." (Ibid.)
The court applied the principles articulated in Wilson to somewhat different facts in Palmer v. Schindler Elevator Corp., supra, 108 Cal.App.4th 154. There, the plaintiff served defendant Schindler with a section 998 offer for *1093 $1,999,999; while that offer was still pending, the plaintiff served a section 998 offer on all the defendants, "`jointly and severally,'" for $1,599,999. (108 Cal.App.4th at p. 156.) No defendant responded to either offer. The case went to trial, and the jury returned a verdict in the plaintiff's favor for $5.75 million. (Ibid.) In posttrial motions, the plaintiff urged that because the jury's verdict was greater than her second section 998 offer, she was entitled to enhanced costs pursuant to section 998 and to prejudgment interest pursuant to Civil Code section 3291. (108 Cal.App.4th at pp. 156-157.) The defendants opposed the motions, arguing that the second section 998 offer superseded the first; further, they said, the second offer was ineffective because it was improperly directed to all the defendants "`jointly and severally.'" (108 Cal.App.4th at p. 157.) The trial court agreed and denied the plaintiff's request for enhanced costs and prejudgment interest. (Ibid.)
(7) The Court of Appeal affirmed. It held that, to be effective, an offer to multiple parties under section 998 must be apportioned among the parties. Because the plaintiff's second section 998 offer was directed to all three defendants, jointly and severally, it was ineffective. (Palmer v. Schindler Elevator Corp., supra, 108 Cal.App.4th at p. 157.) Further, the court rejected the plaintiff's contention that a procedurally infirm section 998 offer cannot extinguish a prior valid offer. It explained: "We reject such a proposed rule because the validity of an offer will often be determined only in hindsight and would improperly place the consequences of an invalid, or arguably invalid, offer on the offeree, rather than on the offeror who caused the invalidity. Indeed, were we to adopt [plaintiff's] analysis, a plaintiff could make multiple valid and invalid offers to single or multiple parties, then sit back and decide after the fact which offer is the most advantageous for purposes of enhanced costs and prejudgment interest." (Palmer, at p. 158.) Thus, the court adopted the following "bright line rule": "A later offer under section 998 extinguishes any earlier offers, regardless of the validity of the offers. This rule best serves the statutory purpose of encouraging settlement of lawsuits prior to trial (T. M. Cobb Co. v. Superior Court, supra, 36 Cal.3d at p. 280) by providing offerees with clear direction as to what offers must be accepted on pain of enhanced fees and prejudgment interest. [Citation.] This rule is consistent with both general contract law [citations] and with the purpose of section 998." (Palmer v. Schindler Elevator Corp., supra, 108 Cal.App.4th at pp. 158-159.)

IV. Once Withdrawn, STAAR's Second Section 998 Offer Did Not Supersede Its First Offer

(8) The present case lies at the intersection of the policies discussed abovei.e., the policies that section 998 offers are fully revocable until accepted, and that as a general rule, subsequent section 998 offers supersede prior ones. For the reasons that follow, we conclude, as STAAR urges, that if *1094 a section 998 offer is withdrawn by a party prior to its statutory expiration (i.e., by start of trial or 30 days after the offer is made), then the withdrawing party's right to cost shifting under section 998 is determined by the last rejected section 998 offer. In the present case, therefore, STAAR's withdrawal of its second offer to compromise revived its first offer for purposes of cost shifting under section 998, and the trial court erred in denying STAAR's request for costs.

Policy of encouraging settlement.
As we have discussed, the "very essence" of section 998 is its encouragement of settlement. (Scott Co. v. Blount, Inc., supra, 20 Cal.4th 1103, 1114; see Mangano v. Verity, Inc., supra, 167 Cal.App.4th 944, 950.) Our Supreme Court concluded in T. M. Cobb that the policy of encouraging settlement would be furthered by permitting parties to withdraw section 998 offers because a party is more likely to make such an offer if the party knows that it may be revised or revoked. Conversely, a party who knows that he or she is bound to the first offer made may be reluctant to make such an offer for fear of being locked into an unfavorable position. Thus, more offers will be made if revocation is permitted. (T. M. Cobb Co. v. Superior Court, supra, 36 Cal.3d at p. 281.)
The court's reasoning in T. M. Cobb suggests that the result urged by STAARthat if a section 998 offer is withdrawn by a party prior to its statutory expiration, then the withdrawing party's right to cost shifting under section 998 is determined by the prior section 998 offeris most consistent with the legislative purpose of encouraging settlement. If a party is more likely to make a section 998 offer if it knows that it may withdraw its offer if circumstances change, then by parity of reasoning it also is more likely to make a section 998 offer if it knows that withdrawing that offer will not undermine its right to recover its costs posttrial. That is, if a party knows that it will not be penalized for withdrawing an offer to settle, then it will be more likely to make such an offer in the first instance. More offers thus will be made if revocation is permitted without penalty, and "[t]he more offers that are made, the more likely the chance for settlement." (T. M. Cobb Co. v. Superior Court, supra, 36 Cal.3d at p. 281.)

Preference for bright-line rules.
(9) The court observed in Wilson v. Wal-Mart Stores, Inc., supra, 72 Cal.App.4th at page 391, that the legislative purpose of section 998 "is generally better served by a bright line rule in which the parties know that any judgment will be measured against a single valid statutory offer." The rule we adopt here is consistent with a preference for bright-line rules: Under *1095 this rule, a party's last section 998 offer is effective unless expressly revoked; if the last offer is revoked, the prior offer is the relevant offer for purposes of section 998's cost-shifting rules.[3]

Avoiding gamesmanship.
Among the reasons cited by the Palmer court for its determination that a second invalid offer supersedes the first was its desire to avoid gamesmanship by the parties. It noted that if it adopted the rule advocated by the plaintiff, a party "could make multiple valid and invalid offers to single or multiple parties, then sit back and decide after the fact which offer is the most advantageous for purposes of enhanced costs and prejudgment interest." (Palmer v. Schindler Elevator Corp., supra, 108 Cal.App.4th at p. 158.) No such concern is implicated here. While an offer's validity may be clear only in hindsight, the status of a withdrawn offer is known to both parties as soon as the offer is withdrawn. Thus, the opportunity for gamesmanship noted by the Palmer court does not exist in the present case.
A further issue of "gamesmanship" was present in Palmer that is not present here. In Palmer, the plaintiff made a second offer to the defendants just 19 days after she made a first offer, and thus the defendants did not have the full 30 days provided by section 998 to accept or reject the first offer. Under these circumstances, the plaintiff "deprive[d] [the defendant] of the principal benefit and protection afforded to the offeree by the statute, e.g., the legislatively prescribed period to weigh the risks and select between the two options." (Marcey v. Romero, supra, 148 Cal.App.4th at p. 1216.) Had the court held that the plaintiff was nonetheless entitled to weigh her recovery against her first offer, the plaintiff would have reaped the full benefits afforded by section 998 even after diminishing the benefits afforded to the defendants under the statute. Here, in contrast, One Star had the full statutorily prescribed period to consider STAAR's first offer, and so it was not deprived of the benefit to which it was entitled under section 998.
(10) For all of these reasons, we conclude that STAAR's withdrawal of its second offer to compromise revived its first offer for purposes of cost shifting under section 998.

V. STAAR's Third Settlement Offer Is Irrelevant to Its Entitlement to Postoffer Costs

One Star contends that notwithstanding the foregoing, STAAR is not entitled to recover its costs because even if its second settlement offer did not *1096 extinguish its first, its third settlement offer did. In its third offer, STAAR offered to accept $65,000 plus interest to settle its cross-complaint. One Star did not accept this offer, and at trial STAAR recovered nothing on the cross-complaint. Accordingly, One Star asserts, "even if the First 998 Offer had not been extinguished, the Court would still have to take into account the fact that [One Star] was undoubtedly the prevailing party against STAAR's cross-complaint on the same written agreement."
(11) We do not agree. "Section 998 `does not require a [party] to make a global settlement offer to all [opponents] in an action, or to make an offer that resolves all aspects of a case. [Citation.]' [Citation.]" (Westamerica Bank v. MBG Industries, Inc. (2007) 158 Cal.App.4th 109, 130 [70 Cal.Rptr.3d 125].) Rather, where both a complaint and cross-complaint are pending, an offer to settle only the complaint is valid to trigger the provisions of section 998 because "`[a] complaint and a cross-complaint are, for most purposes, treated as independent actions.'" (158 Cal.App.4th at p. 134.) Thus, in Westamerica, the court held that where the defendant offered to settle the complaint only, and the plaintiff subsequently recovered less than the defendant's settlement offer, the defendant was entitled to recover her postoffer costs even though her settlement offer did not address any causes of action alleged in her cross-complaint. The court explained: "[B]ased on the language of section 998 and the settled definitions of the key words in that statute, respondents' offer to settle only the [complaint] was valid to trigger the provisions of section 998 because acceptance of that offer by the `other party to the action' would have allowed `judgment to be taken.' (§ 998, subd. (b).)" (Id. at p. 135.)
In the present case, it is undisputed that STAAR's first and second settlement offers addressed only One Star's complaint; STAAR's third settlement offer addressed only its cross-complaint. Each was valid to trigger the provisions of section 998 as to a separate "action." One Star offers no authority for the proposition that an offer to settle one "action" (the cross-complaint) extinguishes an offer to settle another action (the complaint). We decline to so find.

DISPOSITION
We reverse the judgment with directions to the trial court to calculate the postoffer costs to which STAAR is entitled and to strike its award of postoffer costs to One Star. In all other respects, the judgment is affirmed. We express no opinion as to whether, on remand, STAAR is entitled to recover its attorney fees as an element of costs and, if so, the amount of recoverable fees.
*1097 STAAR shall recover its costs on appeal.
Willhite, Acting P. J., and Manella, J., concurred.
NOTES
[1]  STAAR explicitly does not challenge the trial court's determination that there was no prevailing party on the written contract claim. Rather, it contends, citing Scott Co. v. Blount, Inc. (1999) 20 Cal.4th 1103, 1114 [86 Cal.Rptr.2d 614, 979 P.2d 974], that its "`entitlement to costs derives not from its status as a prevailing party but from the plaintiff's failure to accept a reasonable settlement offer.'" We therefore do not address One Star's repeated contention that STAAR was not the prevailing party.
[2]  Pursuant to Civil Code section 3291, "If the plaintiff makes an offer pursuant to Section 998 of the Code of Civil Procedure which the defendant does not accept prior to trial or within 30 days, whichever occurs first, and the plaintiff obtains a more favorable judgment, the judgment shall bear interest at the legal rate of 10 percent per annum calculated from the date of the plaintiff's first offer pursuant to Section 998 of the Code of Civil Procedure which is exceeded by the judgment, and interest shall accrue until the satisfaction of judgment."
[3]  We do not hold, as One Star suggests, that if a party serves two separate section 998 offers, "that party will be entitled to the benefits of both offers at the same time for a period of up to 30 days." Rather, as we have said, only one section 998 offer is effective at any given time.
