Participants will be randomized in a 1:1 ratio to active low-frequency rTMS or matched sham stimulation using variable block sizes of 4 and 6. Randomization will be stratified by planned resection extent (wedge or segmental resection versus lobectomy or greater resection) and baseline Insomnia Severity Index (ISI) category (<15 versus ≥15). Allocation will be concealed with sequentially numbered, opaque, sealed envelopes or an equivalent controlled allocation system.
Active treatment will target the left dorsolateral prefrontal cortex at F3 using a figure-of-eight coil, 1 Hz stimulation, 100% of resting motor threshold, and 1,800 pulses over approximately 30 minutes per session. The five planned sessions are preoperative day -2, preoperative day -1, 2-6 hours after awake extubation when clinically stable, postoperative day 1, and postoperative day 2. No more than one session may be performed on any calendar day. The sham arm will use a dedicated compatible sham coil or coded active/sham module with matched procedures and no intended cortical stimulation.
The primary analysis will compare the participant-level mean RCSQ total score across postoperative inpatient nights 1-3. A nightly score is eligible when at least 4 of 5 RCSQ visual-analogue items are completed. The participant-level value will be the arithmetic mean of at least two eligible nightly scores; thus, it may be based on two or three nights. The model will adjust for the most recent evaluable pre-randomization inpatient RCSQ score, randomization strata, and regular hypnotic use.
The planned enrollment is 220 participants (110 per group). The protocol assumes a between-group RCSQ difference of 10 points, a common standard deviation of 20 points, a two-sided alpha of 0.05, and 90% power, requiring 86 evaluable participants per group before a 20% allowance for non-evaluable primary outcomes.