"Sophie, go look at yourself in the mirror," the sandy-haired 11-year-old said with a grin.

The carefree scene would have seemed out of the question just a few weeks ago. Hannah's liver failed suddenly without any known cause or pre-existing condition and she underwent a rare kind of emergency liver transplant Jan. 31. The surgery was performed by doctors at Boston Children's Hospital who were unsure she would live through it.

"She was so sick that we felt she only had hours to live," said Dr. Heung Bae Kim, director of the Pediatric Transplant Center at Children's.

At the end of January, Hannah had a stomach bug and fever — most of the same symptoms her three sisters had felt from a flu, said her mother, Carolyn Swift. When Swift noticed Hannah developing a rash, she took her to the pediatrician. She says she was assured it was likely a flu that would pass in a few days.

Then Hannah's skin started turning yellow.

"She looked like she was getting a suntan," Hannah's mom recalled about the day — Jan. 29 — when she took Hannah back to the doctor. "During the day she was getting darker and darker."

This time, when the pediatrician saw Hannah's jaundiced skin and eyes, the doctor told Swift she needed to take Hannah to Cape Cod Hospital, and to pack a bag before leaving.

As they waited overnight for doctors to complete lab work, Hannah vomited continually. She also started angrily throwing things and saying things that made no sense, Swift said.

"That's a symptom of liver failure," said her dad, Chris Swift, sitting on his living room couch next to Hannah recently. "The high ammonia levels in the blood affect the brain like a bad concussion."

Hannah said she remembers none of this.

The next morning, a doctor at Cape Cod Hospital called Children's Hospital, which sent down a special ambulance crew to rush Hannah to the hospital's intensive care unit.

Doctors first tried using medication to flush the dangerous levels of ammonia and proteins from Hannah's brain. By the next morning, she was in a coma and could not speak or make eye contact. She also was having seizures.

"They said they might put her on the transplant list, then a half-hour later it was, 'we're going to put her on the transplant list just in case,' and then it was like 'she needs a transplant right now, you need to sign for it,'" Carolyn Swift said. "They said, 'Whether or not we find a liver, we're taking hers out.'"

Hannah's father went into Lahey Clinic to test his eligibility as a living donor, but the tests would have taken too long.

Then, almost miraculously, within hours of Hannah's name being added to the donor list, a liver became available. But it wasn't a match for her type O blood.

Under normal circumstances, Kim would have waited for a compatible liver, but the best option in this case was to perform a rare surgery Kim had never before tried: an ABO incompatible transplant, a surgery in which doctors exchange plasma in a patient's blood to temporarily change the blood type, tricking the body into accepting an organ it would naturally reject.

Hannah spent the first couple of days after the transplant in a coma, Carolyn Swift said. Little by little, she was able to squeeze her mother's hand, make eye contact and cry.

She then became lucid enough to tell her mother she had to use the bathroom.

"The first thing I remember, actually, was being in a room downstairs on the seventh floor," Hannah said. "I just remember people looking through the shadows and then I remember not remembering anything else after that."

Staff at Children's marveled at Hannah's speedy recovery. She left the hospital two weeks after the surgery — half the hospitalization time Kim had predicted.

Doctors remain unsure of what caused Hannah's liver to fail. But with the surgery behind her, Hannah and her family are now adjusting to a new reality.

For the time being, as she takes drugs that suppress her immune system and fight a possible rejection of the new liver, Hannah can't drink the family's well water, go out into crowds of people or garden.

She will stay home from Barnstable United Elementary School for another two to three weeks or so, and can have only one friend at a time to visit.

The Swifts began a fund at TD Bank in hopes of offsetting the financial burdens of medical co-payments and weekly trips to Boston for blood tests. They are not yet sure how much of Hannah's treatment their health insurance will cover.

"Trying to get back to some sense of normal and schedule-wise and everything else is not easy," Chris Swift said.

But the family's gratitude for the donated liver Hannah received and her successful recovery overshadow any hardship they may endure.

"She's got a lifetime of adjustments," Carolyn Swift said. "Overall, those changes are small compared with the alternative."