/* Mascot Healthcare page animations.
   Markup is generated by _tools/build_anims.py (between <!--mha:ID--> markers).
   Each figure plays once when scrolled into view (js/mh-anim.js adds .mha-in).
   Without JavaScript, or with "reduce motion" on, the finished picture shows. */

.mha {
  --b9: #1e3a8a; --b7: #1d4ed8; --b6: #2563eb; --b5: #3b82f6; --b3: #93c5fd; --b1: #dbeafe; --b0: #eff6ff;
  --ink: #0a2240; --mut: #5b6b82; --ln: #dbe3f0; --ok: #15803d; --okb: #dcfce7; --wa: #b45309; --wab: #fef3c7; --bad: #b91c1c; --badb: #fee2e2;
  position: relative; max-width: 880px; margin: 26px auto 30px; padding: 22px 20px 20px;
  background: #fff; border: 1.5px solid var(--ln); border-radius: 16px; box-shadow: 0 6px 20px rgba(10, 34, 64, .05);
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); text-align: center; line-height: 1.45;
  box-sizing: border-box;
}
.mha *, .mha *::before, .mha *::after { box-sizing: border-box; }
.mha-wrapx { padding: 0 16px; }
.mha .mha-h { display: block; font: 700 1.04rem 'Sora', system-ui, sans-serif; color: var(--ink); margin: 0 0 4px; letter-spacing: -.01em; }
.mha .mha-sub { display: block; font-size: .9rem; color: var(--mut); margin: 0 0 18px; }
.mha .mha-note { display: block; font-size: .84rem; color: var(--mut); margin: 16px auto 0; max-width: 640px; }
.mha .mha-note b { color: var(--ink); }
.mha svg { display: block; width: 100%; height: auto; overflow: visible; }
.mha i.fa-solid, .mha i.fa-brands { line-height: 1; }
.mha b, .mha strong { font-weight: 700; }
.mha small { font-size: .82rem; color: var(--mut); }

