:root{
  --navy-950:#030816;--navy-900:#050c20;--navy-800:#0a1530;
  --gold:#d4a64a;--gold-bright:#f0c46a;--cream:#f6ecd9;--cream-dim:#cdbf9f;--mist:#8f9bb8;
  --sage:#8fb8a8;--air:#cde7ff;--o2:#ffe3a8;--wisp:#b7a4c9;
  --serif:"Cormorant Garamond",Georgia,"Times New Roman",serif;
  --sans:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --safe-t:env(safe-area-inset-top,0px);--safe-b:env(safe-area-inset-bottom,0px);
  --hud-h:118px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:var(--navy-950);color:var(--cream);font-family:var(--sans);-webkit-font-smoothing:antialiased;overscroll-behavior:none}
body{position:fixed;inset:0;overflow:hidden}
button{font:inherit;color:inherit;cursor:pointer}
a{color:var(--gold-bright)}
[hidden]{display:none!important}
:focus{outline:none}
:focus-visible{outline:2px solid var(--gold-bright);outline-offset:3px}

#world{position:fixed;inset:0;background:
  radial-gradient(ellipse 80% 50% at 50% 0%,rgba(17,31,66,.9),transparent 70%),
  linear-gradient(180deg,#071028 0%,var(--navy-950) 55%,#071422 100%);
  pointer-events:none;transition:background 3s ease}
