.pixel-pet{display:inline-block;width:64px;height:64px;flex-shrink:0;line-height:0}
.pixel-pet svg{display:block;width:100%;height:100%;overflow:visible}
.pet-arms-happy,.pet-eyes-happy,.pet-eyes-closed,.pet-cup{display:none}
.pixel-pet[data-pose=happy] .pet-arms-idle,.pixel-pet[data-pose=happy] .pet-eyes-open{display:none}
.pixel-pet[data-pose=happy] .pet-arms-happy,.pixel-pet[data-pose=happy] .pet-eyes-happy{display:block}
.pixel-pet[data-pose=cup] .pet-cup{display:block}
.pixel-pet[data-pose=cup] .pet-arms-idle{display:none}
.pixel-pet[data-pose=cup] .pet-feet{transform:translateY(-1px)}
.brand-wrap{display:flex;align-items:center;gap:7px}
.pet-button{padding:0;border-radius:12px;display:grid;place-items:center;width:64px;height:64px}
.pet-button:hover{background:var(--soft)}
.pet-button .pet-eyes-open{animation:pet-eyes-open 11s step-end infinite}
.pet-button .pet-eyes-closed{display:block;animation:pet-eyes-closed 11s step-end infinite}
@keyframes pet-eyes-open{0%,46%,49%,100%{opacity:1}47%,48%{opacity:0}}
@keyframes pet-eyes-closed{0%,46%,49%,100%{opacity:0}47%,48%{opacity:1}}
.pet-button.is-thinking .pet-eyes-open{transform:translateX(1px)}
.is-jumping .pet-body,.decision-celebration .pet-body{animation:pet-jump .65s steps(8,end) 1}
@keyframes pet-jump{0%,100%{transform:translateY(0)}20%{transform:translateY(2px)}50%{transform:translateY(-8px)}75%{transform:translateY(-3px)}90%{transform:translateY(1px)}}
.empty .pixel-pet{width:96px;height:96px}
.empty .pixel-pet[data-pose=cup]{margin-top:2px}
.decision-celebration{display:flex;align-items:center;gap:10px;margin-bottom:12px;padding:8px 12px;border-radius:12px;background:var(--tint);color:var(--accent);font-size:13px}
.decision-celebration .pixel-pet{width:52px;height:52px}
.decision-celebration p{margin:0}
body.pet-rest .pet-button .pet-eyes-open{animation:none}
body.pet-rest .pet-button .pet-eyes-closed{display:none;animation:none}
@media(max-width:600px){.pet-button,.pet-button .pixel-pet{width:49px;height:49px}.brand-wrap{gap:5px}}
@media(max-width:355px){.pet-button,.pet-button .pixel-pet{width:41px;height:41px}}
@media(prefers-reduced-motion:reduce){.pixel-pet *{animation:none!important}.pet-button .pet-eyes-closed{display:none}}
.pet-sad-face{display:none}
.pixel-pet[data-pose=sad] .pet-sad-face{display:block}
.pixel-pet[data-pose=sad] .pet-eyes-open,.pixel-pet[data-pose=sad] .pet-smile{display:none}
.pixel-pet[data-pose=sad] .pet-arms-idle{transform:translateY(2px)}
.is-sighing .pet-body{animation:pet-sigh .7s steps(6,end) 1}
@keyframes pet-sigh{0%,100%{transform:translateY(0)}50%{transform:translateY(2px)}}
:root{--decline-bg:#fbe9e5;--decline-ink:#963d36;--decline-line:#dfa79f}
:root[data-theme=dark]{--decline-bg:#442e2e;--decline-ink:#f2b0a7;--decline-line:#88514b}
#detail[open]{display:flex;flex-direction:column;height:min(90dvh,900px);overflow:hidden}
#detail .dialog-top{position:static;flex-shrink:0}
#detail-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:5px}
#decision-panel{position:static;flex-shrink:0;max-height:46dvh;overflow-y:auto}
.decision-companion{display:flex;align-items:center;gap:10px}
.decision-companion .pixel-pet{width:60px;height:60px}
.decision-companion p{font-size:13px;line-height:1.45;margin:0;overflow-wrap:anywhere;min-width:0}
#decision-panel .confirmation{padding:12px}
#decision-panel .confirmation-rejected{background:var(--decline-bg);border:1px solid var(--decline-line);color:var(--decline-ink)}
.danger-button{background:var(--decline-ink);color:var(--surface);padding:12px 18px;border-radius:10px;font-size:13px;font-weight:700}
:root[data-theme=dark] .danger-button{background:#bc5c53;color:#fff5f0}
#decision-panel[data-decision=rejected]>.decision-companion{color:var(--decline-ink)}
.decline-button{color:var(--decline-ink);border-color:var(--decline-line)}
.decision.rejected{color:var(--decline-ink);background:var(--decline-bg);border-color:var(--decline-line)}
@media(max-width:600px){#detail[open]{height:94dvh}}

/* Small, occasional gestures: no moving controls or layout shifts. */
.pet-arms-wave{display:none}
.is-waving .pet-arms-idle{display:none}
.is-waving .pet-arms-wave{display:block}
.pet-wave-hand{transform-origin:50px 32px}
.is-waving .pet-wave-hand{animation:pet-wave 1.1s steps(5,end) 1}
@keyframes pet-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(18deg)}40%,80%{transform:rotate(-12deg)}}
.is-dancing .pet-body{transform-origin:32px 55px;animation:pet-dance .9s steps(7,end) 1}
@keyframes pet-dance{0%,100%{transform:translate(0) rotate(0)}20%{transform:translate(-3px,-3px) rotate(-7deg)}40%{transform:translate(0,-7px)}65%{transform:translate(3px,-3px) rotate(7deg)}85%{transform:translateY(1px)}}
.pet-leaf{transform-origin:31px 14px}
.is-jumping .pet-leaf,.is-dancing .pet-leaf{animation:pet-leaf .65s steps(5,end) 1}
@keyframes pet-leaf{0%,100%{transform:rotate(0)}40%{transform:rotate(-16deg)}75%{transform:rotate(12deg)}}
.pet-button.is-thinking .pet-eyes-open{animation:pet-look 1.8s steps(3,end) 3}
.pet-button.is-thinking .pet-eyes-closed{display:none}
@keyframes pet-look{0%,100%{transform:translateX(0)}25%{transform:translateX(-2px)}65%{transform:translateX(2px)}}
.pixel-pet[data-pose=cup] .pet-steam{animation:pet-steam 8s steps(6,end) infinite}
@keyframes pet-steam{0%,22%,100%{opacity:.65;transform:translateY(0)}12%{opacity:0;transform:translateY(-4px)}13%{opacity:0;transform:translateY(1px)}}
body.pet-rest .pet-button .pixel-pet *{animation-play-state:paused}
body.pet-hidden .pixel-pet *{animation-play-state:paused}

.pet-yawn-face,.pet-wink-face{display:none}
.is-yawning .pet-yawn-face,.is-winking .pet-wink-face{display:block}
.is-yawning .pet-eyes-open,.is-yawning .pet-eyes-closed,.is-yawning .pet-smile,
.is-winking .pet-eyes-open,.is-winking .pet-eyes-closed{display:none}
.is-yawning .pet-body{transform-origin:32px 55px;animation:pet-yawn 2.3s steps(7,end) 1}
@keyframes pet-yawn{0%,100%{transform:scale(1)}30%,65%{transform:scale(1.025,.96) translateY(1px)}}
.is-stretching .pet-arms-idle,.is-stretching .pet-eyes-open,.is-stretching .pet-eyes-closed{display:none}
.is-stretching .pet-arms-happy,.is-stretching .pet-eyes-happy{display:block}
.is-stretching .pet-body{transform-origin:32px 55px;animation:pet-stretch 1.7s steps(8,end) 1}
@keyframes pet-stretch{0%,100%{transform:scale(1)}35%,65%{transform:scale(.96,1.07) translateY(-1px)}}
.is-looking .pet-eyes-open{animation:pet-look 1.7s steps(3,end) 1}
.is-looking .pet-eyes-closed{display:none}
.is-leafing .pet-leaf{animation:pet-leaf 1.2s steps(6,end) 1}

/* Action companions occupy existing headings and the persistent decision row. */
.pet-ticket,.pet-map,.pet-blanket,.pet-sparkles{display:none}
.has-ticket .pet-ticket,.has-map .pet-map,.has-comfort .pet-cup,.is-cozy .pet-blanket{display:block}
.has-ticket .pet-arms-happy,.has-ticket .pet-arms-idle,.has-map .pet-arms-idle,.has-comfort .pet-arms-idle{display:none}
.has-map.is-waving .pet-arms-wave{display:none}
.is-celebrating .pet-body{animation:pet-dance 1.4s steps(9,end) 1;transform-origin:32px 55px}
.is-celebrating .pet-sparkles{display:block;animation:pet-sparkle 1.4s steps(5,end) 1}
@keyframes pet-sparkle{0%,100%{opacity:0}20%,65%{opacity:1}45%{opacity:.35}}
.is-soothing .pet-body{animation:pet-comfort 1.4s steps(7,end) 1;transform-origin:32px 55px}
.is-soothing .pet-steam{animation:pet-steam 1.4s steps(6,end) 1}
@keyframes pet-comfort{0%,100%{transform:rotate(0)}30%{transform:rotate(-3deg) translateY(1px)}65%{transform:rotate(3deg)}}
.is-cozy .pet-eyes-open,.is-cozy .pet-eyes-closed{display:none}
.is-cozy .pet-eyes-happy{display:block}
.companion-play{padding:0;display:grid;place-items:center;flex-shrink:0;border-radius:14px}
.companion-play:hover{background:var(--soft)}
.decision-companion .pixel-pet{width:72px;height:72px}
.catalog-companion,.day-companion,.filter-pet-heading{display:flex;align-items:center;gap:10px;min-width:0}
.catalog-companion>div{min-width:0}
.catalog-companion .pixel-pet,.day-companion .pixel-pet{width:52px;height:52px}
.catalog-companion>span,.day-companion>span{line-height:0;flex-shrink:0}
.day-companion{margin-bottom:14px}
.day-companion h3{margin:0}
.filter-pet-heading h2{margin:12px 0}
.filter-pet-heading .pixel-pet{width:58px;height:58px}
.topbar{position:sticky;top:0;z-index:3;background:var(--bg);padding:10px 0;padding-top:calc(10px + max(env(safe-area-inset-top,0px),var(--tg-content-safe-area-inset-top,0px)));box-shadow:0 6px 12px -12px #0006}
.app{padding-top:0}
html{scroll-padding-top:100px}
@media(max-width:600px){.topbar{padding-bottom:7px;padding-top:calc(7px + max(env(safe-area-inset-top,0px),var(--tg-content-safe-area-inset-top,0px)))}.catalog-companion{gap:5px}.catalog-companion .pixel-pet{width:38px;height:38px}.catalog-head h2{font-size:17px}.decision-companion .pixel-pet{width:64px;height:64px}}
@media(prefers-reduced-motion:reduce){.pet-sparkles{display:none!important}}