/* ---------- sequencing ---------- */
.mha .ma-s { animation-duration: var(--t, .5s); animation-delay: var(--d, 0s); animation-fill-mode: both; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
.mha-js .mha .ma-s { animation-play-state: paused; }
.mha-js .mha.mha-in .ma-s { animation-play-state: running; }
.mha-js .mha .ma-pop { animation-name: mhaPop; animation-timing-function: cubic-bezier(.3, 1.5, .5, 1); }
.mha-js .mha .ma-fade { animation-name: mhaFade; }
.mha-js .mha .ma-draw { animation-name: mhaDraw; animation-timing-function: linear; }
.mha-js .mha .ma-growx { animation-name: mhaGrowX; }
.mha-js .mha .growy { animation-name: mhaGrowY; }
.mha-js .mha .ma-rot { animation-name: mhaRot; animation-timing-function: cubic-bezier(.35, 1.25, .5, 1); }
.mha-js .mha .ma-lvl { animation-name: mhaLvl; animation-timing-function: ease-in-out; }
.mha-js .mha .ma-ping { animation-name: mhaPing; animation-timing-function: ease-out; }
.mha .ma-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.mha svg .ma-pop, .mha svg .ma-growx, .mha svg .growy, .mha svg .ma-lvl, .mha svg .ma-ping { transform-box: fill-box; }
.mha .ma-pop, .mha .ma-ping { transform-origin: center; }
.mha .ma-growx { transform-origin: left center; }
.mha .growy, .mha .ma-lvl { transform-origin: center bottom; }
.mha .ma-ping { opacity: 0; }
@keyframes mhaPop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes mhaFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes mhaDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes mhaGrowX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes mhaGrowY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes mhaRot { from { transform: rotate(var(--r0, -90deg)); } to { transform: rotate(var(--r, 0deg)); } }
@keyframes mhaLvl { from { transform: scaleY(var(--l0, 0)); } to { transform: scaleY(var(--l1, 1)); } }
@keyframes mhaPing { 0% { opacity: .75; transform: scale(1); } 100% { opacity: 0; transform: scale(2.3); } }
.mha-js .mha.mha-in .ma-spin { animation: mhaSpin 24s linear 2.5s infinite; transform-box: view-box; }
@keyframes mhaSpin { to { transform: rotate(360deg); } }

/* ---------- shared bits ---------- */
.mha .mha-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 10px;
  background: linear-gradient(135deg, var(--b6), var(--b9)); color: #fff; font-size: 1.15rem; position: relative; z-index: 1; box-shadow: 0 0 0 5px #fff; }
.mha .ma-t-ok .mha-ic { background: linear-gradient(135deg, #22c55e, var(--ok)); }
.mha .ma-t-wa .mha-ic { background: linear-gradient(135deg, #f59e0b, var(--wa)); }
.mha .ma-t-bad .mha-ic { background: linear-gradient(135deg, #ef4444, var(--bad)); }
.mha .ma-t-mut .mha-ic { background: linear-gradient(135deg, #94a3b8, #475569); }
.mha .ma-lbl b { display: block; font: 700 .93rem 'Sora', system-ui, sans-serif; color: var(--ink); }
.mha .ma-lbl small { display: block; margin-top: 2px; }

/* ---------- steps ---------- */
.mha-st { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
.mha-st > li { position: relative; padding: 0 8px; margin: 0; }
.mha-st > li::before { display: none !important; }
.mha-st .mha-bar { position: absolute; top: 24px; left: calc(50% + 32px); width: calc(100% - 64px); height: 4px; border-radius: 4px; background: var(--b3); }
.mha-st > li.ma-cur .mha-ic { box-shadow: 0 0 0 5px #fff, 0 0 0 8px var(--b3); }
@media (max-width: 640px) {
  .mha-st { grid-template-columns: 1fr; }
  .mha-st > li { display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; text-align: left; padding: 0 0 18px; align-items: center; }
  .mha-st > li:last-child { padding-bottom: 0; }
  .mha-st .mha-ic { margin: 0; }
  .mha-st .mha-bar { top: 56px; left: 24px; width: 4px; height: calc(100% - 56px); transform-origin: center top; }
  .mha-js .mha .mha-st .mha-bar { animation-name: mhaGrowY; }
}

/* ---------- tiles ---------- */
.mha-tl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--mw, 140px), 1fr)); gap: 12px; }
.mha-tile { background: var(--b0); border: 1.5px solid var(--b1); border-radius: 14px; padding: 16px 12px 14px; }
.mha-tile .mha-ic { width: 44px; height: 44px; font-size: 1rem; box-shadow: none; margin-bottom: 8px; }
@media (max-width: 480px) { .mha-tl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .mha-tile { padding: 12px 8px 10px; } .mha-tile .lbl b { font-size: .84rem; } }
.mha-tile .ma-sw { display: block; width: 44px; height: 22px; border-radius: 6px; margin: 4px auto 10px; border: 1.5px solid rgba(0,0,0,.08); }
.mha-tile.ma-t-ok { background: var(--okb); border-color: #bbf7d0; }
.mha-tile.ma-t-wa { background: var(--wab); border-color: #fde68a; }
.mha-tile.ma-t-bad { background: var(--badb); border-color: #fecaca; }

/* ---------- fork ---------- */
.mha-fk-top { display: inline-block; max-width: 340px; }
.mha-fk-lines { height: 54px; margin: 4px 0 6px; }
.mha-fk-lines path { fill: none; stroke: var(--b3); stroke-width: 3; stroke-linecap: round; }
.mha-fk-row { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 14px; }
.mha-card { border: 1.5px solid var(--ln); border-top: 4px solid var(--b6); border-radius: 14px; padding: 16px 14px 14px; background: #fff; }
.mha-card.ma-t-ok { border-top-color: #22c55e; } .mha-card.ma-t-wa { border-top-color: #f59e0b; } .mha-card.ma-t-bad { border-top-color: #ef4444; } .mha-card.ma-t-mut { border-top-color: #94a3b8; }
.mha-card .mha-ic { width: 44px; height: 44px; font-size: 1rem; box-shadow: none; }
.mha-fk-arrow { display: none; color: var(--b5); font-size: 1.1rem; margin: 8px 0; }
@media (max-width: 640px) {
  .mha-fk-lines { display: none; }
  .mha-fk-arrow { display: block; }
  .mha-fk-row { grid-template-columns: 1fr; }
}

/* ---------- loop ---------- */
.mha-lp { position: relative; width: 100%; max-width: 440px; margin: 34px auto 30px; aspect-ratio: 1 / 1; }
.mha-lp svg { position: absolute; inset: 0; }
.mha-lp .ma-ring { fill: none; stroke: var(--b3); stroke-width: 3; }
.mha-lp .ma-ring2 { fill: none; stroke: var(--b1); stroke-width: 2; stroke-dasharray: 3 9; }
.mha-lp .ma-arr { fill: var(--b5); }
.mha-lp .ma-node { position: absolute; transform: translate(-50%, -50%); width: 34%; }
.mha-lp .ma-node .mha-ic { width: 46px; height: 46px; font-size: 1rem; margin-bottom: 6px; }
.mha-lp .ma-node .ma-lbl b, .mha-lp .ma-node .ma-lbl small { display: inline-block; background: #fff; padding: 0 5px; border-radius: 6px; }
.mha-lp .ma-node .ma-lbl small { display: table; margin: 1px auto 0; }
.mha-lp .ma-ctr { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 40%; }
.mha-lp .ma-ctr b { font: 700 .9rem 'Sora', system-ui, sans-serif; color: var(--b7); display: block; }
.mha-lp .ma-ctr small { display: block; }
@media (max-width: 480px) { .mha-lp .ma-node .ma-lbl b { font-size: .8rem; } .mha-lp .ma-node small { font-size: .72rem; } .mha-lp .ma-ctr b { font-size: .78rem; } }

/* ---------- timeline ---------- */
.mha-tm { position: relative; padding: 46px 0 50px; }
.mha-tm .ma-trk { stroke: var(--ln); stroke-width: 6; stroke-linecap: round; }
.mha-tm .ma-prg { stroke: var(--b6); stroke-width: 6; stroke-linecap: round; fill: none; }
.mha-tm .ma-tick { stroke: var(--ln); stroke-width: 2; }
.mha-tm .ma-band { fill: var(--b3); opacity: .55; }
.mha-tm .ma-mk circle { fill: var(--b6); stroke: #fff; stroke-width: 4; }
.mha-tm .ma-mk text { fill: #fff; font: 700 15px 'Sora', system-ui, sans-serif; text-anchor: middle; dominant-baseline: central; }
.mha-tm .ma-mk.ma-t-ok circle { fill: #16a34a; } .mha-tm .ma-mk.ma-t-wa circle { fill: #d97706; } .mha-tm .ma-mk.ma-t-bad circle { fill: #dc2626; }
.mha-tm .ma-bdg path.ma-body { fill: url(#mhaShield); }
.mha-tm .ma-bdg .ma-chk { fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.mha-tm .ma-pg circle { fill: none; stroke: var(--b5); stroke-width: 3; }
.mha-tm .ma-tl { position: absolute; transform: translateX(-50%); white-space: nowrap; font-size: .82rem; color: var(--mut); line-height: 1.3; }
.mha-tm .ma-tl b { display: block; font: 700 .88rem 'Sora', system-ui, sans-serif; color: var(--ink); }
.mha-tm .ma-tl.ma-dn { bottom: 0; } .mha-tm .ma-tl.ma-up { top: 0; }
.mha-tm .ma-tl.ma-al { transform: translateX(-18%); text-align: left; } .mha-tm .ma-tl.ma-ar { transform: translateX(-82%); text-align: right; }
.mha-tm .ma-tl.ma-hl b { color: var(--b7); }
@media (max-width: 480px) { .mha-tm .ma-tl { font-size: .74rem; } .mha-tm .ma-tl b { font-size: .78rem; } }

/* ---------- gauge ---------- */
.mha-gg { max-width: 460px; margin: 0 auto; }
.mha-gg .ma-zone { fill: none; stroke-width: 26; }
.mha-gg .ma-zl { font: 600 12px 'Outfit', system-ui, sans-serif; fill: var(--mut); text-anchor: middle; }
.mha-gg .ma-ndl { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; }
.mha-gg .ma-hub { fill: var(--ink); }
.mha-gg .ma-val { font: 700 1rem 'Sora', system-ui, sans-serif; color: var(--b7); margin-top: 4px; display: block; }

/* ---------- compare ---------- */
.mha-cp { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 14px; text-align: left; }
.mha-cp .ma-col { border: 1.5px solid var(--ln); border-radius: 14px; padding: 16px; background: #fff; }
.mha-cp .ma-col.ma-alt { background: var(--b0); border-color: var(--b1); }
.mha-cp .ma-hd { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.mha-cp .ma-hd .mha-ic { width: 44px; height: 44px; margin: 0; font-size: 1rem; box-shadow: none; flex: none; }
.mha-cp .ma-hd b { font: 700 .98rem 'Sora', system-ui, sans-serif; }
.mha-cp ul { list-style: none; margin: 0; padding: 0; }
.mha-cp li { position: relative; padding: 7px 0 7px 26px; border-top: 1px solid var(--ln); font-size: .9rem; color: var(--ink); margin: 0; }
.mha-cp li::before { display: none !important; }
.mha-cp li i { position: absolute; left: 2px; top: 10px; color: var(--b6); font-size: .85rem; }
@media (max-width: 640px) { .mha-cp { grid-template-columns: 1fr; } }

/* ---------- visual + captions (organs, levels, curves, route, ultrasound) ---------- */
.mha-vz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; align-items: center; text-align: left; }
.mha-vz.ma-wide { grid-template-columns: 1fr; }
.mha-vz .ma-pic { position: relative; max-width: 380px; width: 100%; margin: 0 auto; }
.mha-vz.ma-wide .ma-pic { max-width: 760px; }
.mha-cap { list-style: none; margin: 0; padding: 0; counter-reset: mc; }
.mha-cap li { position: relative; padding: 8px 0 8px 40px; margin: 0; font-size: .92rem; color: var(--ink); counter-increment: mc; }
.mha-cap li::before { content: counter(mc); position: absolute; left: 0; top: 6px; width: 28px; height: 28px; border-radius: 50%; background: var(--b0); border: 1.5px solid var(--b3); color: var(--b7); font: 700 .8rem 'Sora', system-ui, sans-serif; display: grid; place-items: center; }
.mha-cap li small { display: block; }
.mha-vz.ma-wide .mha-cap { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 4px 16px; margin-top: 14px; }
@media (max-width: 640px) { .mha-vz { grid-template-columns: 1fr; } .mha-vz .ma-pic { max-width: 300px; } .mha-vz.ma-wide .ma-pic { max-width: none; } }
.mha .ma-org { fill: #e0ecff; stroke: var(--b7); stroke-width: 2.5; stroke-linejoin: round; }
.mha .ma-org2 { fill: #c7dbff; stroke: var(--b7); stroke-width: 2; }
.mha .ma-orgl { fill: none; stroke: var(--b7); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.mha .ma-hot { fill: #fca5a5; stroke: var(--bad); stroke-width: 2; }
.mha .ma-warm { fill: #fde68a; stroke: var(--wa); stroke-width: 2; }
.mha .ma-cool { fill: #bfdbfe; stroke: var(--b6); stroke-width: 2; }
.mha .ma-ringh { fill: none; stroke: var(--bad); stroke-width: 2.5; }
.mha .ma-ringb { fill: none; stroke: var(--b5); stroke-width: 2.5; }
.mha .ma-wave { fill: none; stroke: var(--b5); stroke-width: 2.5; stroke-linecap: round; }
.mha .ma-echo { fill: none; stroke: #f59e0b; stroke-width: 2.5; stroke-linecap: round; }
.mha .ma-ax { stroke: var(--ln); stroke-width: 2; }
.mha .ma-cv { fill: none; stroke: var(--b6); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.mha .cv2 { fill: none; stroke: #f59e0b; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 2 0; }
.mha .ma-bnd { fill: rgba(147, 197, 253, .38); }
.mha .ma-dot { fill: var(--b6); stroke: #fff; stroke-width: 3; }
.mha .ma-road { fill: none; stroke: var(--ln); stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; }
.mha .ma-route { fill: none; stroke: var(--b6); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.mha .ma-pin { fill: var(--b6); stroke: #fff; stroke-width: 3; }
.mha .ma-pin.ma-end { fill: #16a34a; }
.mha .ma-pnum { fill: #fff; font: 700 13px 'Sora', system-ui, sans-serif; text-anchor: middle; dominant-baseline: central; }
.mha .ma-glass { fill: rgba(219, 234, 254, .35); stroke: var(--b7); stroke-width: 3; }
.mha .ma-water { fill: #93c5fd; }
.mha .ma-scr { fill: #0f172a; }
.mha .ma-scrl { stroke: #94a3b8; stroke-width: 3; stroke-linecap: round; }
.mha .ma-probe { fill: var(--b9); }
.mha .ma-vlab { position: absolute; transform: translate(-50%, -50%); font: 600 .78rem 'Outfit', system-ui, sans-serif; color: var(--mut); white-space: nowrap; }
.mha .ma-vlab.ma-b { color: var(--b7); font-weight: 700; }

/* ---------- genotype ---------- */
.mha-gt .ma-par { display: flex; justify-content: center; align-items: center; gap: 14px; margin-bottom: 18px; }
.mha-gt .ma-chip { font: 700 1.25rem 'Sora', system-ui, sans-serif; padding: 10px 20px; border-radius: 12px; background: var(--b0); border: 1.5px solid var(--b3); color: var(--b9); }
.mha-gt .ma-x { font: 700 1.2rem 'Sora', system-ui, sans-serif; color: var(--mut); }
.mha-gt .ma-kids { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 520px; margin: 0 auto; }
.mha-gt .ma-kid { border-radius: 12px; padding: 12px 6px; font: 700 1.1rem 'Sora', system-ui, sans-serif; }
.mha-gt .ma-kid small { display: block; font: 500 .74rem 'Outfit', system-ui, sans-serif; margin-top: 2px; color: inherit; opacity: .85; }
.mha-gt .ma-k-aa { background: var(--okb); color: var(--ok); } .mha-gt .ma-k-as { background: var(--wab); color: var(--wa); } .mha-gt .ma-k-ss { background: var(--badb); color: var(--bad); }
@media (max-width: 480px) { .mha-gt .ma-kids { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- chat ---------- */
.mha-ch { max-width: 420px; margin: 0 auto; background: #efeae2; border-radius: 16px; padding: 16px 14px; text-align: left; }
.mha-ch .ma-msg { max-width: 82%; padding: 9px 12px 7px; border-radius: 12px; font-size: .9rem; margin: 0 0 8px; box-shadow: 0 1px 1px rgba(0,0,0,.08); color: #111b21; }
.mha-ch .ma-me { margin-left: auto; background: #d9fdd3; border-top-right-radius: 4px; }
.mha-ch .ma-them { background: #fff; border-top-left-radius: 4px; }
.mha-ch .ma-typ { display: flex; width: max-content; gap: 4px; padding: 12px 14px; }
.mha-ch .ma-typ span { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; }
.mha-ch .ma-who { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; font: 700 .9rem 'Sora', system-ui, sans-serif; color: #111b21; }
.mha-ch .ma-who i { color: #25d366; font-size: 1.3rem; }
.mha-js .mha .ma-gone { animation-name: mhaGone; }
@keyframes mhaGone { 0% { opacity: 0; max-height: 0; } 15% { opacity: 1; max-height: 40px; } 85% { opacity: 1; max-height: 40px; } 100% { opacity: 0; max-height: 0; padding: 0; margin: 0; } }
.mha .ma-gone { opacity: 0; max-height: 0; overflow: hidden; padding: 0 !important; margin: 0 !important; }

/* ---------- calendar ---------- */
.mha-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 420px; margin: 0 auto; }
.mha-cal span { aspect-ratio: 1 / 1; border-radius: 8px; background: var(--b6); color: #fff; font: 700 .78rem 'Sora', system-ui, sans-serif; display: grid; place-items: center; }

/* ---------- "How it works" lists that already exist on pages (.mhs-steps) ---------- */
.mha-js .mhs-steps.mha-steps-anim > li { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.mha-js .mhs-steps.mha-steps-anim.mha-in > li { opacity: 1; transform: none; }
.mha-js .mhs-steps.mha-steps-anim.mha-in > li:nth-child(2) { transition-delay: .35s; }
.mha-js .mhs-steps.mha-steps-anim.mha-in > li:nth-child(3) { transition-delay: .7s; }
.mha-js .mhs-steps.mha-steps-anim.mha-in > li:nth-child(4) { transition-delay: 1.05s; }
.mha-js .mhs-steps.mha-steps-anim.mha-in > li:nth-child(5) { transition-delay: 1.4s; }
.mha-js .mhs-steps.mha-steps-anim.mha-in > li:nth-child(6) { transition-delay: 1.75s; }

@media (prefers-reduced-motion: reduce) {
  .mha .ma-s, .mha .ma-spin { animation: none !important; }
  .mha .ma-ping { display: none; }
  .mha .ma-gone { display: none; }
  .mha-js .mhs-steps.mha-steps-anim > li { opacity: 1; transform: none; transition: none; }
}
@media print { .mha { break-inside: avoid; box-shadow: none; } .mha .ma-s { animation: none !important; } }