body.dawn #world{background:
  radial-gradient(ellipse 90% 60% at 50% -10%,rgba(240,196,106,.35),transparent 70%),
  linear-gradient(180deg,#3a2a3a 0%,#1a1630 40%,#0c1a28 100%)}

/* Header: icons on the first row, 988 chip on its own full-width row so it never sits under mute. */
.hud-top{position:fixed;top:calc(8px + var(--safe-t));left:10px;right:10px;z-index:40;display:flex;flex-direction:column;align-items:stretch;gap:6px;pointer-events:none}
.hud-icons{display:flex;justify-content:flex-end;gap:8px;pointer-events:auto}
.help988{pointer-events:auto;display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;gap:2px;height:48px;max-height:56px;background:rgba(3,8,22,.82);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid rgba(212,166,74,.45);border-radius:999px;padding:2px 8px;font-size:13px;font-weight:600;white-space:nowrap;width:100%;max-width:100%;overflow:hidden}
.help988 a,.help988 button{color:var(--gold-bright);text-decoration:none;min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:0 7px;background:none;border:0;font-weight:600;flex:none}
.help988 button{color:var(--cream-dim);text-decoration:underline;text-underline-offset:3px}
.help988 .us,.help988 .or{color:var(--mist);flex:none}
.help988 .dot{color:var(--mist);padding:0 4px}
@media (max-width:360px){
  .help988{font-size:13px;padding:2px 4px;gap:0;letter-spacing:-.01em}
  .help988 a,.help988 button{padding:0 2px}
  .help988 .or{padding:0 2px}
  .help988 .dot{padding:0 1px}
}
.icon-btn,.back-btn{width:44px;height:44px;border-radius:50%;border:1px solid rgba(212,166,74,.35);background:rgba(3,8,22,.6);backdrop-filter:blur(8px);display:grid;place-items:center;padding:0}
.icon-btn svg,.back-btn svg{width:20px;height:20px;fill:none;stroke:var(--cream);stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.icon-btn .off{display:none}.icon-btn[aria-pressed=true] .off{display:block}.icon-btn[aria-pressed=true] .on{display:none}
.back-btn[hidden]{display:none!important}

.demo-note{position:fixed;left:10px;right:10px;bottom:calc(8px + var(--safe-b));top:auto;z-index:80;margin:0 auto;max-width:520px;text-align:center;font-size:.75rem;line-height:1.3;color:var(--gold-bright);background:rgba(3,8,22,.92);border:1px solid rgba(240,196,106,.35);border-radius:999px;padding:5px 12px;pointer-events:none}

#ui{position:fixed;inset:0;z-index:10;overflow:hidden}
.screen{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;padding:calc(var(--hud-h) + var(--safe-t)) 16px calc(64px + var(--safe-b));overflow-y:auto;overflow-x:hidden;animation:fade .7s ease both}
.screen.is-leave{animation:leavesoft 1.1s ease both;pointer-events:none;z-index:1}
/* r7: the lung labels and leaders fade with the leaving breathe scene */
#s-breathe.is-leave .air-label,#s-breathe.is-leave .leader,#s-breathe.is-leave .leader-dot{opacity:0!important;transition:opacity .5s ease!important}
.screen.is-enter{animation:fade 1.1s ease both;z-index:2}
/* words never double-expose: the old screen's text leaves first, the new text arrives after */
.screen.is-leave > :not(.win-sky):not(.room-wrap):not(.stage-art):not(.screen-bloom){animation:textout .4s ease both}
.screen.is-enter > :not(.win-sky):not(.bloom){animation:textin 1.1s ease both}
/* into the sunrise: the old room stays fully lit underneath until the sky covers it, so there is no dim frame */
.screen.is-leave.keep-lit{animation:none;opacity:1}
#s-win.is-leave{animation:fadeout 1.6s ease-in-out both}
/* room -> sunrise: the window's light blooms until it fills the whole room, then the sunrise fades in over that light,
   so no part of the room (clock, radio, plant, frame) is ever seen through the sky or behind the card */
.room-bloom{opacity:0;pointer-events:none;transform-box:view-box;transform-origin:104px 94px;transform:scale(.25)}
#s-ground.is-leave .room-bloom{animation:roombloom .75s ease-in both}
#s-ground.is-leave #room-frame{opacity:0;transition:opacity .6s ease}
#s-win.is-enter{animation:fade 1s ease .55s both}
/* r8: the window light fills the whole screen (not just the room box), so no room frame can ghost through the sky;
   the card only arrives once the sky is fully up */
.screen-bloom{position:fixed;inset:0;z-index:5;pointer-events:none;opacity:0;
  background:radial-gradient(circle at var(--bx,30%) var(--by,30%),#fff6d6 0%,#fbdc9a 14%,#f5b684 34%,#d98a9a 60%,#6d5a8e 100%)}
#s-ground.is-leave .screen-bloom{animation:fade .8s ease-in both}
#s-win.is-enter > .win-card{animation:fade .7s ease 1.3s both}
@keyframes roombloom{0%{opacity:0;transform:scale(.25)}55%{opacity:.9}100%{opacity:1;transform:scale(1)}}
/* worry -> room: the bright room arrives quickly while the dark worry scene dims slowly underneath, so luminance only rises */
.screen.is-enter.quick-in{animation:fade .5s ease-out both}
.screen.is-enter.quick-in > .room-wrap,.screen.is-enter.quick-in > .tap-echo{animation:none}
.screen.is-enter.quick-in > h2,.screen.is-enter.quick-in > .eyebrow,.screen.is-enter.quick-in > .g-prompt,.screen.is-enter.quick-in > .g-count{animation:textin 1.1s ease both}
.screen.is-leave.slow-out > *{animation:textout .6s ease-in both}
.screen.is-leave.slow-out > h2,.screen.is-leave.slow-out > .eyebrow{animation:textout .25s ease both}
.screen.is-leave.slow-out .cue,.screen.is-leave.slow-out .thought,.screen.is-leave.slow-out .worry-skip{transition:none;opacity:0}
@keyframes textout{to{opacity:0}}
@keyframes textin{0%,45%{opacity:0}100%{opacity:1}}
@keyframes leavesoft{0%,12%{opacity:1}65%,100%{opacity:0}}
@keyframes fade{from{opacity:0}to{opacity:1}}
@keyframes fadeout{from{opacity:1}to{opacity:0}}
.eyebrow{font-size:.72rem;letter-spacing:.2em;text-transform:uppercase;color:var(--gold);font-weight:600;display:block;margin-bottom:8px;text-align:center}
h1,h2{font-family:var(--serif);font-weight:600;margin:0;text-align:center;line-height:1.12;color:var(--cream);text-wrap:balance}
h1{font-size:clamp(1.8rem,calc(var(--vwu,1vw)*7),2.8rem)}
h2{font-size:clamp(1.35rem,calc(var(--vwu,1vw)*5.4),2.1rem)}
.lead{max-width:36ch;text-align:center;color:var(--cream-dim);line-height:1.45;margin:10px auto 0;font-size:.95rem}
.disc{font-size:.72rem;line-height:1.45;color:var(--mist);text-align:center;max-width:46ch;margin:14px auto 0}
.ages{font-size:.8rem;font-weight:700;color:var(--cream-dim);text-align:center;margin:10px 0 0}
.card{width:100%;max-width:520px;margin:0 auto;padding:22px 18px 18px;border-radius:24px;background:rgba(3,8,22,.72);border:1px solid rgba(212,166,74,.3);box-shadow:0 20px 60px rgba(0,0,0,.45)}
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 22px;border-radius:999px;border:1px solid rgba(240,196,106,.55);background:linear-gradient(180deg,#f0c46a,#d4a64a);color:var(--navy-950);font-weight:700;margin:16px auto 0;text-decoration:none}
.btn.alt{background:transparent;color:var(--cream);border-color:rgba(212,166,74,.45)}
.btn:disabled{opacity:.45}
.btn-row{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:14px}

/* rating */
#s-rate,#s-rerate{justify-content:flex-start}
/* scrolling screens never show content under the see-through header or the demo note: it fades out at both edges */
#s-intro,#s-rate,#s-crisis,#s-rerate,#s-end{-webkit-mask-image:linear-gradient(to bottom,transparent 0,transparent calc(var(--hud-h) + var(--safe-t) - 4px),#000 calc(var(--hud-h) + var(--safe-t) + 8px),#000 calc(100% - 50px - var(--safe-b)),transparent calc(100% - 40px - var(--safe-b)));mask-image:linear-gradient(to bottom,transparent 0,transparent calc(var(--hud-h) + var(--safe-t) - 4px),#000 calc(var(--hud-h) + var(--safe-t) + 8px),#000 calc(100% - 50px - var(--safe-b)),transparent calc(100% - 40px - var(--safe-b)))}
#s-rate .card,#s-rerate .card{padding:12px 10px 8px;display:flex;flex-direction:column;max-height:100%;min-height:0}
.rate-list{list-style:none;margin:6px 0 0;padding:0 0 4px;width:100%;max-width:520px;overflow-y:auto;flex:1;min-height:0;-webkit-overflow-scrolling:touch;position:relative}
.rate-list.can-scroll{mask-image:linear-gradient(180deg,#000 0%,#000 calc(100% - 22px),transparent 100%);-webkit-mask-image:linear-gradient(180deg,#000 0%,#000 calc(100% - 22px),transparent 100%)}
.scroll-hint{text-align:center;font-size:.82rem;font-weight:600;color:var(--gold-bright);margin:2px 0 0}
.help-now{align-self:center;background:none;border:1px solid rgba(212,166,74,.55);color:var(--gold-bright);border-radius:999px;font:600 .85rem/1 var(--sans,inherit);min-height:44px;padding:0 16px;margin:2px auto 6px;cursor:pointer}
.help-now:focus-visible{outline:2px solid var(--gold-bright);outline-offset:2px}
/* r7: the title and "I need help now" share one row so all 11 rows (each 44px+) fit at 390 */
.rate-head{display:flex;align-items:center;gap:10px;width:100%;max-width:520px;margin:0 auto}
.rate-title{flex:1;min-width:0;text-align:left}
.rate-title .eyebrow{display:block;margin:0 0 2px}
.rate-title h2{margin:0;font-size:1.08rem;line-height:1.25;text-align:left}
.rate-head .help-now{flex:none;margin:0;padding:0 12px}
.worry-skip{display:block;margin:6px auto 0;min-height:44px;font-size:.9rem;visibility:hidden;opacity:0;transition:opacity .8s ease}
.worry-skip.on{visibility:visible;opacity:1}
.rate-foot{position:sticky;bottom:0;padding:6px 4px 2px;background:linear-gradient(180deg,rgba(3,8,22,0),rgba(3,8,22,.96) 28%);margin-top:4px;z-index:2}
.rate-list .rate-opt{width:100%;display:flex;align-items:flex-start;gap:10px;text-align:left;min-height:44px;padding:3px 10px;border-radius:12px;border:1px solid rgba(212,166,74,.28);background:rgba(5,12,32,.7);color:var(--cream);margin:0 0 2px;transition:border-color .6s ease,background .6s ease}
.rate-list .rate-opt .n{flex:none;width:28px;font-family:var(--serif);font-size:1.3rem;font-weight:600;color:var(--gold-bright);line-height:1.2;align-self:center}
.rate-list .rate-opt .w{flex:1;font-size:.88rem;line-height:1.25;color:var(--cream-dim);padding-top:5px;align-self:center;padding-top:0}
.rate-list .rate-opt[aria-checked=true],.rate-list .rate-opt.sel{border-color:var(--gold-bright);background:rgba(212,166,74,.18)}
.rate-list .rate-opt[aria-checked=true] .w,.rate-list .rate-opt.sel .w{color:var(--cream)}
#s-rerate:not(.is-done) .rerate-face{display:none}
#s-rerate.is-done .rate-foot{position:static;display:flex;flex-direction:column;align-items:center;background:none}
#s-rerate.is-done .rate-foot .btn{margin:12px auto 0}
#s-rerate.is-done .card{max-height:none;flex-shrink:0}
#s-rerate .rate-foot{display:grid;grid-template-columns:1fr auto;align-items:center;gap:8px 10px;padding:8px 4px 2px}
#s-rerate .rate-foot .rate-now{text-align:left;margin:0;font-size:.85rem;line-height:1.3}
#s-rerate .rate-foot .btn{margin:0}
#s-rerate .rate-foot .kind-note,#s-rerate .rate-foot #rerate-crisis{grid-column:1/-1}
.rr-crisis{text-align:center;margin-top:8px}
.rr-lead{font-size:.9rem;margin:6px auto 0;max-width:36ch}
.rr-crisis .crisis-actions{margin:10px 0 2px}
#s-rate .rate-foot{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;padding:8px 4px 2px}
#s-rate .rate-foot .rate-now{text-align:left;margin:0;font-size:.85rem;line-height:1.3}
#s-rate .rate-foot .btn{margin:0}
.rate-now{text-align:center;margin:8px 0 0;font-size:.9rem;color:var(--gold-bright);min-height:1.4em}

/* crisis — navy text on gold, never gold-on-gold */
.us988{font-weight:600;text-align:center;margin:12px 0;color:var(--cream)}
.us988 a{margin:0 4px}
.crisis-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:12px 0 4px}
.crisis-actions a.btn{color:var(--navy-950);background-color:#f0c46a;background-image:linear-gradient(180deg,#f0c46a,#d4a64a);min-height:48px;margin:0;font-weight:700}
.crisis-actions a.btn.alt{color:var(--cream);background:transparent;border-color:rgba(212,166,74,.55)}
.persist-988{font-size:.82rem;font-weight:600;text-align:center;margin:8px 0 0;color:var(--cream-dim)}
.persist-988 a{color:var(--gold-bright)}

/* lungs */
.stage-art{width:100%;max-width:460px;margin:0 auto;flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;overflow:visible}
.art-box{position:relative;width:100%;max-width:min(430px,calc((calc(var(--vhu,1vh)*100) - 351px) * .69));aspect-ratio:4/5;margin:16px auto 0}
@supports (height:100dvh){.art-box{max-width:min(430px,calc((calc(var(--vhu,1dvh)*100) - 351px) * .69))}}
#lungs-svg,.face-svg,.room-svg,#mini-lungs{width:100%;height:100%;display:block;overflow:visible}
.face-svg,.room-svg{height:auto}
.cue{font-family:var(--serif);font-size:clamp(1.15rem,calc(var(--vwu,1vw)*4.2),1.55rem);text-align:center;margin:4px auto 0;min-height:1.3em;color:var(--cream);flex:none}
.moment{font-size:.84rem;line-height:1.3;text-align:center;color:var(--cream-dim);margin:2px auto 0;min-height:2.6em;height:2.6em;overflow:hidden;flex:none;transition:opacity 1s ease}
html:not([data-phase]) .moment{opacity:0}

/* labels: numbered chips outside the lung outline, leader lines run under them */
.air-label{position:absolute;transform:translateY(-50%);z-index:3;display:inline-flex;align-items:center;gap:5px;font:600 13px/1 var(--sans);letter-spacing:.01em;color:#fff7e6;background:rgba(3,8,22,.88);border:1px solid rgba(240,196,106,.7);border-radius:999px;padding:4px 9px 4px 4px;opacity:0;transition:opacity .8s ease;white-space:nowrap;pointer-events:none}
.air-label::before{content:attr(data-n);display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:var(--gold-bright);color:#050c20;font-size:11px;font-weight:700;flex:none}
.air-label.on-r{right:-12px}.air-label.on-l{left:-12px}
.air-label.on{opacity:1}
.leader{fill:none;stroke:var(--gold-bright);stroke-width:1.3px;vector-effect:non-scaling-stroke;opacity:0;transition:opacity .8s ease}
.leader.on{opacity:.95}
.leader-dot{fill:var(--gold-bright);stroke:#050c20;stroke-width:1px;vector-effect:non-scaling-stroke;opacity:0;transition:opacity .8s ease}
.leader-dot.on{opacity:1}
#air-paths path,.o2-path{fill:none!important;stroke:none!important}

/* head and body */
.face{fill:url(#g-face);stroke:#c49a74;stroke-width:.8}
.hair,.hair-back{fill:#5f4130}
.hair-back{fill:#4e3426}
.ear{fill:#e2be98;stroke:#c49a74;stroke-width:.6}
.brow{fill:none;stroke:#4a3424;stroke-width:1.8;stroke-linecap:round}
.eye{fill:none;stroke:#3a2a30;stroke-width:1.9;stroke-linecap:round}
.nose{fill:none;stroke:#b98b6a;stroke-width:1;stroke-linecap:round}
.cheek-s{fill:none;stroke:#c98a7a;stroke-width:1.6;stroke-linecap:round;opacity:.5}
.mouth{fill:#a85a5c}
.torso{fill:url(#g-torso);stroke:url(#g-torso-s);stroke-width:1.8}
.torso-sh{fill:url(#g-torso-sh);pointer-events:none}
.waist,.elbow,.bicep{fill:none;stroke:#b98266;stroke-width:1.3;opacity:.45;stroke-linecap:round}
.arm{fill:url(#g-arm);stroke:url(#g-arm-s);stroke-width:1.6}
.sternomast{fill:none;stroke:#f3d6b6;stroke-width:1.1;opacity:.45}
.neck{fill:#e7bf98;opacity:.55}
.chin-sh{fill:#9a6a52;opacity:.28}
.trap{fill:none;stroke:#f3d6b6;stroke-width:1.4;opacity:.5;stroke-linecap:round}
.blush{fill:#f19a88;opacity:.38}
.nostril{fill:none;stroke:#a87458;stroke-width:1;stroke-linecap:round}
.hair-hl{fill:none;stroke:#8a6448;stroke-width:2;stroke-linecap:round;opacity:.8}
.sternum{fill:#f3e8d0;fill-opacity:.42;stroke:#fbf1dc;stroke-opacity:.85;stroke-width:1}
.stern-line{stroke:#f1e6cc;opacity:.4;stroke-width:.8}
.rib{fill:none;stroke:#f1e6cc;stroke-width:3.4;stroke-linecap:round;opacity:.36}
.rib.low{opacity:.28}
.costal{fill:none;stroke:#f1e6cc;stroke-width:1.6;opacity:.22;stroke-linecap:round}
.clavicle{fill:none;stroke:#f7eedb;stroke-width:5;stroke-linecap:round;opacity:.85}
.ribs-over path{fill:none;stroke-linecap:round}
.ribs-over .rb{stroke:#f7ecd8;stroke-width:3;opacity:.42}
.ribs-over .cc{stroke:#dfeaf4;stroke-width:2.6;opacity:.62}
.sternum-over .sternum{fill:#f6ecd6;fill-opacity:.16;stroke:#fff6e2;stroke-opacity:.95;stroke-width:1.1}
.sternum-over .xiphoid{fill-opacity:.3}
.costal-over{fill:none;stroke:#f3e8d2;stroke-width:2.2;opacity:.62;stroke-linecap:round}
.notch{fill:none;stroke:#8a6a52;stroke-width:1.2;opacity:.7;stroke-linecap:round}
.dia{fill:url(#g-dia)}
.arch{fill:none;stroke:#c45366;stroke-width:9;stroke-linecap:round;opacity:.85}
.arch.desc{opacity:.45;stroke-dasharray:4 3}
.dia-top{fill:none;stroke:#f0b9a6;stroke-width:2.2;opacity:.9;stroke-linecap:round}
.dia-tendon{fill:#f0c6b4;opacity:.2}
.dia-fibre{fill:none;stroke:#f0c6b4;opacity:.2;stroke-width:1.2;stroke-linecap:round}
.heart{fill:url(#g-heart);stroke:#e9a0a6;stroke-width:1}
.heart-hl{fill:none;stroke:#ffd0d0;opacity:.35;stroke-width:2.4;stroke-linecap:round}
.aorta{fill:none;stroke:#cc6b76;stroke-width:8;stroke-linecap:round;opacity:.85}
.ptrunk{fill:none;stroke:#b86a8c;stroke-width:6;stroke-linecap:round;opacity:.8}
#heart-glow{opacity:0;transition:opacity 1.4s ease;pointer-events:none}
#lungs-svg.heart-lit #heart-glow{opacity:.95}
/* lungs */
.lung-fill{fill:url(#g-lung)}
.mediast{fill:#6a3c50;opacity:.5}
.lobe-low{fill:#7d3f5a;opacity:.3}
.lobe-mid{fill:#f2b4bc;opacity:.2}
.lung-shade{fill:url(#g-shade)}
.fiss-sh{fill:none;stroke:#3a1430;stroke-width:4;opacity:.55;stroke-linecap:round;transform:translate(1.2px,1.6px)}
.fiss{fill:none;stroke:#fff1f3;stroke-width:2.4;opacity:1;stroke-linecap:round}
.lung-edge{fill:none;stroke:#f2c9d2;stroke-width:1.6;stroke-linejoin:round;opacity:.9}
.vein{fill:none;stroke:#ff8a98;stroke-width:1.15;opacity:.6;stroke-linecap:round;stroke-linejoin:round}
.vein{transition:stroke 1.2s ease,opacity 1.2s ease}
/* oxygen: capillaries round each alveolus flush red, then oxygen-rich blood visibly flows along the veins to the heart */
#lungs-svg.o2-on .vein{stroke:#ff5576;opacity:1;stroke-width:2.8;stroke-dasharray:7 4;animation:vflow .9s linear infinite;filter:drop-shadow(0 0 1.6px rgba(255,90,120,.9))}
#lungs-svg.o2-on .trunk{stroke:#ff5576;opacity:1;stroke-width:4.6;stroke-dasharray:7 4;animation:vflow .9s linear infinite;filter:drop-shadow(0 0 2px rgba(255,90,120,.9))}
@keyframes vflow{to{stroke-dashoffset:-11}}
.cap{transition:stroke .8s ease,opacity .8s ease,stroke-width .8s ease}
html[data-phase=in][data-air=alveoli] .cap,#lungs-svg.o2-on .cap{stroke:#ff4f6d;opacity:1;stroke-width:1.5}
html.reduce-motion .vein,html.reduce-motion .trunk{animation:none!important;stroke-dasharray:none!important}
.trunk{transition:stroke 1.2s ease;fill:none;stroke:#ee6f82;stroke-width:3.4;opacity:.75;stroke-linecap:round}
.aw-out{fill:none;stroke:#3a2036;opacity:.55;stroke-linecap:round;stroke-linejoin:round}
.aw{fill:none;stroke:#aac2e2;stroke-linecap:round;stroke-linejoin:round}
.ring{fill:none;stroke:#6a82aa;stroke-width:1;opacity:.95}
.larynx{fill:#a9c0e0;fill-opacity:.5;stroke:#e0ecfa;stroke-width:1}
.larynx-notch{fill:none;stroke:#e0ecfa;stroke-width:.9}
.cricoid{fill:none;stroke:#e0ecfa;stroke-width:1.4;opacity:.9}
.nasal{fill:#bcd6f2;fill-opacity:.28;stroke:#dbe9f8;stroke-width:.7;stroke-opacity:.7}
/* upper airway: a soft internal glow seen through the face, never a hard tube over the nose and lips */
#upper{mix-blend-mode:screen}
#upper .nasal{fill-opacity:.3;stroke:#dbe9f8;stroke-opacity:.45;stroke-width:.6}
.pharynx-ghost{fill:none;stroke:#bcd6f2;stroke-width:6;stroke-linecap:round;opacity:.10;filter:blur(1.6px)}
.uaw-o{fill:none;stroke:#8fbbe6;stroke-width:5.2;stroke-linecap:round;stroke-linejoin:round;opacity:.38}
.uaw-i{fill:none;stroke:#e8f4ff;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;opacity:.5}
.uaw-o.mouthway{opacity:.22}.uaw-i.mouthway{opacity:.28}
html[data-phase=out] .uaw-o.mouthway{opacity:.45;stroke:#c9b6ea;transition:opacity 1s ease}
html[data-phase=out] .uaw-i.mouthway{opacity:.6;stroke:#efe6ff}
#glow-up{filter:blur(1.4px)}
.nose-glow{fill:#cfe3fa;opacity:0;filter:blur(2.4px);transition:opacity 1.2s ease}
html[data-phase=in] .nose-glow{opacity:.55;transition-duration:.9s}
html[data-phase=out] .nose-glow{opacity:.25;transition-duration:2.5s}
html[data-phase] #glow-up .ag-w{opacity:.3}
html[data-phase] #glow-up .ag-c{opacity:.75}
.groove{fill:none;stroke:#7a2a44;stroke-width:1.2;opacity:.45;stroke-linecap:round}
.svc{fill:none;stroke:#8c78b4;stroke-width:5;stroke-linecap:round;opacity:.8}
.carina{fill:none;stroke:#e4eefc;stroke-width:1.5;opacity:.85}
/* flow: the glow reveals along the airway as the front moves */
html{--flow:#8fd0ff;--flow-c:#f6fbff}
html[data-phase=out]{--flow:#b49be0;--flow-c:#f1e8ff}
.ag-w,.ag-c{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:0 3000;opacity:0}
.ag-w{stroke:var(--flow)}
.ag-c{stroke:var(--flow-c)}
html[data-phase] .ag-w{opacity:.34}
html[data-phase] .ag-c{opacity:.92}
/* alveoli */
.alveolus{fill:#f8d3bf;stroke:#d98d86;stroke-width:.7;transition:fill 1.2s ease}
.cap{fill:none;stroke:#ff7f90;stroke-width:.85;opacity:.7}
.duct{stroke:#aac2e2;stroke-width:1.3;stroke-linecap:round}
.alv-glow{fill:url(#g-alv);opacity:0;pointer-events:none;transition:opacity 1s ease}
.sac{transform-box:view-box;transition:transform 6s ease-in-out}
html[data-phase=in] .sac{transform:scale(1.26);transition-duration:4s}
html[data-phase=out] .sac{transform:scale(1);transition-duration:6s}
html[data-phase=in][data-air=alveoli] .alveolus{fill:#ffe8b4}
html[data-phase=in][data-air=alveoli] .alv-glow{opacity:1;transition-duration:.8s}
html[data-phase=out] .alveolus{fill:#e6d6f3}
.o2-spark{fill:url(#g-o2);display:none;opacity:0}
#lungs-svg.o2-on .o2-spark{display:inline}
.air-dot{fill:url(#g-air)}
.air-dot.co2{fill:url(#g-co2)}
/* chest, lungs and diaphragm move together (inhale 4 s, exhale 6 s) */
#chest{transform-box:view-box;transform-origin:200px 128px;transition:transform 6s ease-in-out}
#lungs-all{transform-box:view-box;transform-origin:200px 124px;transition:transform 6s ease-in-out}
#diaphragm{transform-box:view-box;transition:transform 6s ease-in-out}
html[data-phase=in] #chest{transform:translateY(-3px) scale(1.055,1.03);transition-duration:4s}
html[data-phase=in] #lungs-all{transform:scale(1.045,1.075);transition-duration:4s}
html[data-phase=in] #diaphragm{transform:translateY(16px);transition-duration:4s}
html[data-phase=out] #chest,html[data-phase=out] #lungs-all,html[data-phase=out] #diaphragm{transform:none;transition-duration:6s}
/* breath: cool motes drawn into the nostrils on the inhale; soft violet stress motes rise out and dissolve on the exhale.
   Every mote is invisible unless its own phase animation is running. */
.puff-in,.mote-out,.mote-haze{opacity:0;pointer-events:none}
.mote-out{filter:blur(.5px)}
.puff-in{fill:url(#g-puffin)}
.mote-out{fill:url(#g-mote)}
.mote-haze{fill:url(#g-puff)}
.puff-in,.mote-out{transform-box:fill-box;transform-origin:center}
html[data-phase=in] .puff-in{animation:puffin 2.4s ease-in both}
html[data-phase=in] .puff-in.q2{animation-delay:.5s}
html[data-phase=in] .puff-in.q3{animation-delay:1s}
html[data-phase=out] .mote-out{animation:moteout 2.8s ease-out both}
.breath-plume{fill:url(#g-plume);opacity:0;pointer-events:none;filter:blur(3px)}
html[data-phase=out] .breath-plume{animation:plume 5.6s ease-in-out both}
@keyframes plume{0%{opacity:0}20%{opacity:.95}70%{opacity:.7}100%{opacity:0}}
@keyframes puffin{0%{opacity:0;transform:translate(0,0) scale(1.5)}35%{opacity:.85}100%{opacity:0;transform:translate(var(--dx),var(--dy)) scale(.4)}}
/* stress leaves forward (growing toward the viewer) and down, away from the mouth and nose; never across the cheek or ear */
@keyframes moteout{0%{opacity:0;transform:translate(0,0) scale(.45)}22%{opacity:.95;transform:translate(calc(var(--mx) * .15),calc(var(--my) * .15)) scale(.9)}100%{opacity:0;transform:translate(var(--mx),var(--my)) scale(2.4)}}

/* reduced motion: nothing travels; the glow, labels and colours fade slowly; 4 s / 6 s timing stays in JS */
html.reduce-motion #chest,html.reduce-motion #lungs-all,html.reduce-motion #diaphragm,
html.reduce-motion[data-phase] #chest,html.reduce-motion[data-phase] #lungs-all,html.reduce-motion[data-phase] #diaphragm{transform:none;transition:none}
html.reduce-motion .sac,html.reduce-motion[data-phase] .sac{transform:none;transition:none}
html.reduce-motion .air-label,html.reduce-motion .leader,html.reduce-motion .leader-dot{opacity:.95}
html.reduce-motion .air-dot,html.reduce-motion .o2-spark,html.reduce-motion .mote-out,html.reduce-motion .puff-in{display:none}
html.reduce-motion .breath-plume{animation:none!important;transition:opacity 2s ease}
html.reduce-motion[data-phase=out] .breath-plume{opacity:.4}
html.reduce-motion .mote-haze{transition:opacity 2.5s ease}
html.reduce-motion[data-phase=out] .mote-haze{opacity:.7}
html.reduce-motion .ag-w,html.reduce-motion .ag-c{stroke-dasharray:none;transition:opacity 2.5s ease}
html.reduce-motion .ag-w,html.reduce-motion .ag-c{opacity:0}
html.reduce-motion[data-phase] .ag-w{opacity:.34}
html.reduce-motion[data-phase] .ag-c{opacity:.92}
html.reduce-motion #heart-glow{transition:opacity 2.5s ease}
html.reduce-motion[data-phase=in][data-air=alveoli] .vein,html.reduce-motion[data-phase=in][data-air=alveoli] .trunk{stroke:#ff6f88;opacity:.95}
html.reduce-motion[data-phase=in][data-air=alveoli] #heart-glow{opacity:.8}
@media (prefers-reduced-motion:reduce){
  .screen{animation:none}
  #chest,#lungs-all,#diaphragm,.sac{transition:none!important;transform:none!important}
  .air-dot,.o2-spark,.mote-out,.puff-in{display:none!important}
  .vein,.trunk,.breath-plume{animation:none!important}
}


@media (max-width:360px){
  .air-label{font-size:13px;padding:4px 8px}
  .air-label::before{display:none}
  .air-label.on-r{right:-14px}.air-label.on-l{left:-14px}
  /* r7: on small phones the pills sit out in the side margins, clear of the lungs */
  .air-label{font-size:12px;padding:3px 7px}
  .air-label.on-l{left:min(-14px,calc((100% - calc(var(--vwu,1vw)*100)) / 2 + 4px))}
  .air-label.on-r{right:min(-14px,calc((100% - calc(var(--vwu,1vw)*100)) / 2 + 4px))}
  #alv-inset .inset-t{font-size:25px}
}

/* posterior lower-lobe airways run behind the middle lobe / lingula in this front view */
.aw.post{opacity:.55}.aw-out.post{opacity:.4}
/* alveolus inset */
.inset-lead{fill:none;stroke:#f0c46a;stroke-width:1;stroke-dasharray:3 3;opacity:.75}
.inset-dot{fill:#f0c46a}
.inset-bg{fill:#1d1730;stroke:none}
.inset-ring{fill:none;stroke:#f0c46a;stroke-width:1.6;opacity:.9}
.inset-alv{fill:#f3c9b5;stroke:#d98d86;stroke-width:1.4}
.inset-alv-in{fill:#fbe3d4;opacity:.8}
html[data-phase=in] .inset-alv-in{fill:#fff0c8;transition:fill 1s ease}
.inset-cap{fill:none;stroke:#5e2238;stroke-width:12;stroke-linecap:round;stroke-linejoin:round}
.inset-cap-in{fill:none;stroke:url(#g-capflow);stroke-width:7.5;stroke-linecap:round;stroke-linejoin:round;opacity:.85}
.inset-br{fill:none;stroke:#7fa7cf;stroke-width:10;stroke-linecap:round}
.inset-br-in{fill:none;stroke:#e6f2ff;stroke-width:5;stroke-linecap:round;opacity:.9}
.inset-arrow{fill:none;stroke:#ff6f88;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
/* red cells: dull plum before oxygen, bright red once it arrives (inhale), in order along the flow */
.rbc{fill:#8a4a5e;stroke:#5a2236;stroke-width:.6;transition:fill 1.4s ease}
html[data-phase=in][data-air=alveoli] .rbc{fill:#ff3d57;stroke:#a51a32}
html[data-phase=out] .rbc{transition-duration:3s;transition-delay:0s!important}
.inset-t{font:600 19px system-ui,sans-serif;fill:#f6e9cf;paint-order:stroke;stroke:#050c20;stroke-width:3px;stroke-linejoin:round}
.o2x,.co2x{opacity:0;transform-box:fill-box}
.o2x{fill:#ffd66b}
.co2x{fill:#c9a8ff}
html[data-phase=in] .o2x{animation:xcross 2.2s ease-in-out both}
html[data-phase=out] .co2x{animation:xcross 2.8s ease-in-out both}
@keyframes xcross{0%{opacity:0;transform:translate(0,0)}20%{opacity:1}80%{opacity:1}100%{opacity:0;transform:translate(var(--tx),var(--ty))}}
html.reduce-motion .o2x,html.reduce-motion .co2x{animation:none!important;transition:opacity 2s ease}
html.reduce-motion[data-phase=in] .o2x{opacity:1}
html.reduce-motion[data-phase=out] .co2x{opacity:1}

/* r8: which of the three lung breaths this is */
.breath-count{position:absolute;left:0;bottom:3%;font:600 13px/1.2 Inter,system-ui,sans-serif;color:#e7dcc6;letter-spacing:.02em;background:rgba(10,16,34,.72);border:1px solid rgba(231,220,198,.28);border-radius:999px;padding:4px 10px;pointer-events:none}
.breath-count:empty{display:none}

/* r8: O2-rich blood beside the airways, visible only while oxygen flows */
#veins-top .vtop{opacity:0;transition:opacity 1s ease}
#lungs-svg.o2-on #veins-top .vtop{opacity:1;stroke:#ff4d6e;stroke-width:3.4}
html.reduce-motion[data-phase=in][data-air=alveoli] #veins-top .vtop{opacity:.9}

/* worry: the thought lifts up and away from the head; a jar of worry lightens and empties */
.worry-wrap{width:100%;max-width:460px;display:flex;flex-direction:column;align-items:center;gap:0;flex:1 1 auto;min-height:0}
.worry-sky{position:relative;width:100%;height:clamp(250px,calc(var(--vhu,1vh)*36),330px);display:flex;flex-direction:column;justify-content:flex-end;align-items:center;flex:none}
.face-box{width:min(150px,calc(var(--vwu,1vw)*38));flex:none;position:relative;z-index:2}
.thoughts{position:absolute;left:0;right:0;top:0;overflow:hidden;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 48px);mask-image:linear-gradient(to bottom,transparent 0,#000 48px);bottom:calc(min(150px,calc(var(--vwu,1vw)*38)) * 1.02);pointer-events:none;z-index:3}
.thought{position:absolute;left:50%;bottom:6px;transform:translate(-50%,0);max-width:88%;width:max-content;padding:11px 18px;border-radius:26px;background:rgba(58,50,92,.94);border:1px solid rgba(196,176,216,.7);color:var(--cream);font-size:1rem;line-height:1.3;text-align:center;opacity:1;box-shadow:0 0 26px rgba(150,130,200,.35),0 8px 22px rgba(0,0,0,.35);transition:opacity 6s linear,transform 6s cubic-bezier(.4,0,.9,.6),filter 6s linear}
.thought::before,.thought::after{content:"";position:absolute;border-radius:50%;background:rgba(58,50,92,.94);border:1px solid rgba(196,176,216,.6)}
.thought::before{width:12px;height:12px;left:50%;bottom:-14px;margin-left:-6px}
.thought::after{width:7px;height:7px;left:50%;bottom:-24px;margin-left:-14px}
.thought.leaving{opacity:0;transform:translate(calc(-50% + 52px),-176px) scale(.5);filter:blur(3px);transition-timing-function:ease-in,cubic-bezier(.4,0,.9,.6),linear}
.wisp{position:absolute;left:50%;bottom:10px;width:16px;height:16px;margin-left:-8px;border-radius:50%;background:radial-gradient(circle,rgba(214,196,240,.9),rgba(214,196,240,0) 70%);opacity:0;animation:wisp 6s ease-in both}
@keyframes wisp{0%{opacity:0;transform:translate(0,0) scale(.6)}15%{opacity:.8}100%{opacity:0;transform:translate(var(--wx,40px),-220px) scale(2.2)}}
.worry-low{display:flex;align-items:center;justify-content:center;gap:clamp(18px,calc(var(--vwu,1vw)*8),44px);width:100%;flex:1 1 auto;min-height:0;padding:6px 0}
.meter-wrap{width:auto;max-width:none;text-align:center}
.meter-label{font-size:.72rem;letter-spacing:.12em;text-transform:uppercase;color:var(--cream-dim);text-align:center;margin:0 0 2px}
.jar{width:clamp(96px,calc(var(--vwu,1vw)*28),128px);margin:0 auto}
.jar svg{width:100%;height:auto;display:block;overflow:visible}
.jar-back{fill:rgba(160,150,200,.06)}
.meter-fill{fill:#6a5a8c;transform-box:fill-box;transform-origin:50% 100%;transform:scaleY(1);transition:transform 6s linear,fill 6s linear}
.jar-bubble{fill:#fff;opacity:.16}
.jar-glass{fill:url(#jar-glass);stroke:#d9cdf2;stroke-width:1.8;stroke-linejoin:round;opacity:.9}
.jar-lid{fill:#d4a64a;stroke:#f0c46a;stroke-width:1}
.jar-halo{opacity:0;transition:opacity 3s ease}
.jar.done .jar-halo{opacity:1}
.jar.done .jar-glass{stroke:#f0c46a}
.meter-val{font-size:.8rem;color:var(--cream);text-align:center;margin-top:4px;min-height:1.2em}
.ring-wrap{width:clamp(80px,calc(var(--vwu,1vw)*24),108px);text-align:center}
.breath-ring{width:100%;height:auto;display:block;overflow:visible}
.ring-outer{fill:none;stroke:rgba(143,208,255,.45);stroke-width:1.6;stroke-dasharray:3 5}
.ring-inner{transform-box:fill-box;transform-origin:center;transform:scale(.5);opacity:.6;transition:transform 6s ease-in-out,opacity 6s ease-in-out}
html[data-phase=in] .ring-inner{transform:scale(1);opacity:1;transition-duration:4s}
html[data-phase=out] .ring-inner{transform:scale(.5);opacity:.6;transition-duration:6s}
.ring-cap{font-size:.72rem;letter-spacing:.12em;text-transform:uppercase;color:var(--cream-dim);margin:2px 0 0}
/* r7: the orb explains itself: it is the breath guide, growing on the in-breath and shrinking on the out-breath */
.ring-cap .rc-t{display:block}
.ring-cap .rc-s{display:block;margin-top:2px;font-size:.68rem;letter-spacing:0;text-transform:none;line-height:1.2;min-height:2.4em;color:var(--cream-dim)}
html.reduce-motion .ring-inner{transform:none;transition:opacity 4s ease-in-out}
html.reduce-motion[data-phase=in] .ring-inner{opacity:1;transform:none}
html.reduce-motion[data-phase=out] .ring-inner{opacity:.45;transform:none}
html.reduce-motion .wisp{animation:none;display:none}
html.reduce-motion .thought.leaving{transition:opacity 6s linear;transform:translate(-50%,0);filter:none}


/* room */
.room-wrap{width:100%;max-width:520px;flex:0 1 auto;min-height:0;display:flex;justify-content:center}
#s-ground{justify-content:center}
#s-ground .room-wrap{margin-top:12px}
.room-svg{width:100%;height:auto;max-height:min(calc(var(--vhu,1vh)*62),540px);flex:1}
.room-svg > *{pointer-events:none}
.room-svg [data-obj]{cursor:pointer;pointer-events:auto}
.room-svg [data-obj]{outline:none}
.room-svg [data-obj]:focus-visible .hl{opacity:.5;stroke:#ffe7a0;stroke-width:2.5;stroke-opacity:.9;fill-opacity:.25;filter:none}
/* no boxes: a tapped object gets a soft warm glow; keyboard focus gets a soft ring */
.room-svg .hl{stroke:none;fill:#fff1c2;opacity:0;filter:blur(5px);transition:opacity .9s ease}
.room-svg .hit{fill:transparent;stroke:none;pointer-events:all}
/* a tapped object glows softly in its own outline (no boxes) */
.room-svg [data-obj].on, .room-svg [data-obj][data-done]{filter:url(#r-objglow)}
.tap-echo{font-size:.88rem;color:var(--gold-bright);text-align:center;margin:6px 0 0;min-height:1.3em}
.g-prompt{margin-top:4px}
.room-svg [data-obj][data-done]{cursor:default}
.g-prompt{font-family:var(--serif);font-size:clamp(1.1rem,calc(var(--vwu,1vw)*4),1.45rem);text-align:center;margin:8px 0 0;text-wrap:balance}
.g-count{font-size:.85rem;color:var(--gold-bright);text-align:center;margin:4px 0 0}
#room-svg .room-warm{transition:opacity 3s ease}
#room-svg.sunrise .room-warm{opacity:.22}
#room-svg.sunrise .sky-top{stop-color:#f4c36e}
#room-svg.sunrise .sky-bot{stop-color:#ffe9c4}
#room-svg .sun-glow{transition:opacity 3s ease}
#room-svg.sunrise .sun-glow{opacity:1}
.room-svg .bloom-flower{opacity:0;transition:opacity 2s ease}
#room-svg.sunrise .bloom-flower{opacity:1}

/* win */
#s-win{padding:0 12px calc(46px + var(--safe-b));justify-content:flex-end;overflow:hidden}
.win-sky{position:absolute;inset:0;opacity:1;pointer-events:none;z-index:0;overflow:hidden}
.sunrise-svg{width:100%;height:100%;display:block}
#s-win.on .win-sky{opacity:1}
.win-sunwrap{transform-origin:200px 350px}
#s-win.on .win-sunwrap{animation:sunrise 5s cubic-bezier(.2,.7,.2,1) both}
.win-rays{opacity:0}
#s-win.on .win-rays{animation:rays 5s ease-out .6s both}
.win-halo{opacity:0;transform-origin:200px 350px}
#s-win.on .win-halo{animation:halo 5.5s ease-out 1.2s 1 both}
.win-stars{opacity:.9}
.bloom-flower{opacity:0}
#s-win .bloom-flower{transform-box:fill-box;transform-origin:50% 100%;transform:scaleY(.25);opacity:0}
#s-win .bloom-flower .petals{transform-box:fill-box;transform-origin:50% 50%;transform:scale(.2)}
#s-win.on .bloom-flower{animation:growup 2.4s ease-out forwards;animation-delay:calc(1.6s + var(--fd,0s))}
#s-win.on .bloom-flower .petals{animation:petalopen 1.6s ease-out forwards;animation-delay:calc(2.8s + var(--fd,0s))}
@keyframes growup{from{opacity:0;transform:scaleY(.25)}to{opacity:1;transform:scaleY(1)}}
@keyframes petalopen{from{transform:scale(.2)}to{transform:scale(1)}}
@keyframes sunrise{from{transform:translateY(70px);opacity:.3}to{transform:translateY(0);opacity:1}}
@keyframes rays{from{opacity:0}to{opacity:1}}
@keyframes halo{0%{opacity:0;transform:scale(.8)}25%{opacity:.55}100%{opacity:0;transform:scale(3.2)}}
@keyframes bloomin{from{opacity:0}to{opacity:.95}}
.win-card{position:relative;z-index:2;flex:0 0 auto;width:100%;max-width:440px;margin:0 auto;padding:12px 16px 14px;display:flex;flex-direction:column;align-items:center;text-align:center;border-radius:22px;background:linear-gradient(180deg,rgba(14,18,44,.58),rgba(10,12,34,.78));-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);border:1px solid rgba(255,233,176,.22);box-shadow:0 8px 30px rgba(8,6,24,.35)}
.win-card h2{margin:4px 0 0;font-size:1.4rem;letter-spacing:.02em;color:var(--cream)}
.win-meta{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:8px 0 10px;font-size:.78rem}
.badge-done,.meter-done{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:999px;border:1px solid rgba(240,196,106,.45);color:#f6e2b4;background:rgba(240,196,106,.12)}
.badge-done svg{width:12px;height:12px;fill:none;stroke:#f0c46a;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.meter-done{border-color:rgba(196,176,216,.45);background:rgba(150,130,200,.14);color:#e6dcf6}
.win-988{margin:8px 0 0;font-size:.9rem;color:var(--cream);text-align:center}
.win-988 a{color:var(--gold-bright);font-weight:600;white-space:nowrap}
.win-card .face-box{width:min(104px,calc(var(--vwu,1vw)*26));margin:0 auto}
.win-card .btn{margin:12px auto 0}
.ok-beat{font-family:var(--serif);font-size:clamp(1.55rem,calc(var(--vwu,1vw)*7),1.95rem);line-height:1.15;text-align:center;color:var(--gold-bright);margin:6px 0 0;text-wrap:balance;text-shadow:0 1px 8px rgba(8,6,24,.6)}
.ok-line{font-family:var(--serif);font-size:1.1rem;text-align:center;color:var(--cream);margin:6px 0 0;text-wrap:balance}
.affirm{list-style:none;padding:0;margin:6px 0 0;text-align:center}
.affirm li{font-family:var(--serif);font-size:1.04rem;color:#fff6e4;text-shadow:0 1px 3px rgba(6,6,20,.7);margin:2px 0;opacity:0;animation:fade .8s ease forwards}
.affirm li:nth-child(2){animation-delay:.3s}
html.reduce-motion .affirm li{animation:none;opacity:1}
/* r7: one gentle second moment at ~3 s: the sun clears the horizon and warm light slowly fills the sky (rises once, never pulses) */
.win-warm{position:absolute;inset:0;pointer-events:none;z-index:0;opacity:0;background:radial-gradient(120% 70% at 50% 40%,rgba(255,214,140,.55) 0%,rgba(255,190,120,.25) 40%,rgba(255,190,120,0) 75%)}
#s-win.on .win-warm{animation:warmup 2.8s ease-in-out 2.9s both}
@keyframes warmup{from{opacity:0}to{opacity:1}}
html.reduce-motion #s-win.on .win-warm{animation:none;opacity:1;transition:opacity 3s ease 2.9s}
.bloom{position:absolute;left:0;right:0;top:0;bottom:44%;pointer-events:none;overflow:hidden;z-index:1}
.bloom i{position:absolute;width:14px;height:14px;border-radius:50%;background:radial-gradient(circle,rgba(255,244,200,.95) 0%,rgba(255,226,150,.5) 40%,rgba(255,226,150,0) 70%);opacity:0;animation:mote 9s ease-in-out forwards}
@keyframes mote{
  0%{opacity:0;transform:translate(0,0) scale(.7)}
  25%{opacity:.8}
  75%{opacity:.5}
  100%{opacity:0;transform:translate(var(--dx,12px),-130px) scale(1.5)}
}
html.reduce-motion .win-rays{opacity:1;animation:none!important}
html.reduce-motion .win-halo{display:none}
html.reduce-motion #s-win .bloom-flower,html.reduce-motion #s-win .bloom-flower .petals{opacity:1;transform:none;animation:none!important}

/* compare / rerate */
.compare{margin:12px 0 0;padding:12px;border-radius:16px;border:1px solid rgba(212,166,74,.3);background:rgba(5,12,32,.55)}
.compare p{margin:6px 0;text-align:center;font-size:.95rem;line-height:1.4}
.compare .k{color:var(--mist);font-size:.72rem;letter-spacing:.1em;text-transform:uppercase;display:block;margin-bottom:2px}
#s-rerate.is-done .rate-list,#s-rerate.is-done .scroll-hint,#s-rerate.is-done #rerate-now{display:none}
.kind-note{margin:12px auto 0;max-width:36ch;text-align:center;color:var(--cream-dim);font-size:.95rem;line-height:1.4}

.modal{position:fixed;inset:0;z-index:60;background:rgba(3,8,22,.72);display:flex;align-items:center;justify-content:center;padding:24px 16px}
.modal .sheet{width:100%;max-width:420px;max-height:calc(var(--vhu,1vh)*90);overflow:auto;padding:22px 18px;border-radius:20px;background:var(--navy-800);border:1px solid rgba(212,166,74,.4)}
.modal h2{margin-bottom:10px}

.copy{font-size:.68rem;line-height:1.4;color:var(--mist);opacity:.8;text-align:center;margin:16px auto 0}

@media (max-width:360px){
  :root{--hud-h:110px}
  .screen{padding-left:12px;padding-right:12px;padding-bottom:calc(72px + var(--safe-b))}
  #s-rate .eyebrow,#s-rerate .eyebrow,#s-breathe .eyebrow{display:none}
  #s-rate h2,#s-rerate h2,#s-breathe h2{font-size:1.05rem}
  #s-rate .card,#s-rerate .card{padding:6px 8px 4px}
  .rate-list .rate-opt{min-height:44px;padding:6px 8px;margin:0 0 2px}
  .rate-list .rate-opt .w{font-size:.78rem;padding-top:2px}
  .rate-list .rate-opt .n{font-size:1.15rem}
  /* r7: more room for the list on 320 phones */
  .rate-title h2{font-size:1rem;line-height:1.2}
  .rate-head .help-now{padding:0 10px;font-size:.8rem}
  #s-rate .rate-list{margin-top:4px}
  #s-rate .rate-now:empty,#s-rerate .rate-now:empty{display:none}
  #s-rate .scroll-hint,#s-rerate .scroll-hint{margin:0}
  #s-rate .rate-foot,#s-rerate:not(.is-done) .rate-foot{padding-top:4px}
  #s-breathe{padding-bottom:calc(76px + var(--safe-b))}
  .cue{margin-top:2px;margin-bottom:0;font-size:1.15rem}
  .persist-988{margin-top:2px;font-size:.75rem}
  .card{padding:14px 12px 12px}
  .help988 a,.help988 button{min-width:44px}
  /* r7: even ~9px gaps between every item of the US 988 line at 320, while each link keeps a 40-44px target */
  .help988{gap:0;padding-left:11px}
  .help988 .us{padding:0}
  .help988 a[href^="tel"]{min-width:40px;padding:0}
  .help988 .or{padding:0}
  .help988 a[href^="sms"]{min-width:0;padding:0 4.5px 0 9px}
  .help988 .dot{padding:0 4.5px}
  .help988 button{min-width:40px;padding:0 0 0 4.5px;justify-content:flex-start}
  .art-box{max-width:min(272px,calc((calc(var(--vhu,1vh)*100) - 280px) * .69))}
  @supports (height:100dvh){.art-box{max-width:min(272px,calc((calc(var(--vhu,1dvh)*100) - 280px) * .69))}}
  /* crisis path: the persistent 988 line needs ~30px more, so the art shrinks instead of overlapping the title */
  body.fromcrisis .art-box{max-width:min(272px,calc((calc(var(--vhu,1vh)*100) - 316px) * .69))}
  @supports (height:100dvh){body.fromcrisis .art-box{max-width:min(272px,calc((calc(var(--vhu,1dvh)*100) - 316px) * .69))}}
  body.fromcrisis .worry-sky{height:140px}
  body.fromcrisis .ring-wrap{margin-top:4px}
  #s-rerate.is-done .rerate-face{width:64px;margin:2px auto}
  #s-rerate.is-crisis .rerate-face{display:none}
  #s-rerate.is-crisis .card > h2{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  #s-rerate.is-crisis .compare{padding:6px 10px;margin-top:0}
  #s-rerate.is-crisis .kind-note{margin:6px 0 2px}
  #s-rerate.is-crisis .rr-crisis{margin-top:4px}
  #s-rerate.is-crisis #end-go{margin-top:8px}
  #s-rerate.is-crisis .compare p{font-size:.8rem}
  .rr-crisis .us988{font-size:.85rem;white-space:nowrap}
  .rr-lead{font-size:.8rem;line-height:1.35}
  .rr-crisis .crisis-actions{flex-wrap:nowrap;gap:6px}
  .rr-crisis .crisis-actions a.btn{flex:1 1 0;min-width:0;padding:0 8px;font-size:.84rem;min-height:44px}
  #s-rerate .kind-note{font-size:.82rem}
  #s-rerate .compare{margin-top:6px;padding:8px}
  #s-rerate .compare p{font-size:.85rem;margin:3px 0}
  #s-rerate .kind-note{font-size:.85rem;margin-top:8px}
  #s-worry .eyebrow{display:none}
  #s-worry h2{font-size:1.05rem}
  .worry-sky{height:150px}
  .worry-low{flex:none}
  .worry-skip{margin-top:2px}
  .worry-wrap .face-box{width:78px}
  .thoughts{bottom:80px}
  .thought{font-size:.9rem;padding:8px 14px}
  .thought.leaving{transform:translate(calc(-50% + 40px),-120px) scale(.5)}
  .worry-low{padding:0;gap:22px;align-items:flex-start}
  .jar{width:72px}
  .ring-wrap{width:64px;margin-top:22px}
  .meter-label,.ring-cap{font-size:.62rem}
  .ring-cap .rc-s{font-size:.62rem;min-height:3.6em}
  .meter-val{font-size:.72rem}
  #s-ground .eyebrow{display:none}
  #s-ground h2{font-size:1.05rem;margin:0 0 4px;line-height:1.2}
  #s-ground .room-wrap{margin-top:0}
  .room-svg{max-height:none}
  #s-crisis .card{padding:10px 12px}
  #s-crisis .eyebrow{display:none}
  #s-crisis h2{font-size:1.15rem}
  #s-crisis .us988{font-size:.82rem;white-space:nowrap}
  #s-crisis .lead{font-size:.82rem;line-height:1.35;margin:6px 0 0}
  #s-crisis .crisis-actions{flex-wrap:nowrap;gap:6px;margin:8px 0 4px}
  #s-crisis .crisis-actions a.btn{flex:1 1 0;min-width:0;padding:0 8px;font-size:.84rem;min-height:44px}
  #s-crisis #crisis-go{min-height:44px;margin-top:2px}
  #s-crisis .copy{font-size:.62rem;margin-top:8px}
  .win-card{padding:8px 10px 10px}
  .win-card .face-box{width:58px}
  .win-card h2{font-size:1.2rem}
  .ok-beat{font-size:1.32rem;margin-top:2px}
  .win-card h2{font-size:1.15rem;margin-top:2px}
  .win-meta{font-size:.7rem;gap:4px;margin:5px 0 6px;flex-wrap:nowrap}
  .badge-done,.meter-done{padding:2px 6px;white-space:nowrap}
  .win-988{font-size:.82rem;margin-top:4px}
  .win-card .ok-line{font-size:.98rem;margin-top:3px}
  .win-card .affirm{margin-top:3px}
  .win-card .affirm li{font-size:.92rem;margin:1px 0}
  .win-card .btn{margin-top:8px;min-height:44px}
}
@media (max-height:560px) and (orientation:landscape){
  .screen{padding-top:calc(96px + var(--safe-t));flex-direction:row;flex-wrap:wrap;justify-content:center;align-items:flex-start}
  #lungs-svg{max-height:calc(var(--vhu,1vh)*70);max-width:calc(var(--vwu,1vw)*46)}
  .demo-note{font-size:.7rem;padding:4px 10px}
}

.face-box{position:relative}
.face-box .face-svg{transition:opacity .8s ease}
.face-box .face-svg.is-exit{position:absolute;inset:0;opacity:0}
.rerate-face{width:min(96px,calc(var(--vwu,1vw)*30));margin:6px auto}

/* r6: "text 988" never breaks across lines */
a[href="sms:988"],a[href="tel:988"]{white-space:nowrap}
/* r6: on narrow phones the "You chose..." line sits above Continue instead of being squeezed beside it */
@media (max-width:380px){
  #s-rate .rate-foot,#s-rerate:not(.is-done) .rate-foot{display:flex;flex-direction:column;align-items:stretch;gap:6px}
  #s-rate .rate-foot .rate-now,#s-rerate .rate-foot .rate-now{text-align:center}
  #s-rate .rate-foot .btn,#s-rerate:not(.is-done) .rate-foot .btn{align-self:center}
}
#again-go{display:flex;margin-left:auto;margin-right:auto}
/* r8 room: a slow breathing glow, in each object's own outline, on things that fit the current sense (a hint, not a demand) */
.room-svg [data-obj][aria-disabled="false"]:not([data-done]):not(.on){animation:objhint 4.4s ease-in-out infinite}
@keyframes objhint{0%,100%{filter:drop-shadow(0 0 0 rgba(255,232,170,0))}50%{filter:drop-shadow(0 0 5px rgba(255,232,170,.85))}}
html.reduce-motion .room-svg [data-obj][aria-disabled="false"]:not([data-done]):not(.on){animation:none;filter:drop-shadow(0 0 3px rgba(255,232,170,.6))}
@media (prefers-reduced-motion:reduce){.room-svg [data-obj][aria-disabled="false"]:not([data-done]):not(.on){animation:none;filter:drop-shadow(0 0 3px rgba(255,232,170,.6))}}
.tap-echo.redirect{color:#d9d2c3;font-style:italic}

/* r8 win: a small blooming plant on the card's edge; its flowers open once, slowly (the one gentle beat) */
.win-plant{position:absolute;right:16px;top:-84px;width:84px;height:95px;pointer-events:none;overflow:visible}
.wp-flower .wp-petals{transform-box:fill-box;transform-origin:50% 50%;transform:scale(.35);opacity:.75}
#s-win.on .wp-flower .wp-petals{animation:wpopen 2.6s cubic-bezier(.3,.7,.3,1) forwards}
#s-win.on .wp-flower.f1 .wp-petals{animation-delay:2.2s}
#s-win.on .wp-flower.f2 .wp-petals{animation-delay:2.5s}
#s-win.on .wp-flower.f3 .wp-petals{animation-delay:2.8s}
@keyframes wpopen{from{transform:scale(.35) rotate(-20deg);opacity:.75}to{transform:scale(1) rotate(0);opacity:1}}
html.reduce-motion .wp-flower .wp-petals{animation:none!important;transform:none;opacity:1}
@media (prefers-reduced-motion:reduce){.wp-flower .wp-petals{animation:none!important;transform:none;opacity:1}}
@media (max-width:360px){.win-plant{width:62px;height:70px;top:-62px;right:10px}}
/* r8 win: drifting petals instead of dust motes */
.bloom i{width:9px;height:13px;border-radius:80% 0 80% 0;background:linear-gradient(135deg,#ffd7df 0%,#f3a9bb 60%,#e98ea6 100%);box-shadow:0 0 6px rgba(255,214,224,.45);animation-name:petalfall;animation-timing-function:ease-in-out}
.bloom i:nth-child(3n){background:linear-gradient(135deg,#ffe6cf 0%,#f6c3a8 65%,#ee9f86 100%)}
@keyframes petalfall{
  0%{opacity:0;transform:translate(0,-40px) rotate(0deg)}
  20%{opacity:.9}
  80%{opacity:.75}
  100%{opacity:0;transform:translate(var(--dx,12px),90px) rotate(260deg)}
}
/* r8 worry: a bigger face that uses the empty band; a clearer breath-guide caption */
.worry-wrap{--fw:min(188px,calc(var(--vwu,1vw)*46),calc(calc(var(--vhu,1vh)*100) - 520px))}
.worry-sky{height:clamp(236px,calc(calc(var(--vhu,1vh)*100) - 530px),360px)}
@supports (height:100dvh){.worry-wrap{--fw:min(188px,calc(var(--vwu,1vw)*46),calc(calc(var(--vhu,1dvh)*100) - 520px))}.worry-sky{height:clamp(236px,calc(calc(var(--vhu,1dvh)*100) - 530px),360px)}}
.worry-wrap .face-box{width:max(120px,var(--fw))}
.thoughts{bottom:calc(max(120px,var(--fw)) * 1.02)}
.ring-cap{font-size:.8rem;color:var(--cream);opacity:.95}
.ring-cap .rc-s{font-size:.78rem;color:var(--cream);opacity:.85}
@media (max-width:360px){
  .worry-sky{height:178px}
  .worry-wrap .face-box{width:100px}
  .thoughts{bottom:102px}
  .ring-cap{font-size:.7rem}
  .ring-cap .rc-s{font-size:.7rem}
  body.fromcrisis .worry-sky{height:140px}
  body.fromcrisis .worry-wrap .face-box{width:78px}
  body.fromcrisis .thoughts{bottom:80px}
}
.ring-cap{width:150px;margin-left:calc(50% - 75px)}
@media (max-height:760px) and (min-width:361px){
  .jar{width:84px}
  .ring-wrap{width:72px}
  .worry-sky{height:184px}
  .worry-wrap{--fw:112px}
  .worry-wrap .face-box{width:112px}
  .thoughts{bottom:114px}
  .ring-cap{font-size:.7rem}
  .ring-cap .rc-s{font-size:.7rem;min-height:0}
  .worry-low{padding:0}
}
/* r8: on short phones the re-rate crisis block (US 988 call/text) fits without scrolling: drop the face there */
@media (max-height:700px){#s-rerate.is-crisis .rerate-face{display:none!important}}
/* r8: small phones: all eleven ratings (0-10) visible at once in two columns of 44px rows; the full words appear once chosen */
.rate-list .rate-opt .ws{display:none}
@media (max-width:360px) and (max-height:760px){
  .rate-list{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:repeat(6,44px);grid-auto-flow:column;gap:4px 6px;overflow:visible;flex:none;padding:0;margin-top:6px}
  .rate-list.can-scroll{mask-image:none;-webkit-mask-image:none}
  .rate-list .rate-opt{margin:0;min-height:44px;height:44px;padding:0 6px;gap:6px;align-items:center}
  .rate-list .rate-opt .n{width:20px;font-size:1.1rem;text-align:center}
  .rate-list .rate-opt .w{display:none}
  .rate-list .rate-opt .ws{display:block;flex:1;font-size:.76rem;line-height:1.15;color:var(--cream-dim)}
  .rate-list .rate-opt[aria-checked=true] .ws{color:var(--cream)}
  #s-rate .rate-now:not(:empty),#s-rerate .rate-now:not(:empty){font-size:.8rem;line-height:1.3;margin-top:6px}
}

.mail-card{margin:16px 0 4px;display:flex;flex-direction:column;gap:8px;text-align:left}
.mail-l{font-weight:600;color:var(--cream-dim)}
.mail-card input[type=email]{min-height:44px;border-radius:10px;border:1px solid rgba(212,166,74,.45);background:rgba(3,8,22,.6);color:inherit;padding:0 12px;font:inherit}
.mail-news{display:flex;gap:8px;align-items:center;min-height:44px;font-size:14px}
.mail-news input{width:22px;height:22px;flex:none}
.mail-msg{min-height:1.2em;font-size:14px;color:var(--mist)}

/* ---- Anxiety Relief (Nov 21): title, maker line, spoken cues ---- */
#s-intro h1{font-size:clamp(2.1rem,calc(var(--vwu,1vw)*9),2.9rem);letter-spacing:.01em}
.maker{margin:4px 0 12px;text-align:center;font-size:.74rem;letter-spacing:.16em;text-transform:uppercase;color:var(--gold);opacity:.85}
.sound-note{display:flex;gap:8px;align-items:flex-start;margin:10px 0 4px;font-size:.84rem;line-height:1.4;color:rgba(244,236,220,.82);text-align:left}
.sound-note svg{flex:none;width:18px;height:18px;margin-top:1px;fill:none;stroke:var(--gold);stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.cue[data-say="1"]::before{content:"\201C"}
.cue[data-say="1"]::after{content:"\201D"}
/* the person is the one speaking: soft sound arcs by the mouth while a cue is spoken (slow fade, never a flash) */
.speak-waves{position:absolute;display:flex;gap:3px;align-items:center;pointer-events:none;opacity:0;transition:opacity .9s ease}
.speak-waves i{display:block;width:7px;height:14px;border:2px solid rgba(255,240,200,.85);border-left:0;border-top-color:transparent;border-bottom-color:transparent;border-radius:0 50% 50% 0}
.speak-waves i:nth-child(2){height:20px;width:9px;opacity:.75}
.speak-waves i:nth-child(3){height:26px;width:11px;opacity:.5}
html[data-speaking] .speak-waves{opacity:1}
.sw-person{left:calc(50% + 30px);top:27.5%}
.worry-sky{position:relative}
.sw-face{left:calc(50% + min(60px,calc(var(--vwu,1vw)*17)));bottom:calc(min(150px,calc(var(--vwu,1vw)*38)) * .45)}
html.reduce-motion .speak-waves{transition:none}
.rate-now .rn-short{display:none}
@media (max-width:360px) and (max-height:760px){
  .rate-now .rn-full{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .rate-now .rn-short{display:inline}
  #s-rate .rate-foot,#s-rerate:not(.is-done) .rate-foot{display:grid;grid-template-columns:1fr auto;align-items:center;gap:8px}
  #s-rate .rate-foot .rate-now,#s-rerate:not(.is-done) .rate-foot .rate-now{text-align:left;margin:0;font-size:.78rem;line-height:1.25}
  #s-rerate:not(.is-done) .rate-foot .kind-note,#s-rerate:not(.is-done) .rate-foot #rerate-crisis{grid-column:1/-1}
}
/* 320: the breath guide keeps its title; the sub-line would collide with the meter count */
@media (max-width:360px){ .ring-cap .rc-s{display:none} }
@media (max-width:360px){ .sound-note{font-size:.78rem;margin-top:6px} }

/* ---- r10: validating welcome, one small next step ---- */
#s-welcome,#s-next{-webkit-mask-image:linear-gradient(to bottom,transparent 0,transparent calc(var(--hud-h) + var(--safe-t) - 4px),#000 calc(var(--hud-h) + var(--safe-t) + 8px),#000 calc(100% - 50px),transparent calc(100% - 40px));mask-image:linear-gradient(to bottom,transparent 0,transparent calc(var(--hud-h) + var(--safe-t) - 4px),#000 calc(var(--hud-h) + var(--safe-t) + 8px),#000 calc(100% - 50px),transparent calc(100% - 40px))}
#s-welcome{justify-content:center}
.sr-only{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.welcome-card{position:relative;text-align:center;padding-top:26px;background:radial-gradient(120% 80% at 50% 0%,rgba(255,214,150,.13),rgba(3,8,22,.74) 60%)}
.welcome-face{width:min(120px,calc(var(--vwu,1vw)*32));margin:6px auto 4px}
.sw-welcome{left:calc(50% + min(64px,calc(var(--vwu,1vw)*17)));top:calc(26px + 1.4rem + min(60px,calc(var(--vwu,1vw)*16)))}
.welcome-lines{min-height:9.5em;display:flex;flex-direction:column;justify-content:center;gap:12px;margin-top:6px}
.wl{margin:0;font-family:var(--serif);color:var(--cream);font-size:clamp(1.2rem,calc(var(--vwu,1vw)*5),1.5rem);line-height:1.3;opacity:0;transform:translateY(6px);transition:opacity 1.2s ease,transform 1.2s ease}
.wl.on{opacity:1;transform:none}
.wl-2{color:var(--gold-bright)}
.welcome-bar{height:3px;border-radius:3px;background:rgba(244,236,220,.12);margin:16px auto 6px;max-width:220px;overflow:hidden}
.welcome-bar i{display:block;height:100%;width:0;background:linear-gradient(90deg,rgba(240,196,106,.5),rgba(240,196,106,.95));transition:width linear}
.linkish{background:none;border:0;color:var(--cream-dim);text-decoration:underline;text-underline-offset:3px;font:inherit;font-size:.86rem;min-height:44px;padding:0 12px;margin:2px auto 0;display:block;cursor:pointer}
html.reduce-motion .wl{transition:none;transform:none}
.next-list{display:flex;flex-direction:column;gap:10px;margin:14px 0 4px}
.next-opt{display:flex;gap:12px;align-items:flex-start;text-align:left;width:100%;min-height:56px;padding:12px 14px;border-radius:16px;border:1px solid rgba(212,166,74,.3);background:rgba(255,255,255,.03);color:var(--cream);font:inherit;cursor:pointer}
.next-opt .ni{flex:none;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:rgba(240,196,106,.14);font-size:1.1rem}
.next-opt .nt{display:block;font-weight:600;font-size:.98rem;line-height:1.3}
.next-opt .nd{display:block;font-size:.84rem;color:var(--cream-dim);line-height:1.35;margin-top:2px}
.next-opt .nm{display:inline-block;font-size:.72rem;color:var(--gold);margin-top:4px;letter-spacing:.04em}
.next-opt[aria-checked=true]{border-color:var(--gold-bright);background:rgba(240,196,106,.12);box-shadow:0 0 0 1px rgba(240,196,106,.5) inset}
.next-row{margin-top:12px}
.next-lead{margin-top:8px}
.end-step{margin:12px auto 0;max-width:34ch;text-align:center;padding:10px 14px;border-radius:14px;background:rgba(240,196,106,.1);border:1px solid rgba(240,196,106,.35);color:var(--cream);font-size:.92rem;line-height:1.4}
@media (max-width:360px){
  .welcome-lines{min-height:8.5em}
  .wl{font-size:1.12rem}
  .next-opt{padding:10px 12px;min-height:52px}
  .next-opt .nd{font-size:.8rem}
  .next-list{gap:8px;margin-top:10px}
  #s-next .next-lead{font-size:.86rem}
  #s-next .next-row .btn{padding:0 16px}
}

/* r10: the companion. Open, soft eyes that look at you, a small smile, a slow natural blink and a gentle nod
   when they speak a comforting line. Reduced motion: no blink, no nod. */
.eye-w{fill:#fbf6ef}
.iris{fill:#5a3e2c}
.pupil{fill:#1f1512}
.glint{fill:#fff}
.lid{fill:none;stroke:#3a2a30;stroke-width:1.5;stroke-linecap:round}
.lash-low{fill:none;stroke:#c49a74;stroke-width:.7;stroke-linecap:round;opacity:.7}
.smile{fill:none;stroke:#a85a5c;stroke-width:1.7;stroke-linecap:round}
#head .mouth{opacity:0;transition:opacity .9s ease}
html[data-phase=out] #head .mouth{opacity:.9}
html[data-phase=out] #head .smile{opacity:.35;transition:opacity .9s ease}
#head .blink{transform-box:fill-box;transform-origin:50% 55%;animation:ar-blink 6.5s ease-in-out infinite}
#head .blink + .blink{animation-delay:0s}
@keyframes ar-blink{0%,93%,100%{transform:scaleY(1)}95.5%{transform:scaleY(.12)}}
#head .nod{transform-box:view-box;transform-origin:200px 92px}
html[data-comp] #head .nod{animation:ar-nod 2.6s ease-in-out 1}
@keyframes ar-nod{0%,100%{transform:rotate(0) translateY(0)}30%{transform:rotate(0) translateY(1.6px)}55%{transform:rotate(0) translateY(-.4px)}75%{transform:rotate(0) translateY(.8px)}}
html[data-comp] #face-box .face-svg:not(.is-exit){animation:ar-nod-f 2.6s ease-in-out 1;transform-origin:50% 80%}
@keyframes ar-nod-f{0%,100%{transform:translateY(0)}30%{transform:translateY(5px)}55%{transform:translateY(-1px)}75%{transform:translateY(2px)}}
html[data-speaking] .face-svg.companion{animation:ar-nod-f 3.2s ease-in-out infinite;transform-origin:50% 80%}
.cue.is-comp{font-style:italic;color:#f3e3c4;font-size:clamp(1.02rem,calc(var(--vwu,1vw)*3.8),1.3rem);transition:color .8s ease}
.rr-val{display:block;font-weight:600;margin-bottom:4px;color:var(--cream)}
html.reduce-motion #head .blink,html.reduce-motion #head .nod,html.reduce-motion .face-svg{animation:none!important}
@media (prefers-reduced-motion: reduce){#head .blink,#head .nod,.face-svg{animation:none!important}}

/* r11: opening comfort, topic chips, context chip on the second reassurance */
#s-comfort,#s-topic{-webkit-mask-image:linear-gradient(to bottom,transparent 0,transparent calc(var(--hud-h) + var(--safe-t) - 4px),#000 calc(var(--hud-h) + var(--safe-t) + 8px),#000 calc(100% - 50px),transparent 100%);mask-image:linear-gradient(to bottom,transparent 0,transparent calc(var(--hud-h) + var(--safe-t) - 4px),#000 calc(var(--hud-h) + var(--safe-t) + 8px),#000 calc(100% - 50px),transparent 100%)}
#s-comfort{justify-content:center}
.comfort-lines{min-height:6em}
.topic-sub{margin:4px 0 10px;color:var(--cream-dim);font-size:.92rem}
.topic-chips{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:4px 0 14px}
.topic-chip{min-height:44px;padding:9px 14px;border-radius:999px;border:1px solid rgba(212,166,74,.35);background:rgba(255,255,255,.03);color:var(--cream);font:inherit;font-size:.92rem;cursor:pointer;transition:background .3s ease,border-color .3s ease}
.topic-chip[aria-pressed=true]{background:rgba(240,196,106,.16);border-color:var(--gold-bright);box-shadow:0 0 0 1px rgba(240,196,106,.5) inset}
.topic-chip[aria-pressed=true]::before{content:"\2713\00a0";color:var(--gold-bright)}
.topic-chip:focus-visible,.next-opt:focus-visible{outline:2px solid var(--gold-bright);outline-offset:2px}
.topic-own{display:block;text-align:left;font-size:.88rem;color:var(--cream);margin:2px 0 6px}
.topic-own span{color:var(--cream-dim)}
.topic-text{width:100%;min-height:46px;border-radius:12px;border:1px solid rgba(244,236,220,.25);background:rgba(3,8,22,.5);color:var(--cream);padding:10px 12px;font:inherit;font-size:16px}
.topic-text::placeholder{color:rgba(244,236,220,.45)}
.topic-privacy{margin:6px 0 0;font-size:.78rem;color:var(--cream-dim);text-align:left}
.topic-row{margin-top:14px}
.welcome-ctx{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:2px 0 0}
.welcome-ctx span{font-size:.8rem;padding:4px 10px;border-radius:999px;background:rgba(240,196,106,.1);border:1px solid rgba(240,196,106,.3);color:var(--cream);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:360px){
  .topic-chip{padding:8px 11px;font-size:.86rem;min-height:42px}
  .topic-chips{gap:6px;margin-bottom:10px}
  #s-topic h2{font-size:1.25rem}
}
/* r11 fix: next-step rows read as icon + (title / line / time), never squeezed side by side */
.next-opt{display:grid;grid-template-columns:34px 1fr;column-gap:12px;row-gap:0;align-items:start}
.next-opt .ni{grid-row:1 / span 3}
.next-opt .nt,.next-opt .nd,.next-opt .nm{grid-column:2}
.next-opt .nm{justify-self:start}
.end-step .k{display:block;font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;color:var(--gold);margin-bottom:2px}
@media (max-height:700px){
  .topic-card{padding-top:14px}
  .topic-sub{display:none}
  #s-topic h2{font-size:1.2rem;margin-bottom:8px}
  .topic-chips{gap:6px;margin:2px 0 10px}
  .topic-chip{min-height:38px;padding:6px 11px;font-size:.84rem}
  .topic-own{margin-bottom:4px;font-size:.84rem}
  .topic-text{min-height:40px;padding:8px 10px}
  .topic-privacy{margin-top:4px}
  .topic-row{margin-top:10px}
  #topic-skip{margin-top:6px}
}
.topic-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px}
.topic-row .linkish{margin:0}
@media (max-height:700px){
  .topic-chips{display:grid;grid-template-columns:1fr 1fr}
  .topic-chip{padding:6px 8px;font-size:.8rem;line-height:1.15}
  #topic-skip{margin-top:0}
}
@media (max-height:700px){ .topic-chips{gap:5px;margin-bottom:8px} .topic-row{margin-top:8px} #s-topic h2{margin-top:2px} }
@media (max-height:640px){
  .next-opt .nd{display:none}
  #s-next .next-lead{font-size:.8rem;margin-top:4px}
  #s-next h2{font-size:1.15rem}
  .next-opt{min-height:46px;padding:8px 12px}
  .next-opt .ni{width:28px;height:28px;font-size:.95rem}
  .next-opt .nm{margin-top:1px}
}
@media (max-height:640px){
  .next-row{display:flex;flex-direction:row;gap:8px;margin-top:8px}
  .next-row .btn{flex:1;padding:0 8px;font-size:.84rem;min-height:44px;white-space:nowrap}
  .next-list{gap:6px;margin-top:8px}
  #next-skip{margin-top:4px}
}
@media (max-height:640px){ #s-next .next-row{flex-wrap:nowrap} #s-next .next-row .btn{margin:0;min-width:0;flex:1 1 0} }
/* Jamie 12:26: "Keep 988 small everywhere": the end card's 988 line matches the small muted header line */
#s-end .us988{font-size:.8rem;font-weight:400;color:var(--cream-dim);margin:8px 0}
#s-end .us988 a{font-weight:600}

/* r3: gentle, optional tip jar (end card only, never blocks) */
.tip-jar{margin:18px 0 6px;padding:14px 14px 12px;border:1px solid rgba(255,255,255,.10);border-radius:16px;background:rgba(255,255,255,.035);text-align:center}
.tip-h{margin:0 0 4px;font-size:15px;font-weight:600;color:#f3e9da;letter-spacing:.01em}
.tip-copy{margin:0 0 10px;font-size:13px;line-height:1.45;color:rgba(243,233,218,.78)}
.tip-row{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.tip-amt{display:flex;align-items:center;justify-content:center;min-height:44px;padding:0 6px;border-radius:12px;border:1px solid rgba(240,200,120,.45);color:#f6d79a;text-decoration:none;font-weight:600;font-size:15px;background:rgba(240,200,120,.06)}
.tip-amt:hover,.tip-amt:focus-visible{background:rgba(240,200,120,.16)}
.tip-own{font-size:13px;line-height:1.15;text-align:center}
.tip-fine{margin:8px 0 0;font-size:11.5px;line-height:1.4;color:rgba(243,233,218,.55)}
@media (max-width:360px){.tip-row{grid-template-columns:repeat(3,1fr)}.tip-own{grid-column:1/-1}}

/* r3: realistic companion + anatomy. The photo of the companion and a real anatomical lung image replace the drawn
   body; the drawn airway paths stay invisible guides for the air motes, labels and O2 sparks. */
#lungs-svg.realistic #chest > :not(#lungs-all),#lungs-svg.realistic #lungs-all > :not(#air-particles):not(#o2-sparks),#lungs-svg.realistic #diaphragm,
#lungs-svg.realistic #heart-g,#lungs-svg.realistic #veins,#lungs-svg.realistic #airways,#lungs-svg.realistic #great-vessels,
#lungs-svg.realistic #clusters,#lungs-svg.realistic #veins-top,#lungs-svg.realistic #glow,#lungs-svg.realistic .clav,#lungs-svg.realistic #clav,
#lungs-svg.realistic .ribs-over,#lungs-svg.realistic #head,#lungs-svg.realistic #upper,#lungs-svg.realistic #larynx-g,
#lungs-svg.realistic .inset-alv,#lungs-svg.realistic .inset-alv-in,#lungs-svg.realistic .inset-br,#lungs-svg.realistic .inset-br-in{display:none}
#lungs-svg.realistic .inset-cap,#lungs-svg.realistic .inset-cap-in{opacity:.55}
#real-body,#real-lungs,#xray-win{transform-box:view-box;transition:transform 6s cubic-bezier(.45,0,.3,1)}
#real-body{transform-origin:200px 460px}
#real-lungs,#xray-win{transform-origin:200px 170px}
#real-lungs image{filter:saturate(.92) brightness(1.02)}
#real-lungs{opacity:.9}
#real-closed{opacity:0;transition:opacity 1.6s ease}
html[data-phase=in] #real-body{transform:translateY(-2.5px) scale(1.014,1.01);transition-duration:4s}
html[data-phase=in] #real-lungs,html[data-phase=in] #xray-win{transform:scale(1.045,1.075);transition-duration:4s}
html[data-phase=out] #real-closed{opacity:1;transition-duration:2.2s}
html[data-phase=in] #real-closed{opacity:0;transition-duration:1.2s}
html.reduce-motion #real-body,html.reduce-motion #real-lungs,html.reduce-motion #xray-win{transform:none!important;transition:none}
.art-box{aspect-ratio:400/578}
/* companion portrait (comfort + welcome screens): the same real person you breathe with */
.comp-photo{width:min(112px,calc(var(--vwu,1vw)*30));aspect-ratio:1;margin:6px auto 4px;border-radius:50%;overflow:hidden;box-shadow:0 0 0 3px rgba(246,215,154,.25),0 10px 30px rgba(0,0,0,.35)}
.comp-photo img{width:100%;height:100%;object-fit:cover;object-position:50% 22%;transform:scale(1.9);transform-origin:50% 22%;display:block}

/* r3 grounding: photographic object cards, 3 x 3, all valid for the current sense */
#s-ground .room-svg{display:none}
.obj-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:100%;max-width:min(420px,calc((calc(var(--vhu,1dvh)*100) - 330px) * 1.0));margin:0 auto}
.obj-card{position:relative;display:block;padding:0;border:0;border-radius:14px;overflow:hidden;background:#efe6d8;cursor:pointer;aspect-ratio:1;box-shadow:0 4px 14px rgba(0,0,0,.28);transition:transform .35s ease,box-shadow .5s ease,filter .5s ease;-webkit-tap-highlight-color:transparent}
.obj-card img{width:100%;height:100%;object-fit:cover;display:block}
.obj-n{position:absolute;left:0;right:0;bottom:0;padding:14px 4px 5px;font:600 12px/1.15 var(--sans,system-ui);color:#fff;text-align:center;background:linear-gradient(to top,rgba(20,12,30,.78),rgba(20,12,30,0));text-shadow:0 1px 2px rgba(0,0,0,.5)}
.obj-card:focus-visible{outline:3px solid #f6d79a;outline-offset:2px}
.obj-card[data-done]{box-shadow:0 0 0 3px #f6d79a,0 0 22px rgba(246,215,154,.55);transform:scale(.97)}
.obj-card[data-done]::after{content:"";position:absolute;top:6px;right:6px;width:22px;height:22px;border-radius:50%;background:#f6d79a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%231c1430' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat}
#s-ground .g-prompt{margin:6px 0 0}
#s-ground .g-count{margin:2px 0 6px}
html.reduce-motion .obj-card{transition:none}
@media (max-width:360px){.obj-grid{gap:6px}.obj-n{font-size:11px;padding-bottom:4px}}
#lungs-svg.realistic ~ .sw-person,.stage-art .sw-person{display:none}

/* ===== round 4: worry screen — photo companion, x-ray brain with neural signals, glowing gauge ===== */
#s-worry{--fw:min(206px,calc(var(--vwu,1vw)*53))}
#s-worry .worry-sky{height:clamp(262px,calc(var(--vhu,1vh)*37),330px)}
#s-worry .face-box{width:var(--fw)}
#s-worry .thoughts{bottom:calc(var(--fw) * 1.1);-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 30px);mask-image:linear-gradient(to bottom,transparent 0,#000 30px)}
#s-worry .sw-face{display:none}
.wm-scene{position:relative;width:100%;aspect-ratio:480/560;border-radius:0 0 18px 18px}

.wm-f{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity 1.2s ease 1.5s;-webkit-mask-image:radial-gradient(closest-side ellipse at 50% 46%,#000 62%,transparent 100%);mask-image:radial-gradient(closest-side ellipse at 50% 46%,#000 62%,transparent 100%);user-select:none;-webkit-user-drag:none}
.wm-f.on{opacity:1;transition:opacity 1.5s ease 0s}
.wm-f[data-s="0"]{opacity:1}
.wm-brain{position:absolute;left:16.7%;top:2%;width:67%;height:49%;pointer-events:none;mix-blend-mode:screen;-webkit-mask-image:linear-gradient(to bottom,#000 58%,transparent 74%);mask-image:linear-gradient(to bottom,#000 58%,transparent 74%);--calm:0}
.wm-brain img{position:absolute;inset:0;width:100%;height:100%;user-select:none}
.wm-brain .b-warm{filter:sepia(.55) saturate(1.9) hue-rotate(-18deg) brightness(1.04) drop-shadow(0 0 6px rgba(255,110,60,.75));opacity:calc(.9 - var(--calm) * .9);transition:opacity 2.4s ease}
.wm-brain .b-cool{filter:grayscale(.35) sepia(.45) hue-rotate(150deg) saturate(1.7) brightness(1.08) drop-shadow(0 0 6px rgba(80,220,235,.75));opacity:calc(var(--calm) * .9);transition:opacity 2.4s ease}
.wm-net{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.wm-brain img,.wm-brain .wm-net{object-fit:fill}
.net-lines path{fill:none;stroke:var(--net,#ffb070);stroke-width:1.6;stroke-linecap:round;opacity:.5;transition:stroke 2.4s ease}
.net-exits path{fill:none;stroke:var(--net,#ffb070);stroke-width:2.2;stroke-linecap:round;opacity:0;stroke-dasharray:1 1}
.net-exits path.fire{opacity:.95;animation:netfire var(--fd,1.6s) ease-in forwards}
@keyframes netfire{0%{stroke-dasharray:0 1;opacity:.95}70%{stroke-dasharray:1 0;opacity:.95}100%{stroke-dasharray:1 0;opacity:0}}
.net-nodes circle{fill:var(--net,#ffb070);opacity:.85;transition:fill 2.4s ease}
.net-sig circle{fill:#fff;pointer-events:none}
.net-sig circle.h{fill:var(--net,#ffb070);opacity:.45}
#s-worry .thought{background:rgba(70,34,30,.9);border-color:rgba(255,170,120,.75);box-shadow:0 0 22px rgba(255,130,80,.45),0 8px 20px rgba(0,0,0,.35);transition-property:opacity,transform,filter,background,border-color}
#s-worry .thought::before,#s-worry .thought::after{background:rgba(255,170,120,.9);border-color:rgba(255,200,160,.9);box-shadow:0 0 10px rgba(255,150,90,.9)}
#s-worry .thought.leaving{background:rgba(30,70,86,.85);border-color:rgba(130,230,240,.8);box-shadow:0 0 30px rgba(110,220,240,.6)}
#s-worry .wisp{background:radial-gradient(circle,rgba(150,235,255,.95),rgba(150,235,255,0) 70%)}

.worry-low{align-items:flex-end}
.meter-wrap{display:grid;grid-template-columns:auto auto;grid-template-areas:"lab lab" "g num" "g val";column-gap:10px;align-items:center;justify-items:start}
.meter-wrap .meter-label{grid-area:lab;justify-self:center}
.gauge{grid-area:g;width:clamp(84px,calc(var(--vwu,1vw)*24),104px);margin:0}
.m-read{grid-area:num;margin:0;display:flex;flex-direction:column;align-items:flex-start;align-self:end}
.m-num{font-family:var(--serif,Georgia,serif);font-size:clamp(2.6rem,calc(var(--vwu,1vw)*12),3.4rem);line-height:.95;font-weight:600;color:var(--mc,#ffb347);text-shadow:0 0 18px var(--mcg,rgba(255,140,70,.6));transition:color 2s ease,text-shadow 2s ease;display:inline-block}
.m-num.tick{animation:mtick .42s cubic-bezier(.3,1.6,.5,1)}
@keyframes mtick{0%{transform:translateY(-6px) scale(1.12)}100%{transform:none}}
.m-word{font-size:.8rem;letter-spacing:.12em;text-transform:uppercase;color:var(--mc,#ffb347);transition:color 2s ease;margin-top:2px}
.meter-wrap .meter-val{grid-area:val;text-align:left;align-self:start;max-width:9.5em;line-height:1.25}
#s-worry .worry-low{padding-top:14px}
.g-back{fill:rgba(170,190,230,.07)}
.meter-fill{transition:transform 6s cubic-bezier(.45,0,.35,1)}
.g-wave{transition:transform 6s cubic-bezier(.45,0,.35,1)}
.g-wave path{fill:url(#liq-g)}
.g-wave .w1{animation:wv 3.2s linear infinite;opacity:.95}
.g-wave .w2{animation:wv 4.6s linear infinite reverse;opacity:.55}
@keyframes wv{from{transform:translateX(0)}to{transform:translateX(-40px)}}
.g-bubbles circle{fill:#fff;opacity:0;animation:gb 3.4s ease-in infinite}
.g-bubbles circle:nth-child(2){animation-delay:.8s;animation-duration:2.8s}
.g-bubbles circle:nth-child(3){animation-delay:1.5s}
.g-bubbles circle:nth-child(4){animation-delay:2.2s;animation-duration:3s}
.g-bubbles circle:nth-child(5){animation-delay:.4s;animation-duration:4s}
@keyframes gb{0%{opacity:0;transform:translateY(0)}20%{opacity:.55}100%{opacity:0;transform:translateY(-46px)}}
.g-shine{fill:#fff;opacity:.22}
.jar-glass{fill:url(#glass-g);stroke:rgba(225,235,255,.75);stroke-width:2;opacity:1}
.gauge.done .jar-glass{stroke:#9ff0ff}
.g-ticks line{stroke:rgba(225,235,255,.45);stroke-width:1.6;stroke-linecap:round}
.g-halo{transition:opacity 2s ease}
.g-drops circle{fill:var(--mc,#ffb347);opacity:0;animation:gdrop .9s ease-out forwards}
@keyframes gdrop{0%{opacity:.95;transform:translate(0,0)}100%{opacity:0;transform:translate(var(--dx),var(--dy))}}
.g-drops .ripple{fill:none;stroke:var(--mc,#ffb347);stroke-width:1.5;opacity:0;transform-box:fill-box;transform-origin:center;animation:grip 1s ease-out forwards}
@keyframes grip{0%{opacity:.9;transform:scaleX(.3)}100%{opacity:0;transform:scaleX(1.6)}}
html.reduce-motion .g-wave path,html.reduce-motion .g-bubbles circle,html.reduce-motion .g-drops *{animation:none}
html.reduce-motion .g-bubbles circle{opacity:0}
html.reduce-motion .m-num.tick{animation:none}
html.reduce-motion .net-exits path.fire{animation:none;opacity:0}
.win-photo{width:100%;aspect-ratio:480/560;object-fit:cover;border-radius:50% 50% 18px 18px;display:block;-webkit-mask-image:radial-gradient(ellipse 62% 70% at 50% 46%,#000 70%,transparent 100%);mask-image:radial-gradient(ellipse 62% 70% at 50% 46%,#000 70%,transparent 100%)}
@media (max-height:700px){
  #s-worry{--fw:min(150px,calc(var(--vwu,1vw)*44))}
  #s-worry .worry-sky{height:196px}
  #s-worry .worry-wrap .face-box{width:var(--fw)}
  #s-worry .thoughts{bottom:calc(var(--fw) * 1.1)}
  .gauge{width:70px}
  .m-num{font-size:2.3rem}
  .m-word{font-size:.68rem}
}
.wm-scene{transform:scale(1.26);transform-origin:50% 72%}
.net-lines path{stroke-width:2.6;opacity:.8}
.net-nodes circle{r:4.5}
.net-sig circle{filter:none}
#s-worry .worry-low{gap:clamp(10px,calc(var(--vwu,1vw)*4),26px)}
#s-worry .ring-wrap{width:clamp(78px,calc(var(--vwu,1vw)*22),98px)}
#s-worry .ring-cap .rc-s{white-space:normal}
/* r4: one clean sizing set for the photo worry scene (overrides the older drawn-face sizes) */
#s-worry .worry-wrap{--fw:min(196px,calc(var(--vwu,1vw)*50))}
#s-worry .worry-sky{height:clamp(300px,calc(var(--vhu,1vh)*37),330px)}
#s-worry .worry-wrap .face-box{width:var(--fw)}
#s-worry .worry-wrap .thoughts{bottom:calc(var(--fw) * 1.3)}
#s-worry .thought.leaving{transform:translate(calc(-50% + 30px),-120px) scale(.6)}
body.fromcrisis #s-worry .worry-wrap{--fw:min(170px,calc(var(--vwu,1vw)*46))}
body.fromcrisis #s-worry .worry-sky{height:270px}
@media (max-height:760px){
  #s-worry .worry-wrap{--fw:132px}
  #s-worry .worry-sky{height:226px}
  body.fromcrisis #s-worry .worry-wrap{--fw:118px}
  body.fromcrisis #s-worry .worry-sky{height:206px}
  #s-worry .gauge{width:72px}
}
@media (max-height:640px){
  #s-worry .worry-wrap{--fw:112px}
  #s-worry .worry-sky{height:192px}
  body.fromcrisis #s-worry .worry-wrap{--fw:100px}
  body.fromcrisis #s-worry .worry-sky{height:176px}
  #s-worry .gauge{width:58px}
  #s-worry .m-num{font-size:2rem}
  #s-worry .thought.leaving{transform:translate(calc(-50% + 24px),-80px) scale(.6)}
}
.net-lines path{stroke-width:5;opacity:.7}
.net-nodes circle{r:8}
.net-exits path{stroke-width:7}

/* ===== round 4: win — feel-good reveal, the companion speaks, affirmations rotate ===== */
.win-light{position:absolute;left:50%;top:34%;width:150vmax;height:150vmax;margin:-75vmax 0 0 -75vmax;border-radius:50%;pointer-events:none;z-index:1;opacity:0;transform:scale(.2);background:radial-gradient(circle,rgba(255,246,214,.75) 0%,rgba(255,214,150,.35) 18%,rgba(255,200,140,.12) 34%,rgba(255,200,140,0) 52%)}
#s-win.on .win-light{animation:winlight 3.4s cubic-bezier(.2,.7,.2,1) .8s forwards}
@keyframes winlight{0%{opacity:0;transform:scale(.2)}55%{opacity:1}100%{opacity:.75;transform:scale(1)}}
.win-sparks{position:absolute;left:50%;top:34%;width:0;height:0;z-index:2;pointer-events:none}
.win-sparks i{position:absolute;left:-4px;top:-4px;width:8px;height:8px;border-radius:50%;background:radial-gradient(circle,#fffbe8 0%,rgba(255,220,140,.8) 40%,rgba(255,220,140,0) 72%);opacity:0;animation:winspark 4s ease-out infinite}
@keyframes winspark{0%{opacity:0;transform:translate(0,0) scale(.4)}18%{opacity:1}70%{opacity:.7}100%{opacity:0;transform:translate(var(--sx),var(--sy)) scale(1.1)}}
.win-comp{position:relative;z-index:3;display:flex;flex-direction:column;align-items:center;margin:0 auto 10px;flex:none;opacity:0}
#s-win.on .win-comp{animation:wincomp 1.6s cubic-bezier(.2,.7,.2,1) 1.4s forwards}
@keyframes wincomp{0%{opacity:0;transform:translateY(14px) scale(.94)}100%{opacity:1;transform:none}}
.wc-photo{width:min(150px,calc(var(--vwu,1vw)*38));aspect-ratio:480/560;border-radius:50%;overflow:hidden;position:relative;box-shadow:0 0 0 2px rgba(255,233,176,.55),0 0 34px rgba(255,214,140,.65),0 0 80px rgba(255,190,120,.35);transition:box-shadow .6s ease}
.wc-photo img{width:100%;height:100%;object-fit:cover;object-position:50% 40%;transform:scale(1.22);transform-origin:50% 42%;display:block}
.win-comp.talking .wc-photo{animation:wctalk 2.4s ease-in-out infinite;box-shadow:0 0 0 2px rgba(255,240,196,.85),0 0 44px rgba(255,224,160,.85),0 0 96px rgba(255,200,130,.45)}
@keyframes wctalk{0%,100%{transform:none}30%{transform:translateY(-2px) rotate(-.6deg)}65%{transform:translateY(1px) rotate(.5deg)}}
.wc-say{margin:10px 0 0;max-width:min(320px,calc(var(--vwu,1vw)*88));min-height:2.6em;padding:8px 14px;border-radius:16px;background:rgba(18,16,44,.62);border:1px solid rgba(255,233,176,.3);font-family:var(--serif);font-style:italic;font-size:1.02rem;line-height:1.25;color:#fff6e4;text-align:center;opacity:0;transition:opacity .6s ease}
.wc-say:empty{visibility:hidden}
.wc-say.on{opacity:1}
.win-title{opacity:0}
#s-win.on .win-title{animation:wintitle 1.8s ease 1.6s forwards}
@keyframes wintitle{0%{opacity:0;letter-spacing:.32em;text-shadow:0 0 0 rgba(255,220,150,0)}60%{opacity:1;text-shadow:0 0 24px rgba(255,220,150,.9)}100%{opacity:1;letter-spacing:.02em;text-shadow:0 0 10px rgba(255,220,150,.45)}}
#s-win.on .ok-beat{animation:fade 1.2s ease 2.5s both}
.affirm li#affirm-li{opacity:0;animation:none;transition:opacity .6s ease;min-height:1.3em}
.affirm li#affirm-li.on{opacity:1}
html.reduce-motion .win-light{animation:none!important;opacity:.7;transform:none}
html.reduce-motion .win-comp,html.reduce-motion .win-title{animation:none!important;opacity:1}
html.reduce-motion .win-comp.talking .wc-photo{animation:none}
html.reduce-motion .affirm li#affirm-li{transition:none;opacity:1}
html.reduce-motion #s-win.on .ok-beat{animation:none}
@media (max-height:700px){
  .wc-photo{width:96px}
  .wc-say{font-size:.9rem;margin-top:6px;padding:6px 10px}
  .win-comp{margin-bottom:6px}
}
@media (max-height:600px){ .wc-photo{width:78px} }
.win-plant{display:none}

/* ===== round 4: real breathing — layered photo (torso swells from the waist, head and shoulders rise with it), air from nose/mouth to an alveolus ===== */
#lungs-svg.realistic #chest,#lungs-svg.realistic #lungs-all{transform:none!important;transition:none!important}
html[data-phase=in] #real-body,html[data-phase=out] #real-body,#real-body{transform:none!important}
#rb-torso,#rb-head{transform-box:view-box;transition:transform 6s cubic-bezier(.42,0,.38,1)}
#rb-torso{transform-origin:200px 470px}
html[data-phase=in] #rb-torso{transform:scale(1.022,1.03);transition-duration:4s}
html[data-phase=in] #rb-head{transform:translateY(-9px);transition-duration:4s}
#real-lungs,#xray-win{transform-origin:200px 140px}
html[data-phase=in] #real-lungs,html[data-phase=in] #xray-win{transform:translateY(-8px) scale(1.04,1.085)}
#glow-real{filter:blur(.6px)}
#glow-real .ag-w{stroke:#8fdcff}
#glow-real .ag-c{stroke:#e9f8ff}
html[data-phase=out] #glow-real .ag-w{stroke:#c3a6f0}
html[data-phase=out] #glow-real .ag-c{stroke:#f3ecff}
#real-lungs .air-dot{filter:drop-shadow(0 0 3px rgba(190,235,255,.95))}
.nf-in,.nf-out{opacity:0;pointer-events:none}
.nf-in{fill:url(#g-puffin)}
.nf-out{fill:url(#g-puff)}
html[data-phase=in] .nf-in{animation:nfin 1.9s ease-in 2}
html[data-phase=in] .nf-in.b{animation-delay:.35s}
html[data-phase=in] .nf-in.c{animation-delay:.7s}
@keyframes nfin{0%{opacity:0;transform:translate(0,0) scale(1.4)}35%{opacity:.85}100%{opacity:0;transform:translate(var(--tx,8px),var(--ty,16px)) scale(.4)}}
.nf-in.a{--tx:9px;--ty:15px}.nf-in.b{--tx:-9px;--ty:15px}.nf-in.c{--tx:0px;--ty:20px}
.nf-in,.nf-out{transform-box:fill-box;transform-origin:center}
html[data-phase=out] .nf-out{animation:nfout 2.6s ease-out 2}
html[data-phase=out] .nf-out.b{animation-delay:.3s}
html[data-phase=out] .nf-out.c{animation-delay:.5s}
@keyframes nfout{0%{opacity:0;transform:translate(0,0) scale(.5)}25%{opacity:.75}100%{opacity:0;transform:translate(0,22px) scale(2.4)}}
html.reduce-motion .nf-in,html.reduce-motion .nf-out{animation:none!important;opacity:0}
html.reduce-motion #rb-torso,html.reduce-motion #rb-head{transform:none!important;transition:none}

/* ===== round 4: grounding in a real room — tap the things in place ===== */
#s-ground .obj-grid{display:block;position:relative;width:min(100%,430px,calc((calc(var(--vhu,1dvh)*100) - 318px) * .75));max-width:none;aspect-ratio:3/4;margin:0 auto}
.room-photo{position:absolute;inset:0;border-radius:18px;overflow:hidden;box-shadow:0 10px 30px rgba(0,0,0,.4),0 0 0 1px rgba(246,215,154,.25);animation:roomin .7s ease both}
.room-photo.leaving{animation:roomout .6s ease both;pointer-events:none}
@keyframes roomin{from{opacity:0}to{opacity:1}}
@keyframes roomout{from{opacity:1}to{opacity:0}}
.room-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;user-select:none;-webkit-user-drag:none}
.hot{position:absolute;transform:translate(-50%,-50%);min-width:44px;min-height:44px;padding:0;border:0;background:transparent;border-radius:16px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.hot:focus-visible{outline:3px solid #f6d79a;outline-offset:2px}
.hot-dot{position:absolute;left:50%;top:50%;width:12px;height:12px;margin:-6px 0 0 -6px;border-radius:50%;background:radial-gradient(circle,#fffbe8 0%,rgba(255,226,150,.9) 35%,rgba(255,226,150,0) 72%);box-shadow:0 0 10px rgba(255,236,190,.9);animation:hotdot 2.6s ease-in-out infinite;pointer-events:none}
.hot:nth-of-type(3n) .hot-dot{animation-delay:.6s}.hot:nth-of-type(3n+1) .hot-dot{animation-delay:1.3s}
@keyframes hotdot{0%,100%{opacity:.55;transform:scale(.8)}50%{opacity:1;transform:scale(1.25)}}
.hot[data-done]{box-shadow:0 0 0 2.5px rgba(255,228,160,.95),0 0 26px 6px rgba(255,214,140,.55),inset 0 0 30px rgba(255,236,190,.35);background:rgba(255,240,200,.12)}
.hot[data-done] .hot-dot{display:none}
.hot-lab{position:absolute;left:50%;bottom:calc(100% + 6px);transform:translate(-50%,4px);white-space:nowrap;padding:4px 9px;border-radius:12px;background:rgba(20,16,40,.88);border:1px solid rgba(246,215,154,.6);color:#fff6e4;font-size:.78rem;font-weight:600;opacity:0;pointer-events:none;transition:opacity .35s ease,transform .35s ease;z-index:3}
.hot[data-done] .hot-lab{opacity:1;transform:translate(-50%,0)}
.hot[data-done][style*="top:8"] .hot-lab,.hot[data-done][style*="top:9"] .hot-lab{bottom:auto;top:calc(100% + 6px)}
html.reduce-motion .hot-dot{animation:none;opacity:.9}
html.reduce-motion .room-photo{animation:none}
html.reduce-motion .hot-lab{transition:none}
@media (max-height:700px){ #s-ground .obj-grid{width:min(100%,calc((calc(var(--vhu,1dvh)*100) - 262px) * .75))} .hot-lab{font-size:.7rem;padding:3px 7px} }
.hot.lab-in .hot-lab{bottom:auto;top:8px;transform:translate(-50%,-4px)}
.hot.lab-in[data-done] .hot-lab{transform:translate(-50%,0)}
.hot[data-obj="dog"].lab-in .hot-lab,.hot[data-obj="sneakers"].lab-in .hot-lab{top:auto;bottom:8px}
.room-photo.no-in{animation:none}
/* r4: nine topic chips (Family added) still fit at 320x568 */
@media (max-height:640px){
  #s-topic .eyebrow{display:none}
  #s-topic h2{margin:0 0 6px;font-size:1.12rem}
  #s-topic .card{padding-top:10px}
  #s-topic .topic-chips{gap:5px;margin:0 0 8px}
  #s-topic .topic-chip{min-height:38px;padding:4px 8px}
  #s-topic .topic-row{margin-top:4px}
  #s-topic h2{margin-bottom:4px}
}

/* ===== round 5 ===== */
/* O2 blue in, CO2 red out (airway glow, motes, alveoli, blood) */
html{--flow:#5aa9ff;--flow-c:#e8f4ff}
html[data-phase=out]{--flow:#ff5a4e;--flow-c:#ffe3df}
html[data-phase=in] .nose-glow{fill:#8cc4ff}
html[data-phase=out] .nose-glow{fill:#ff9a90}
html[data-phase=out] .uaw-o.mouthway{stroke:#ff8f84}
html[data-phase=out] .uaw-i.mouthway{stroke:#ffe1dc}
html[data-phase=in][data-air=alveoli] .alveolus{fill:#d2e7ff}
html[data-phase=out] .alveolus{fill:#ffd6cf}
html[data-phase=in][data-air=alveoli] .cap,#lungs-svg.o2-on .cap{stroke:#4f9dff}
html[data-phase=out] .cap{stroke:#ff5a4e;opacity:.9}
#lungs-svg.o2-on .vein{stroke:#5aa9ff;filter:drop-shadow(0 0 1.6px rgba(90,169,255,.9))}
#lungs-svg.o2-on .trunk{stroke:#5aa9ff;filter:drop-shadow(0 0 2px rgba(90,169,255,.9))}
.alv-glow{fill:#8cc4ff}
.gas-t{font:700 15px/1 system-ui,-apple-system,"Segoe UI",sans-serif;opacity:0;transition:opacity .6s ease,fill .6s ease;paint-order:stroke;stroke:#050c20;stroke-width:3px;stroke-linejoin:round}
html[data-phase=in] .gas-t{fill:#7dbcff;opacity:1}
html[data-phase=out] .gas-t{fill:#ff7b70;opacity:1}
.gas-legend{position:absolute;right:6px;top:4px;margin:0;display:flex;gap:8px;font-size:11px;font-weight:600;color:var(--cream);background:rgba(3,8,22,.72);border:1px solid rgba(212,166,74,.3);border-radius:999px;padding:4px 9px;line-height:1.2;pointer-events:none;z-index:3}
.gas-legend span{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.gas-legend i{width:9px;height:9px;border-radius:50%;display:inline-block}
.gl-o2 i{background:#5aa9ff;box-shadow:0 0 6px #5aa9ff}
.gl-co2 i{background:#ff5a4e;box-shadow:0 0 6px #ff5a4e}
/* lungs: a clearly visible expansion with the diaphragm moving down, synced to the 4 s in / 6 s out pacer */
html[data-phase=in] #chest{transform:translateY(-3px) scale(1.065,1.04)}
html[data-phase=in] #lungs-all{transform:scale(1.075,1.12)}
html[data-phase=in] #diaphragm{transform:translateY(24px)}
/* companion chip on every screen */
.cchip{display:flex;align-items:center;gap:10px;margin:0 0 10px;text-align:left;min-height:48px}
.cchip-ph{position:relative;flex:none;width:48px;height:48px;border-radius:50%;overflow:hidden;box-shadow:0 0 0 2px rgba(240,196,106,.6),0 4px 14px rgba(0,0,0,.4)}
.cphoto{position:relative}
.cphoto img{display:block;width:100%;height:100%;object-fit:cover}
.cphoto .cp-talk{position:absolute;inset:0;opacity:0;transition:opacity .06s linear}
html.mouth-open .cphoto .cp-talk{opacity:1}
html.reduce-motion .cphoto .cp-talk{display:none}
.cchip-say{margin:0;flex:1;min-width:0;font-size:.86rem;line-height:1.35;color:var(--cream);background:rgba(255,255,255,.06);border:1px solid rgba(212,166,74,.28);border-radius:14px 14px 14px 4px;padding:7px 10px;min-height:1.35em}
.cchip-say:empty{display:none}
.comp-photo.cphoto{width:112px;height:112px;margin:0 auto;border-radius:50%;overflow:hidden;box-shadow:0 0 0 3px rgba(240,196,106,.55),0 10px 30px rgba(0,0,0,.45)}
#win-comp .wc-photo.cphoto .cp-talk{border-radius:inherit}
#s-ground .cchip{width:min(100%,520px);margin:0 auto 6px}
#s-ground .cchip-ph{width:38px;height:38px}
#s-ground .cchip-say{font-size:.8rem;padding:5px 9px}
#s-rate .cchip,#s-rerate .cchip{margin-bottom:6px}
#s-rate .cchip-say,#s-rerate .cchip-say{font-size:.8rem;padding:5px 9px}
@media (max-height:700px){ #s-ground .obj-grid{width:min(100%,calc((calc(var(--vhu,1dvh)*100) - 306px) * .75))} }
.next-opt.is-said{border-color:rgba(240,196,106,.85);box-shadow:0 0 0 1px rgba(240,196,106,.45) inset,0 0 18px rgba(240,196,106,.18);transition:box-shadow .5s ease,border-color .5s ease}
/* share */
.share-wrap{margin:10px 0 8px;display:flex;flex-direction:column;align-items:center;gap:8px}
.share-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;max-width:340px}
.share-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.share-more{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
.share-more[hidden]{display:none}
.share-opt{min-height:44px;min-width:44px;padding:0 14px;border-radius:999px;border:1px solid rgba(212,166,74,.55);background:rgba(3,8,22,.5);color:var(--gold-bright);font:600 .86rem/1 inherit;display:inline-flex;align-items:center;justify-content:center;text-decoration:none;cursor:pointer}
.toast{position:fixed;left:50%;bottom:calc(60px + var(--safe-b,0px));transform:translate(-50%,12px);z-index:120;background:rgba(20,16,40,.95);color:#fff6e4;border:1px solid rgba(246,215,154,.6);border-radius:999px;padding:10px 18px;font-size:.9rem;font-weight:600;opacity:0;pointer-events:none;transition:opacity .3s ease,transform .3s ease}
.toast.on{opacity:1;transform:translate(-50%,0)}
html.reduce-motion .toast{transition:none}
#s-ground .obj-grid{width:min(100%,430px,calc((calc(var(--vhu,1dvh)*100) - 362px) * .75))}
/* round 5: the brain sits inside the skull (seen as if through it), not on top of the hair */
.wm-brain{left:26%;top:5%;width:48%;height:33%;-webkit-mask-image:radial-gradient(closest-side ellipse at 50% 52%,#000 58%,transparent 100%);mask-image:radial-gradient(closest-side ellipse at 50% 52%,#000 58%,transparent 100%)}
html[data-companion=m] .wm-brain{left:23.5%;top:4%;width:53%;height:36%}
.wm-brain .b-warm{opacity:calc(.68 - var(--calm) * .68)}
.wm-brain .b-cool{opacity:calc(var(--calm) * .68)}
.comp-photo.cphoto img{width:100%;height:100%;object-fit:cover;object-position:50% 40%;max-width:none;transform:none}
/* small phones: give the room more height */
@media (max-height:620px){
  #s-ground > .eyebrow{display:none}
  #s-ground > h2{font-size:1.05rem;margin-bottom:2px}
  #s-ground .obj-grid{width:min(100%,430px,calc((calc(var(--vhu,1dvh)*100) - 272px) * .75))}
  #s-ground .g-prompt{font-size:.82rem;margin:2px 0}
}
.gas-legend{right:auto;left:4px;top:2px;flex-direction:column;gap:3px;border-radius:12px;padding:5px 8px}
/* labels show briefly after a tap, so neighbouring labels never pile up on small screens (the echo line keeps the names) */
.hot[data-done] .hot-lab{animation:hotlab 2.6s ease forwards}
@keyframes hotlab{0%{opacity:0}12%{opacity:1}72%{opacity:1}100%{opacity:0}}
.wc-photo .cp-talk{transform:scale(1.22);transform-origin:50% 42%;object-position:50% 40%}
.toast{top:calc(118px + env(safe-area-inset-top,0px));bottom:auto}
@media (max-height:620px){
  .win-meta{display:none}
  .share-wrap{margin:6px 0 6px;gap:6px}
  .share-btn{min-height:42px;font-size:.88rem;padding:6px 12px}
  .share-opt{min-height:42px}
}

/* ===== tap fix (Jamie 4:52 PM): bigger hit areas, a visible ring, clear feedback, and big named buttons ===== */
.hot{min-width:48px;min-height:48px;touch-action:manipulation;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none}
.hot::before{content:"";position:absolute;inset:-6px;border-radius:20px}
.hot.is-quiet{z-index:1}
.hot.is-lit{z-index:2}
.hot.is-quiet::before{inset:0}
.hot-ring{position:absolute;left:50%;top:50%;width:38px;height:38px;margin:-19px 0 0 -19px;border-radius:50%;border:2.5px solid rgba(255,236,190,.95);box-shadow:0 0 0 1.5px rgba(20,16,40,.45),0 0 12px rgba(255,226,150,.7);pointer-events:none;animation:hotring 2.8s ease-in-out infinite}
.hot.is-lit:nth-of-type(3n) .hot-ring{animation-delay:.7s}.hot.is-lit:nth-of-type(3n+1) .hot-ring{animation-delay:1.4s}
@keyframes hotring{0%,100%{transform:scale(.88);opacity:.7}50%{transform:scale(1.08);opacity:1}}
.hot-dot{width:10px;height:10px;margin:-5px 0 0 -5px}
.hot.is-press{background:rgba(255,240,200,.18)}
.hot.is-press .hot-ring{transform:scale(.8);opacity:1}
.hot[data-done] .hot-ring{display:none}
.hot-tick{display:none;position:absolute;left:50%;top:50%;width:28px;height:28px;margin:-14px 0 0 -14px;border-radius:50%;background:#f6d79a;box-shadow:0 2px 8px rgba(0,0,0,.4);pointer-events:none}
.hot-tick::after{content:"";position:absolute;left:10px;top:6px;width:6px;height:12px;border:solid #2a1f2e;border-width:0 3px 3px 0;transform:rotate(45deg)}
.hot[data-done] .hot-tick{display:block}
.hot.pop .hot-tick{animation:hotpop .45s ease-out}
@keyframes hotpop{0%{transform:scale(.4)}70%{transform:scale(1.15)}100%{transform:scale(1)}}
html.reduce-motion .hot-ring{animation:none;opacity:.95}
html.reduce-motion .hot.pop .hot-tick,html.reduce-motion .obj-btn.pop{animation:none}
.obj-btns{display:flex;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;width:min(100%,520px);margin:8px auto 0;padding:2px 2px 6px;scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent);mask-image:linear-gradient(90deg,#000 88%,transparent)}
.obj-btns::-webkit-scrollbar{display:none}
.obj-btn{flex:none;scroll-snap-align:start;display:inline-flex;align-items:center;gap:8px;min-height:52px;padding:5px 12px 5px 5px;border-radius:14px;border:1px solid rgba(246,215,154,.5);background:rgba(20,16,40,.72);color:#fff6e4;font:600 .86rem/1.1 inherit;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background .2s ease,border-color .2s ease}
.obj-btn .ob-th{width:40px;height:40px;border-radius:10px;flex:none;background-repeat:no-repeat;box-shadow:0 0 0 1px rgba(246,215,154,.35)}
.obj-btn .ob-ok{display:none;width:18px;height:18px;border-radius:50%;background:#f6d79a;position:relative;flex:none}
.obj-btn .ob-ok::after{content:"";position:absolute;left:6px;top:3px;width:4px;height:8px;border:solid #2a1f2e;border-width:0 2px 2px 0;transform:rotate(45deg)}
.obj-btn.is-press{background:rgba(246,215,154,.22)}
.obj-btn[data-done]{background:rgba(246,215,154,.2);border-color:#f6d79a}
.obj-btn[data-done] .ob-ok{display:block}
.obj-btn.pop{animation:hotpop .4s ease-out}
.obj-btn:focus-visible{outline:3px solid #f6d79a;outline-offset:2px}
.obj-btns.nudge{animation:nudge .6s ease}
@keyframes nudge{0%,100%{transform:none}30%{transform:translateY(-3px)}60%{transform:translateY(1px)}}
html.reduce-motion .obj-btns.nudge{animation:none}
#s-ground .tap-echo{min-height:1.2em;margin:4px 0 0}
/* make room for the button row */
#s-ground .obj-grid{width:min(100%,430px,calc((calc(var(--vhu,1dvh)*100) - 410px) * .75))}
@media (max-height:620px){ #s-ground .obj-grid{width:min(100%,430px,calc((calc(var(--vhu,1dvh)*100) - 318px) * .75))} #s-ground .cchip{margin-bottom:2px} }

.room-photo{touch-action:manipulation;-webkit-tap-highlight-color:transparent;cursor:pointer}
.room-photo .hot{pointer-events:none}
.tap-ripple{position:absolute;width:44px;height:44px;margin:-22px 0 0 -22px;border-radius:50%;border:2px solid rgba(255,240,200,.9);pointer-events:none;z-index:4;animation:ripple .55s ease-out forwards}
@keyframes ripple{from{transform:scale(.4);opacity:.9}to{transform:scale(1.3);opacity:0}}
/* tap fix, root cause: on short phone screens the flex column squeezed the room box below 3:4 while the photo kept
   object-fit:cover, so the picture was cropped top and bottom but hotspots stayed at box percentages. Objects near the
   bottom (the dog) ended up 20-30px away from their tap areas. The room now never shrinks and always stays 3:4,
   and it is bigger on phones; the screen scrolls a little on very short screens instead. */
#s-ground .room-wrap{flex:none}
#s-ground .obj-grid{flex:none;height:auto;aspect-ratio:3/4;width:min(100%,430px,max(256px,calc((calc(var(--vhu,1dvh)*100) - 350px) * .75)))}
@media (max-height:700px){
  #s-ground > h2{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);margin:0}
  #s-ground .g-prompt{font-size:.84rem;margin:2px 0 0}
  #s-ground .g-count{margin:0 0 4px}
  #s-ground .obj-grid{width:min(100%,430px,max(256px,calc((calc(var(--vhu,1dvh)*100) - 318px) * .75)))}
}
.room-photo .room-img{object-fit:fill}
@media (max-height:700px){
  body:has(#s-ground:not([hidden])) #demo-note{display:none}
  #s-ground{padding-bottom:calc(10px + var(--safe-b))}
}
/* the "0 of 5" count sits as a badge on the photo, saving a line on small phones */
#s-ground .room-wrap{position:relative}
#s-ground .room-wrap > .g-count{position:absolute;top:8px;left:50%;transform:translateX(-50%);margin:0;z-index:5;padding:3px 11px;border-radius:999px;background:rgba(20,16,40,.82);border:1px solid rgba(246,215,154,.55);font-size:.8rem;line-height:1.3;pointer-events:none}
@media (max-height:700px){
  .obj-btn{min-height:48px;padding:4px 11px 4px 4px}
  .obj-btn .ob-th{width:38px;height:38px}
  .obj-btns{margin-top:6px}
  #s-ground .cchip{margin-bottom:4px}
}
@media (max-height:600px){ #s-ground .obj-grid{width:min(100%,430px,max(240px,calc((calc(var(--vhu,1dvh)*100) - 318px) * .75)))} }
@media (min-height:701px){ #s-ground .obj-grid{width:min(100%,430px,max(256px,calc((calc(var(--vhu,1dvh)*100) - 380px) * .75)))} }
@media (max-height:560px){ #s-ground .obj-grid{width:min(100%,430px,228px)} #s-ground .g-prompt{font-size:.8rem} }
#s-ground .obj-btns{flex:none}
/* polish: the worry-meter label sits beside the tube, not under the companion's chin */
.meter-wrap{grid-template-areas:"g lab" "g num" "g val";align-content:center}
.meter-wrap .meter-label{justify-self:start;margin:0;align-self:end}
#s-ground .room-wrap > .g-count{top:-11px;font-size:.76rem;padding:2px 10px}
#s-ground .room-wrap{margin-top:12px}

.tap-hint{position:absolute;left:50%;top:16px;transform:translateX(-50%);z-index:6;display:flex;align-items:center;gap:8px;max-width:88%;padding:7px 12px;border-radius:999px;background:rgba(20,16,40,.9);border:1px solid rgba(246,215,154,.7);color:#fff6e4;font-size:.8rem;font-weight:600;line-height:1.25;pointer-events:none;box-shadow:0 6px 18px rgba(0,0,0,.4);animation:hintin .5s ease .5s both}
.tap-hint .th-ring{flex:none;width:18px;height:18px;border-radius:50%;border:2px solid rgba(255,236,190,.95);box-shadow:0 0 8px rgba(255,226,150,.8)}
.tap-hint.out{opacity:0;transition:opacity .4s ease}
@keyframes hintin{from{opacity:0;transform:translate(-50%,6px)}to{opacity:1;transform:translate(-50%,0)}}
html.reduce-motion .tap-hint{animation:none}
/* short phones: no stray scroll on the welcome and senses screens */
@media (max-height:600px){
  #s-welcome .welcome-card{padding-top:14px;padding-bottom:12px}
  #s-welcome .welcome-face,#s-welcome .comp-photo.cphoto{width:92px;height:92px}
  #s-welcome .eyebrow{margin-bottom:2px}
  #s-ground .obj-grid{width:min(100%,430px,max(230px,calc((calc(var(--vhu,1dvh)*100) - 340px) * .75)))}
  #s-ground .tap-echo{min-height:0;font-size:.8rem}
  #s-ground .room-wrap{margin-top:10px}
}
@media (max-height:520px){ #s-ground .obj-grid{width:min(100%,430px,200px)} #s-welcome .welcome-face,#s-welcome .comp-photo.cphoto{width:76px;height:76px} }
@media (max-height:600px){ #s-welcome{padding-bottom:calc(46px + var(--safe-b))} }

/* r6 visemes + blink */
.cphoto .cp-m,.cphoto .cp-blink{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .05s linear;pointer-events:none}
.comp-photo.cphoto .cp-m,.comp-photo.cphoto .cp-blink{object-position:50% 40%}
html[data-mouth=half] .cphoto .cp-half,html[data-mouth=ah] .cphoto .cp-talk,html[data-mouth=ee] .cphoto .cp-ee{opacity:1}
html.mouth-open .cphoto .cp-talk{opacity:0}
html[data-mouth=ah].mouth-open .cphoto .cp-talk{opacity:1}
html.blink:not([data-mouth]) .cphoto .cp-blink{opacity:1;transition:none}
html.reduce-motion .cphoto .cp-m,html.reduce-motion .cphoto .cp-blink{display:none}

/* r6 transitions: soft crossfade between screens */
.screen.soft-out{animation:softout .75s ease both;pointer-events:none;z-index:1}
@keyframes softout{from{opacity:1;transform:none}to{opacity:0;transform:translateY(-6px)}}
.screen:not([hidden]):not(.soft-out):not(.is-leave){z-index:2}
@keyframes fade{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
html.reduce-motion .screen.soft-out{animation:none;opacity:0}
.tap-hint{width:max-content;max-width:86%;white-space:normal;text-align:left}
@media (max-height:560px){ #s-ground .obj-grid{width:min(100%,430px,218px)} }
@media (max-height:520px){ #s-ground .obj-grid{width:min(100%,430px,200px)} }
.tap-hint.out{animation:hintout .4s ease forwards}
@keyframes hintout{from{opacity:1}to{opacity:0}}
html[data-mouth=oo] .cphoto .cp-oo{opacity:1}

/* r7: spoken welcome on the first page */
.welcome-play{display:inline-flex;align-items:center;gap:10px;margin:6px auto 10px;padding:10px 16px;min-height:48px;border-radius:999px;border:1px solid rgba(255,214,140,.55);background:rgba(255,214,140,.10);color:#ffe2a8;font:inherit;font-size:15px;cursor:pointer}
.welcome-play .wp-ic{width:22px;height:22px;border-radius:50%;background:#ffd68c;position:relative;flex:none}
.welcome-play .wp-ic::after{content:"";position:absolute;left:8px;top:6px;border-left:8px solid #2a1838;border-top:5px solid transparent;border-bottom:5px solid transparent}
.welcome-play.is-playing .wp-ic::after{left:7px;top:7px;width:8px;height:8px;border:0;background:linear-gradient(90deg,#2a1838 0 3px,transparent 3px 5px,#2a1838 5px)}
.btn.is-cued{box-shadow:0 0 0 3px rgba(255,214,140,.55),0 0 22px rgba(255,200,120,.45)}
@media (prefers-reduced-motion:no-preference){.welcome-play:not(.is-playing){animation:wpglow 3.2s ease-in-out infinite}.btn.is-cued{animation:cuedglow 2.8s ease-in-out infinite}}
@keyframes wpglow{0%,100%{box-shadow:0 0 0 0 rgba(255,214,140,0)}50%{box-shadow:0 0 0 6px rgba(255,214,140,.16)}}
@keyframes cuedglow{0%,100%{box-shadow:0 0 0 3px rgba(255,214,140,.35)}50%{box-shadow:0 0 0 5px rgba(255,214,140,.6),0 0 26px rgba(255,200,120,.5)}}
/* r7: hear, one sound at a time with its object lit */
.room-photo .hot.is-sounding{z-index:6}
.room-photo .hot.is-sounding::after{content:"";position:absolute;inset:-6px;border-radius:14px;border:3px solid #9fd0ff;box-shadow:0 0 18px rgba(140,200,255,.85),inset 0 0 12px rgba(140,200,255,.45)}
.room-photo .hot.is-sounding .hot-lab{opacity:1}
.obj-btn.is-sounding{border-color:#9fd0ff!important;box-shadow:0 0 0 2px #9fd0ff,0 0 16px rgba(140,200,255,.7)}
@media (prefers-reduced-motion:no-preference){.room-photo .hot.is-sounding::after{animation:sndpulse 1.3s ease-in-out infinite}}
@keyframes sndpulse{0%,100%{transform:scale(1);opacity:.9}50%{transform:scale(1.06);opacity:1}}
/* r7: smell, soft scent wisps rising from each smell object */
.room-photo .hot .aroma{position:absolute;left:50%;bottom:55%;width:30px;height:60px;margin-left:-15px;pointer-events:none;z-index:4}
.room-photo .hot .aroma i{position:absolute;bottom:0;left:9px;width:12px;height:34px;border-radius:50%;background:radial-gradient(ellipse at 50% 60%,rgba(255,240,220,.75),rgba(255,226,190,.25) 55%,transparent 72%);filter:blur(2px);opacity:.55}
.room-photo .hot .aroma i:nth-child(2){left:2px}.room-photo .hot .aroma i:nth-child(3){left:16px}
@media (prefers-reduced-motion:no-preference){
.room-photo .hot .aroma i{opacity:0;animation:aroma 3.6s ease-in-out infinite}
.room-photo .hot .aroma i:nth-child(2){animation-delay:1.2s}.room-photo .hot .aroma i:nth-child(3){animation-delay:2.4s}}
@keyframes aroma{0%{transform:translate(0,6px) scale(.6,.7);opacity:0}25%{opacity:.7}60%{transform:translate(-5px,-26px) scale(1,1.15);opacity:.45}100%{transform:translate(4px,-52px) scale(1.25,1.3);opacity:0}}

/* r7 (Jamie 7:43 PM): the companion visibly breathes. In: nostrils widen a touch, chest and shoulders rise (above).
   Out: eyes soften closed and the lips part a little as the air leaves, with a faint warm breath plume. */
#real-exhale{opacity:0;transition:opacity .9s ease}
html[data-phase=out] #real-exhale{opacity:1;transition:opacity 1.1s ease .25s}
html[data-phase=in] #real-exhale{opacity:0;transition-duration:.8s}
#nose-flare{opacity:0}
#nose-flare .nf-img{transform-box:view-box;transform-origin:200px 76px;transition:transform 3.6s cubic-bezier(.42,0,.38,1)}
html[data-phase=in] #nose-flare{opacity:1}
html[data-phase=in] #nose-flare .nf-img{transform:scale(1.07,1.02)}
html.reduce-motion #nose-flare{display:none}

/* r7 (Jamie 7:43 PM): the breath guide is a pair of lungs that fill and empty with the pacer; blue O2 in, red CO2 out */
.lung-guide .lg-lungs{transform-box:view-box;transform-origin:60px 70px;transform:scale(.86,.84);transition:transform 6s cubic-bezier(.42,0,.38,1)}
html[data-phase=in] .lung-guide .lg-lungs{transform:scale(1.08,1.1);transition-duration:4s}
html[data-phase=out] .lung-guide .lg-lungs{transform:scale(.86,.84);transition-duration:6s}
.lung-guide .lg-lobe{fill:url(#lg-fill);stroke:#ffd6dc;stroke-opacity:.55;stroke-width:1.2;transition:filter 4s}
html[data-phase=in] .lung-guide .lg-lobe{filter:drop-shadow(0 0 6px rgba(120,190,255,.55))}
html[data-phase=out] .lung-guide .lg-lobe{filter:drop-shadow(0 0 5px rgba(255,120,110,.4))}
.lung-guide .lg-tree{fill:none;stroke:#fbe3e6;stroke-opacity:.75;stroke-width:1.3;stroke-linecap:round}
.lung-guide .lg-airway{fill:none;stroke:#cfe6f5;stroke-width:5.5;stroke-linecap:round;opacity:.9}
.lung-guide .lg-rings{stroke:#8fb3c9;stroke-width:1.1;opacity:.8}
.lung-guide .lg-tag{font:600 10px/1 system-ui,sans-serif;opacity:0;transition:opacity .6s}
.lung-guide .lg-in{fill:#8fc8ff}.lung-guide .lg-out{fill:#ff8f84}
html[data-phase=in] .lung-guide .lg-in,html[data-phase=out] .lung-guide .lg-out{opacity:1}
.lung-guide .o2{fill:url(#lg-o2)}.lung-guide .co2{fill:url(#lg-co2)}
.lung-guide .o2,.lung-guide .co2{opacity:0;transform-box:fill-box;transform-origin:center}
@media (prefers-reduced-motion:no-preference){
html[data-phase=in] .lung-guide .o2{animation:lgmove 2.2s ease-in var(--d) 2 both}
html[data-phase=out] .lung-guide .co2{animation:lgout 2.6s ease-out var(--d) 2 both}}
html.reduce-motion[data-phase=in] .lung-guide .o2,html.reduce-motion[data-phase=out] .lung-guide .co2{opacity:.8}
@keyframes lgmove{0%{opacity:0;transform:translate(0,0)}12%{opacity:1}45%{transform:translate(0,36px)}85%{opacity:.9}100%{opacity:0;transform:translate(var(--dx),var(--dy))}}
@keyframes lgout{0%{opacity:0;transform:translate(0,0)}12%{opacity:1}50%{transform:translate(var(--mx),var(--my))}85%{opacity:.8}100%{opacity:0;transform:translate(var(--dx),var(--dy))}}
html.reduce-motion .lung-guide .lg-lungs{transition:none;transform:none}
/* r7 (Jamie 7:43 PM): a brain that reads as a brain: real gyri, sulci and lobes, shown plainly (no wash-out blend), with the neural signals on top */
.wm-brain{mix-blend-mode:normal}
.wm-brain .b-warm{filter:saturate(1.15) brightness(1.05) drop-shadow(0 0 5px rgba(255,120,80,.55));opacity:calc(.92 - var(--calm) * .92)}
.wm-brain .b-cool{filter:hue-rotate(150deg) saturate(.8) brightness(1.1) drop-shadow(0 0 6px rgba(80,220,235,.6));opacity:calc(var(--calm) * .92)}
.wm-brain{left:21%;top:0;width:58%;height:40%;-webkit-mask-image:radial-gradient(closest-side ellipse at 50% 50%,#000 72%,transparent 100%);mask-image:radial-gradient(closest-side ellipse at 50% 50%,#000 72%,transparent 100%)}
html[data-companion=m] .wm-brain{left:19%;top:0;width:62%;height:42%}
.room-photo .hot .aroma{width:44px;height:80px;margin-left:-22px;bottom:50%}
.room-photo .hot .aroma i{left:13px;width:18px;height:46px;background:radial-gradient(ellipse at 50% 60%,rgba(255,255,255,.95),rgba(255,214,236,.65) 45%,rgba(214,170,255,.25) 65%,transparent 75%);filter:blur(1.5px) drop-shadow(0 0 4px rgba(190,120,220,.55))}
.room-photo .hot .aroma i:nth-child(2){left:3px}.room-photo .hot .aroma i:nth-child(3){left:23px}
@keyframes aroma{0%{transform:translate(0,8px) scale(.6,.7);opacity:0}25%{opacity:.95}60%{transform:translate(-6px,-30px) scale(1,1.15) rotate(-6deg);opacity:.7}100%{transform:translate(5px,-62px) scale(1.3,1.35) rotate(5deg);opacity:0}}
/* r7: the welcome button must not push Begin below the fold on short phones */
@media (max-height:700px){
  #s-intro .sound-note{display:none}
  #s-intro .welcome-play{margin:2px auto 6px;padding:8px 14px;min-height:44px;font-size:14px}
  #s-intro .lead{font-size:.9rem;line-height:1.38;margin:4px 0 6px}
  #s-intro h1{margin:4px 0 0}
  #s-intro .ages{margin:4px 0}
  #s-intro .disc{margin:4px 0 8px;font-size:.72rem}
}
@media (max-height:600px){
  #s-intro .lead{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  #s-intro .cchip{margin-bottom:4px}
}

/* r7b: a large, obvious welcome gate over the first card until the first click, tap or key */
#s-intro .card.has-gate{position:relative}
.welcome-gate{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;border-radius:inherit;background:rgba(8,10,28,.72);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);transition:opacity .35s ease}
.welcome-gate.out{opacity:0;pointer-events:none}
.wg-btn{display:flex;flex-direction:column;align-items:center;gap:10px;max-width:86%;padding:26px 22px;border-radius:22px;border:2px solid #ffd68c;background:linear-gradient(180deg,rgba(255,214,140,.22),rgba(255,214,140,.08));color:#fff3da;font:inherit;cursor:pointer;box-shadow:0 0 0 0 rgba(255,214,140,.4)}
.wg-ic{width:64px;height:64px;border-radius:50%;background:#ffd68c;position:relative}
.wg-ic::after{content:"";position:absolute;left:25px;top:18px;border-left:22px solid #2a1838;border-top:14px solid transparent;border-bottom:14px solid transparent}
.wg-t{font-size:1.25rem;font-weight:600;line-height:1.25;text-align:center}
.wg-s{font-size:.9rem;opacity:.85;text-align:center}
.wg-btn:focus-visible{outline:3px solid #fff;outline-offset:3px}
@media (prefers-reduced-motion:no-preference){.wg-btn{animation:wpglow 2.6s ease-in-out infinite}}
.welcome-play{font-size:16px;padding:12px 20px;min-height:52px}

/* r7c: while the companion finishes a line before moving on, buttons stay calm (no double advance) */
html.is-settling .screen:not([hidden]) .btn{pointer-events:none}
html.is-settling .screen:not([hidden]) .btn:not([disabled]){opacity:.85;transition:opacity .4s}

/* r7d: on the win page, how to check in before re-rating */
.win-check{margin:10px auto 12px;padding:12px 14px;max-width:360px;border-radius:16px;border:1px solid rgba(255,214,140,.35);background:rgba(20,14,40,.45);text-align:left;opacity:.9;transition:border-color .8s,box-shadow .8s,opacity .8s}
.win-check.lit{opacity:1;border-color:rgba(255,214,140,.8);box-shadow:0 0 18px rgba(255,200,120,.25)}
.wck-h{margin:0 0 6px;font-size:.78rem;letter-spacing:.12em;text-transform:uppercase;color:#ffd68c}
.wck-steps{margin:0;padding-left:1.2em;color:#fff3da;font-size:.92rem;line-height:1.4}
.wck-steps li{margin:2px 0}
@media (max-height:700px){.win-check{margin:6px auto 8px;padding:9px 12px}.wck-steps{font-size:.84rem}}
@media (max-height:780px){
  .win-check{margin:4px auto 6px;padding:7px 11px}
  .wck-h{display:none}
  .wck-steps{font-size:.8rem;line-height:1.3}
  .wck-steps li{margin:1px 0}
}

/* r7e: after the re-rating, "Try again now" is the main action when it didn't come down */
.btn.try-again{display:block;width:100%;max-width:340px;margin:10px auto 8px;font-size:1.08rem;min-height:52px}
#s-rerate[data-dir=same] #end-go,#s-rerate[data-dir=up] #end-go{margin-top:4px}
#s-rerate .rr-val{display:block;margin-bottom:4px}

/* r7f: companion photo on the rating page */
.rerate-face .rr-ph{display:block;width:100%;aspect-ratio:1;object-fit:cover;object-position:50% 30%;border-radius:50%;border:2px solid rgba(255,214,140,.55);box-shadow:0 4px 16px rgba(0,0,0,.35)}

/* r9 calm face (Jamie 9:47 PM): no mouth flapping. Mouth frames hidden; a slow breath + drift on the photo, a soft
   glow while the voice is actually playing, slow blinks. The ring/glow sits on the round frame, the motion on the photo. */
html.calm-face .cphoto .cp-m{display:none!important}
html.calm-face .cphoto .cp-base,html.calm-face .cphoto .cp-blink{
  scale:1.05;transform-origin:50% 62%;
  animation:cf-breathe 5.6s ease-in-out infinite,cf-drift 11s ease-in-out infinite;will-change:transform}
html.calm-face .comp-photo.cphoto .cp-base{object-position:50% 40%}
@keyframes cf-breathe{0%,100%{scale:1.05}45%{scale:1.066}}
@keyframes cf-drift{0%,100%{translate:0 0;rotate:0deg}30%{translate:.6% -.4%;rotate:.5deg}65%{translate:-.5% .3%;rotate:-.4deg}}
/* while speaking: a slightly livelier, gentle nod layered on the same drift */
html.calm-face.is-voicing .cphoto .cp-base,html.calm-face.is-voicing .cphoto .cp-blink{
  animation:cf-breathe 5.6s ease-in-out infinite,cf-talknod 3.4s ease-in-out infinite}
@keyframes cf-talknod{0%,100%{translate:0 0;rotate:0deg}22%{translate:.3% .7%;rotate:.6deg}50%{translate:-.2% -.2%;rotate:-.2deg}78%{translate:-.4% .5%;rotate:-.6deg}}
/* blink: a soft ~0.2s close using the clean closed-eye frame of the same photo */
html.calm-face .cphoto .cp-blink{opacity:0;transition:opacity .12s ease-in}
html.calm-face.blink .cphoto .cp-blink{opacity:1;transition:opacity .07s ease-out}
/* speaking glow: fades in when the voice plays, out when it stops; a very slow, low-contrast swell (no flashing) */
html.calm-face .cphoto{transition:box-shadow .7s ease}
html.calm-face.is-voicing .cchip-ph{box-shadow:0 0 0 2px rgba(255,214,140,.95),0 0 12px 3px rgba(255,208,128,.45),0 4px 14px rgba(0,0,0,.4);animation:cf-glow 3.2s ease-in-out infinite}
html.calm-face.is-voicing .comp-photo.cphoto{box-shadow:0 0 0 3px rgba(255,214,140,.95),0 0 26px 6px rgba(255,208,128,.42),0 10px 30px rgba(0,0,0,.45);animation:cf-glow-lg 3.2s ease-in-out infinite}
@keyframes cf-glow{0%,100%{box-shadow:0 0 0 2px rgba(255,214,140,.9),0 0 10px 2px rgba(255,208,128,.36),0 4px 14px rgba(0,0,0,.4)}50%{box-shadow:0 0 0 2px rgba(255,220,150,1),0 0 16px 4px rgba(255,208,128,.5),0 4px 14px rgba(0,0,0,.4)}}
@keyframes cf-glow-lg{0%,100%{box-shadow:0 0 0 3px rgba(255,214,140,.9),0 0 20px 4px rgba(255,208,128,.34),0 10px 30px rgba(0,0,0,.45)}50%{box-shadow:0 0 0 3px rgba(255,220,150,1),0 0 30px 8px rgba(255,208,128,.48),0 10px 30px rgba(0,0,0,.45)}}
html.reduce-motion.calm-face .cphoto img,html.reduce-motion.calm-face .cphoto{animation:none!important}
@media (prefers-reduced-motion: reduce){html.calm-face .cphoto img,html.calm-face .cphoto{animation:none!important}}

/* r9 Finish page: one small step before you go */
#s-end .end-sub{margin:4px auto 10px;color:var(--cream-dim);font-size:.95rem;max-width:34ch}
.end-opts{list-style:none;margin:12px 0 6px;padding:0;display:flex;flex-direction:column;gap:10px;text-align:left}
.end-opt{display:flex;gap:10px;align-items:flex-start;padding:12px 12px 12px 10px;border-radius:16px;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.04)}
.end-opt .eo-n{flex:none;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font-weight:700;font-size:.85rem;color:#1a1408;background:rgba(240,196,106,.75);margin-top:2px}
.end-opt .eo-b{flex:1;min-width:0;display:flex;flex-direction:column;gap:8px}
.end-opt .eo-h{display:block;font-weight:600;font-size:1rem;color:var(--cream);margin:0}
.end-opt .eo-why{margin:0;font-size:.85rem;color:var(--cream-dim)}
.end-opt .btn{width:100%;min-height:48px;margin:0}
.end-opt .mail-card{margin:0}
.end-opt .tip-jar{margin:0;padding:0;border:0;background:none;text-align:left}
.end-opt .tip-h{font-size:1rem}
.end-opt.is-primary{border-color:rgba(255,214,140,.65);background:linear-gradient(180deg,rgba(255,214,140,.14),rgba(255,214,140,.05));box-shadow:0 0 0 1px rgba(255,214,140,.25),0 8px 24px rgba(0,0,0,.25)}
.end-opt.is-primary .eo-n{background:#ffd68c}
/* staggered, soft entrance */
#s-end.opts-in .end-opt{animation:eo-in .7s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--i) * 140ms + 450ms)}
@keyframes eo-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
/* after the narration: a slow, low-contrast swell on the primary choice (no flashing) */
#s-end.opts-ready .end-opt.is-primary{animation:eo-pulse 2.8s ease-in-out 3}
@keyframes eo-pulse{0%,100%{box-shadow:0 0 0 1px rgba(255,214,140,.25),0 8px 24px rgba(0,0,0,.25)}50%{box-shadow:0 0 0 2px rgba(255,214,140,.6),0 0 22px 4px rgba(255,208,128,.28),0 8px 24px rgba(0,0,0,.25)}}
/* one gentle reminder */
#s-end.nudged .end-opt.is-primary{animation:eo-pulse 2.8s ease-in-out 2}
#s-end.nudged .cchip-say{border-color:rgba(255,214,140,.55)}
/* the slower, warmer lead-in from the rating result */
.screen.is-leave.to-end{animation:leavesoft 1.15s ease-in-out both}
.screen.is-enter.from-rerate{animation:fade 1.2s ease-in-out .15s both}
html.reduce-motion #s-end .end-opt{animation:none!important;opacity:1!important}
@media (prefers-reduced-motion: reduce){#s-end .end-opt{animation:none!important;opacity:1!important}}
@media (max-width:360px){.end-opt{padding:10px 10px 10px 8px;gap:8px}.end-opt .eo-n{width:24px;height:24px}}
.end-opt .mail-msg:empty{display:none}
.end-opt .mail-card{gap:8px}
#s-end .end-sub{text-align:center}

/* r10: Finish glows while "press Finish" is spoken; the matching caption line lights with it */
.btn.is-saying{box-shadow:0 0 0 3px rgba(255,222,150,.95),0 0 30px 6px rgba(255,205,125,.6)!important;transform:scale(1.02);transition:box-shadow .35s ease,transform .35s ease}
.btn#end-go{transition:box-shadow .6s ease,transform .6s ease}
#kind-note .rr-fin{display:block;margin-top:6px;color:var(--cream);transition:color .4s ease}
#kind-note .rr-fin.lit b{color:#ffd68c}
html.reduce-motion .btn.is-saying{transform:none}

/* r11 (Jamie 10:20 PM, "the 988 text covers my face in some sections"): the 988 line is no longer a floating chip over the
   page. Layout is three reserved bands: a slim top strip for the mute/back icons, the screen area, and a footer strip with
   the small 988 line + Help and the preview note. Screens live only in the middle band, so nothing can sit under either strip. */
:root{--hud-h:10px;--top-h:calc(60px + var(--safe-t));--foot-h:calc(62px + var(--safe-b))}
.hud-top{position:fixed;top:0;left:0;right:0;height:var(--top-h);padding:calc(8px + var(--safe-t)) 10px 0;gap:0;z-index:40}
#ui{position:fixed;top:var(--top-h);bottom:var(--foot-h);left:0;right:0;inset:auto 0 auto 0;top:var(--top-h);bottom:var(--foot-h)}
#ui > .screen{padding-top:10px;padding-bottom:14px;-webkit-mask-image:none;mask-image:none}
#ui > #s-win{padding-bottom:10px}
.hud-foot{position:fixed;left:0;right:0;bottom:0;z-index:40;display:flex;flex-direction:column;align-items:center;gap:3px;padding:5px 10px calc(6px + var(--safe-b));background:rgba(3,8,22,.88);border-top:1px solid rgba(212,166,74,.22)}
.hud-foot .help988{height:auto;min-height:0;max-height:none;background:none;border:0;border-radius:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;padding:0;font-size:13px;line-height:1.2;flex-wrap:wrap;gap:0 2px}
.hud-foot .help988 a,.hud-foot .help988 button{min-height:32px;min-width:0;padding:0 5px;font-size:13px}
.hud-foot .help988 .us{padding:0 2px 0 0}
.hud-foot .demo-note{position:static;inset:auto;margin:0;max-width:none;width:auto;padding:0;border:0;background:none;box-shadow:none;font-size:11px;line-height:1.2;color:var(--gold);opacity:.85}
body:has(#s-ground:not([hidden])) .hud-foot #demo-note{display:block}
@media (max-width:360px){.hud-foot .help988,.hud-foot .help988 a,.hud-foot .help988 button{font-size:12px}.hud-foot .help988 a,.hud-foot .help988 button{padding:0 3px}}
/* r11: the sunrise page never clips the companion at the top: content is bottom-aligned only while it fits, otherwise it scrolls */
#ui > #s-win{justify-content:safe flex-end;overflow-y:auto}
@supports not (justify-content:safe flex-end){#ui > #s-win{justify-content:flex-start}#ui > #s-win > .win-comp{margin-top:auto}}
@media (max-height:900px){#s-win .win-comp .wc-photo{width:min(112px,calc(var(--vwu,1vw)*30))}#s-win .win-card .win-title{margin:2px 0}}
@media (max-height:760px){#s-win .win-comp .wc-photo{width:84px}}
/* j8 (Nov 22, Jamie "ok fix that part only"): on phones the growing check-in caption pushed "How is it now?" below the
   visible area, under the fixed 988 footer. The button now sticks to the bottom of the win screen's own scroll area,
   which ends at the top of the footer, so it always stays fully visible and tappable above the footer. */
#ui > #s-win #win-go{position:-webkit-sticky;position:sticky;bottom:8px;z-index:6}
