/* SOS Crisis lab kit: phone stage, panel, Bea mascot, motion. Sits on top of shared.css. */
body { background: #030409; min-height: 100dvh; }
.stage { display: grid; grid-template-columns: 330px 1fr; min-height: 100dvh; }
.phone-wrap { display: grid; place-items: center; padding: 20px; overflow: hidden; position: relative; }
.phone { width: 390px; height: 844px; border-radius: 54px; padding: 12px; background: #0a0b12; box-shadow: 0 0 0 2px #262a38, 0 40px 120px -20px var(--halo, rgba(255,106,61,.25)), 0 30px 60px rgba(0,0,0,.6); flex-shrink: 0; transition: box-shadow .8s; }
.host { position: relative; width: 100%; height: 100%; border-radius: 44px; overflow: hidden; background: var(--bg); isolation: isolate; }
.host.shake { animation: hostShake .5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes hostShake { 10%,90% { transform: translateX(-1px) } 20%,80% { transform: translateX(3px) } 30%,50%,70% { transform: translateX(-5px) } 40%,60% { transform: translateX(5px) } }
.island { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 120px; height: 34px; border-radius: 20px; background: #000; z-index: 60; transition: width .5s cubic-bezier(.22,1,.36,1), height .5s cubic-bezier(.22,1,.36,1); display: flex; align-items: center; gap: 8px; padding: 0 12px; overflow: hidden; color: #fff; font-size: 12px; white-space: nowrap; }
.island.live { width: 320px; height: 70px; border-radius: 30px; }
.island .ii { opacity: 0; transition: opacity .3s .2s; display: flex; align-items: center; gap: 10px; width: 100%; }
.island.live .ii { opacity: 1; }
.statusbar { position: absolute; inset: 0 0 auto 0; height: 50px; display: flex; justify-content: space-between; align-items: center; padding: 6px 30px 0 34px; font-weight: 600; font-size: 16px; z-index: 50; pointer-events: none; }
.progress { position: absolute; top: 54px; left: 24px; right: 24px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); z-index: 45; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 3px; transition: width .5s cubic-bezier(.22,1,.36,1), background .5s; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 70px 22px 28px; transition: transform .5s cubic-bezier(.22,1,.36,1), opacity .4s ease, filter .4s; }
.screen.from-right { transform: translateX(100%); } .screen.from-left { transform: translateX(-30%); opacity: 0; }
.screen.to-left { transform: translateX(-30%); opacity: 0; filter: blur(3px); } .screen.to-right { transform: translateX(100%); }
.screen.fade-in { opacity: 0; transform: scale(1.04); filter: blur(6px); }
.screen h1 { font-family: var(--disp); font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
.screen .body { color: var(--muted); font-size: 15px; line-height: 1.5; margin-top: 8px; }
.overlay { position: absolute; inset: 0; z-index: 70; display: flex; background: rgba(0,0,0,0); transition: background .3s; }
.overlay.show { background: rgba(0,0,0,.6); }
.sheet { margin-top: auto; width: 100%; border-radius: 22px 22px 44px 44px; background: #15171f; transform: translateY(100%); transition: transform .4s cubic-bezier(.22,1,.36,1); padding: 18px 20px 30px; }
.overlay.show .sheet { transform: none; }

.host .star { opacity: .08 !important; animation: none; }
.screen h1 { text-wrap: balance; } .bubble, .body { text-wrap: pretty; }
/* mood washes the whole screen */
.mood-wash { position: absolute; inset: 0; z-index: -1; transition: background 1s ease; pointer-events: none; }
/* panel */
.panel { background: #06070d; border-right: 1px solid #171a26; padding: 22px; overflow-y: auto; height: 100dvh; position: sticky; top: 0; }
.chipbtn { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 11px; font-size: 13.5px; color: var(--muted); background: #0d0f17; border: 1px solid transparent; text-align: left; transition: border-color .2s, color .2s, background .2s; }
.chipbtn:hover { color: #fff; } .chipbtn.on { border-color: var(--primary); color: #fff; background: #120d0d; }
.vlink { display: block; padding: 9px 11px; border-radius: 11px; font-size: 13.5px; color: var(--muted); background: #0d0f17; border: 1px solid transparent; }
.vlink:hover { color: #fff; } .vlink.on { border-color: #2c3245; color: #fff; }
.step-link { display: flex; gap: 10px; width: 100%; text-align: left; padding: 6px 10px; border-radius: 9px; font-size: 13.5px; color: var(--muted); }
.step-link:hover { background: #0e1018; } .step-link.on { background: #0e1018; color: #fff; }
/* Bea, the beacon buddy */
.bea { position: relative; width: var(--bs, 150px); height: var(--bs, 150px); flex-shrink: 0; }
.bea svg { width: 100%; height: 100%; overflow: visible; }
.bea .body { transform-origin: 50% 70%; animation: beaBreath 3.2s ease-in-out infinite; }
.bea.panic .body { animation: beaPanic .18s linear infinite; }
.bea.happy .body { animation: beaHop 1s cubic-bezier(.34,1.56,.64,1) infinite; }
.bea.think .body { animation: beaBreath 1.6s ease-in-out infinite; }
@keyframes beaBreath { 0%,100% { transform: scale(1, 1) } 50% { transform: scale(1.04, .97) } }
@keyframes beaPanic { 0%,100% { transform: translate(-1.5px, 0) rotate(-1.5deg) } 50% { transform: translate(1.5px, -1px) rotate(1.5deg) } }
@keyframes beaHop { 0%,100% { transform: translateY(0) scale(1,1) } 30% { transform: translateY(-14px) scale(.95,1.06) } 55% { transform: translateY(0) scale(1.08,.92) } 70% { transform: translateY(0) scale(1,1) } }
.bea .lid { transform-origin: center; transform-box: fill-box; animation: blink 4.2s infinite; }
@keyframes blink { 0%,93%,100% { transform: scaleY(0) } 95.5% { transform: scaleY(1) } }
.bea .halo { transform-origin: center; transform-box: fill-box; animation: halo 2.4s cubic-bezier(.22,1,.36,1) infinite; }
.bea.panic .halo { animation-duration: .9s; }
@keyframes halo { 0% { transform: scale(.85); opacity: .7 } 100% { transform: scale(1.5); opacity: 0 } }
.bea .sweat { opacity: 0; transition: opacity .3s; } .bea.panic .sweat, .bea.worried .sweat { opacity: 1; animation: sweat 1.2s ease-in infinite; }
@keyframes sweat { 0% { transform: translateY(-4px); opacity: 0 } 30% { opacity: 1 } 100% { transform: translateY(14px); opacity: 0 } }
.bea .glasses { opacity: 0; transform: translateY(-30px); transition: all .6s cubic-bezier(.34,1.56,.64,1); }
.bea.cool .glasses { opacity: 1; transform: none; }
.bea .thumb { opacity: 0; transform: scale(.3) rotate(-30deg); transform-origin: 30% 90%; transform-box: fill-box; transition: all .45s cubic-bezier(.34,1.56,.64,1); }
.bea.happy .thumb, .bea.cool .thumb { opacity: 1; transform: none; }
.bea .fill { transition: fill .8s ease; } .bea .mouth, .bea .brow { transition: d .45s cubic-bezier(.22,1,.36,1); }
.bubble { position: relative; background: #fff; color: #0f1220; font-weight: 600; font-size: 15px; line-height: 1.35; padding: 12px 14px; border-radius: 18px; max-width: 280px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); transform-origin: 20% 100%; }
.bubble::after { content: ''; position: absolute; left: 26px; bottom: -7px; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); border-radius: 3px; }
.bubble.top::after { top: -7px; bottom: auto; }
.bubble-in { animation: bubbleIn .45s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes bubbleIn { from { transform: scale(.6) translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }
.caret::after { content: '▍'; animation: blinkc .8s steps(1) infinite; margin-left: 1px; color: var(--primary); }
@keyframes blinkc { 50% { opacity: 0 } }
/* breathing ring */
.breath { position: relative; width: 200px; height: 200px; display: grid; place-items: center; }
.breath i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--primary) 60%, transparent); animation: breathe 8s ease-in-out infinite; }
.breath i:nth-child(2) { animation-delay: -.6s; opacity: .5 } .breath i:nth-child(3) { animation-delay: -1.2s; opacity: .25 }
@keyframes breathe { 0%,100% { transform: scale(.62) } 50% { transform: scale(1) } }
/* scenario tiles */
.tile { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--border); text-align: left; width: 100%; transition: border-color .2s, transform .25s cubic-bezier(.22,1,.36,1), background .2s; }
.tile:hover { border-color: var(--primary); transform: translateY(-2px); } .tile:active { transform: scale(.98); }
.tile.sel { border-color: var(--primary); background: color-mix(in srgb, var(--primaryTint) 70%, var(--surface)); }
/* confetti */
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i { position: absolute; top: -10px; width: 8px; height: 12px; border-radius: 2px; animation: fall var(--d, 2.2s) cubic-bezier(.25,.6,.4,1) forwards; }
@keyframes fall { to { transform: translate(var(--x), 900px) rotate(var(--r)); opacity: .2 } }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: rgba(255,255,255,.35); transform: scale(0); animation: rip .6s ease-out forwards; }
@keyframes rip { to { transform: scale(4); opacity: 0 } }
.count-chip { font-family: var(--mono); font-variant-numeric: tabular-nums; }
@keyframes rise2 { from { transform: translateY(12px); opacity: 0; filter: blur(3px) } to { transform: none; opacity: 1; filter: none } }
.r2 { animation: rise2 .5s cubic-bezier(.22,1,.36,1) both; }
@media (max-width: 860px) {
  .stage { display: block; }
  .panel { position: fixed; inset: auto 0 0 0; height: auto; max-height: 80dvh; z-index: 90; border-radius: 20px 20px 0 0; border: 1px solid #171a26; transform: translateY(105%); transition: transform .35s cubic-bezier(.22,1,.36,1); }
  .panel.open { transform: none; }
  .phone-wrap { padding: 0; min-height: 100dvh; }
}
@media (max-width: 500px) {
  .phone { width: 100vw !important; height: 100dvh !important; border-radius: 0; padding: 0; box-shadow: none; transform: none !important; }
  .host { border-radius: 0; } .statusbar { display: none; } .island:not(.live) { display: none; } .island.live { top: calc(env(safe-area-inset-top) + 8px); }
  .progress { top: calc(env(safe-area-inset-top) + 12px); }
  .screen { padding-top: calc(env(safe-area-inset-top) + 32px); padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }
}
@media (prefers-reduced-motion: reduce) { .bea .body, .bea .halo, .breath i { animation: none !important; } }
