/* Herb, the chat budtender: styles carried over from the previous stylesheet (plain mode; NY bars mascots). */
/* Herb's body: the Herbology H tile */
.hb-chat-btn{position:fixed;right:12px;bottom:8px;z-index:70;width:80px;height:97px;padding:0;margin:0;background:none;border:0;cursor:pointer;will-change:transform;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.hb-chat-btn[hidden]{display:none}
.hb-chat-btn:focus-visible{outline:3px solid var(--yellow);outline-offset:2px;border-radius:12px}
.hb-mascot{display:block;width:100%;height:100%;overflow:visible;transform-origin:50% 95%}
.hb-mascot g{transform-box:view-box}
.hb-ground{fill:#000;opacity:.4}
.hb-leg path,.hb-arm path{fill:none;stroke:#000;stroke-width:5;stroke-linecap:round}
.hb-leg ellipse,.hb-arm circle{fill:#000}
.hb-leg ellipse{transition:transform .2s}
.hb-seam{fill:none;stroke:#000;stroke-opacity:.16;stroke-width:1.4;stroke-dasharray:3 3}
.hb-shine{fill:none;stroke:#fff;stroke-opacity:.6;stroke-width:4;stroke-linecap:round}
.hb-top{transform-origin:60px 100px;transition:rotate .25s}
.hb-leg-l{transform-origin:47px 98px}
.hb-leg-r{transform-origin:73px 98px}
.hb-arm-l{transform-origin:17px 56px}
.hb-arm-r{transform-origin:103px 56px}
.hb-tag{position:absolute;right:calc(100% - 4px);top:12px;white-space:nowrap;background:#fff;color:#000;border:2.5px solid #000;border-radius:14px;padding:.3rem .7rem;font-weight:800;font-size:.85rem;line-height:1.2;box-shadow:0 4px 14px rgba(0,0,0,.45);pointer-events:none;transition:opacity .2s,transform .2s}
.hb-tag::after{content:"";position:absolute;right:-9px;top:50%;margin-top:-6px;border:6px solid transparent;border-left:8px solid #000;border-right:0}
.hb-chat-btn.is-walking .hb-tag{opacity:0;transform:translateX(8px)}
.hb-dot{position:absolute;top:2px;right:6px;width:15px;height:15px;border-radius:50%;background:#e5322d;border:2px solid #000}
.hb-dot[hidden]{display:none}
@media (max-width:760px){.hb-chat-btn{right:6px;bottom:62px;width:64px;height:78px}.hb-tag{top:6px;font-size:.8rem}}
/* idle: he breathes and his arms drift */
.hb-top{animation:hb-breathe 2.8s ease-in-out infinite}
.hb-arm-l{animation:hb-drift 2.8s ease-in-out infinite}
.hb-arm-r{animation:hb-drift 2.8s ease-in-out infinite reverse}
@keyframes hb-breathe{0%,100%{transform:translateY(0)}50%{transform:translateY(-1.5px)}}
@keyframes hb-drift{0%,100%{transform:rotate(0)}50%{transform:rotate(7deg)}}
/* walking */
.is-walking .hb-leg-l{animation:hb-step .46s ease-in-out infinite}
.is-walking .hb-leg-r{animation:hb-step .46s ease-in-out -.23s infinite}
.is-walking .hb-top{animation:hb-bounce .23s ease-in-out infinite alternate}
.is-walking .hb-arm-l{animation:hb-swing .46s ease-in-out infinite}
.is-walking .hb-arm-r{animation:hb-swing .46s ease-in-out -.23s infinite}
.is-walking.face-right .hb-top{rotate:5deg}
.is-walking.face-left .hb-top{rotate:-5deg}
.is-walking.face-right .hb-leg-l ellipse{transform:translateX(7px)}
.is-walking.face-left .hb-leg-r ellipse{transform:translateX(-7px)}
@keyframes hb-step{0%,100%{transform:rotate(15deg)}25%{transform:translateY(-6px) rotate(0)}50%{transform:rotate(-15deg)}75%{transform:rotate(0)}}
.is-walking.face-left .hb-leg{animation-direction:reverse}
@keyframes hb-bounce{from{transform:translateY(0)}to{transform:translateY(-3.5px)}}
@keyframes hb-swing{0%,100%{transform:rotate(-16deg)}50%{transform:rotate(16deg)}}
/* wave and hop */
.is-waving .hb-arm-r{animation:hb-wave 1.7s ease-in-out}
@keyframes hb-wave{0%{transform:rotate(0)}14%{transform:rotate(-122deg)}28%{transform:rotate(-92deg)}42%{transform:rotate(-124deg)}56%{transform:rotate(-92deg)}72%{transform:rotate(-120deg)}100%{transform:rotate(0)}}
.is-hopping .hb-mascot{animation:hb-hop .6s cubic-bezier(.3,.7,.4,1)}
@keyframes hb-hop{0%{transform:translateY(0) scale(1)}14%{transform:translateY(0) scale(1.07,.9)}45%{transform:translateY(-15px) scale(.96,1.05)}78%{transform:translateY(0) scale(1.05,.94)}100%{transform:translateY(0) scale(1)}}
/* in the chat header: he hops when he answers and bobs while he thinks */
.hb-who{display:flex;align-items:center;gap:.6rem}
.hb-avatar{width:40px;height:49px;flex:none;margin:-6px 0 -8px}
.hb-busy .hb-avatar .hb-top{animation:hb-bounce .28s ease-in-out infinite alternate}
.hb-busy .hb-avatar .hb-arm-r{animation:hb-swing .56s ease-in-out infinite}
@media (prefers-reduced-motion:reduce){.hb-mascot,.hb-mascot *{animation:none!important;transition:none!important}}
/* guide mode (no key yet): tap-only, no text box */
.hb-guide .hb-form{display:none}
.hb-guide-note{display:none;margin:0;max-width:none;padding:.7rem 1rem;border-top:1px solid var(--line);font-size:.88rem;color:var(--cream)}
.hb-guide-note a{color:var(--yellow);font-weight:800;white-space:nowrap}
.hb-guide .hb-guide-note{display:block}
.hb-chat{padding:0;position:fixed;right:18px;bottom:18px;z-index:71;width:min(390px,calc(100% - 24px));height:min(600px,calc(100% - 100px));background:var(--ink);border:1px solid var(--line);border-radius:10px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 12px 40px rgba(0,0,0,.6)}
.hb-chat[hidden]{display:none}
@media (max-width:760px){.hb-chat{right:12px;bottom:76px;height:min(560px,calc(100% - 150px))}}
.hb-head{background:var(--yellow);color:var(--black);padding:.8rem 1rem;display:flex;align-items:center;justify-content:space-between;gap:.75rem}
.hb-id{display:flex;flex-direction:column;line-height:1.15}
.hb-id b{font-size:1.15rem;letter-spacing:-.01em}
.hb-id span{font-size:.78rem;font-weight:700;opacity:.72}
.hb-close{background:none;border:0;font-size:1.8rem;line-height:1;cursor:pointer;color:var(--black);padding:0 .2rem}
.hb-log{flex:1;overflow:auto;padding:1rem;display:flex;flex-direction:column;gap:.55rem}
.hb-msg{max-width:88%;padding:.65rem .85rem;border-radius:12px;font-size:.95rem;line-height:1.45}
.hb-assistant{background:var(--panel);color:var(--cream);align-self:flex-start;border-bottom-left-radius:3px}
.hb-user{background:var(--yellow);color:var(--black);align-self:flex-end;border-bottom-right-radius:3px;font-weight:600}
.hb-acts{display:flex;flex-direction:column;gap:.4rem;align-self:flex-start;width:min(88%,300px)}
.hb-act{display:block;background:var(--black);border:2px solid var(--yellow);color:var(--yellow);padding:.55rem .85rem;border-radius:8px;font-weight:800;font-size:.92rem}
.hb-act:hover{background:var(--yellow);color:var(--black)}
.hb-chips{display:flex;flex-wrap:wrap;gap:.4rem;justify-content:flex-end}
.hb-chip{background:none;border:1.5px solid var(--line);color:var(--cream);padding:.4rem .75rem;border-radius:999px;font:inherit;font-size:.85rem;font-weight:700;cursor:pointer}
.hb-chip:hover{border-color:var(--yellow);color:var(--yellow)}
.hb-typing{display:flex;gap:4px;padding:.85rem .95rem}
.hb-typing i{width:7px;height:7px;border-radius:50%;background:var(--dust);animation:hbdot 1s infinite ease-in-out}
.hb-typing i:nth-child(2){animation-delay:.15s}
.hb-typing i:nth-child(3){animation-delay:.3s}
@keyframes hbdot{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.hb-form{display:flex;border-top:1px solid var(--line)}
.hb-form input{flex:1;min-width:0;background:var(--black);color:var(--cream);border:0;padding:.9rem 1rem;font:inherit;font-size:16px}
.hb-form input:disabled,.hb-form button:disabled{opacity:.5}
.hb-form button{background:var(--yellow);color:var(--black);border:0;padding:0 1.1rem;font:inherit;font-weight:800;cursor:pointer}
.hb-foot{font-size:.72rem;color:var(--dust);padding:.5rem 1rem .7rem;margin:0;max-width:none}
.hb-forget{background:none;border:0;padding:0;font:inherit;color:var(--yellow);text-decoration:underline;cursor:pointer}
@media (prefers-reduced-motion:reduce){.hb-typing i{animation:none;opacity:.6}}
.hb-form input:focus-visible{outline:2px solid var(--yellow);outline-offset:-2px}
/* round 3: Herb steps aside + delivery checker */
.hb-chat-btn{transition:opacity .25s,visibility .25s}
.hb-away .hb-chat-btn{opacity:0;visibility:hidden;pointer-events:none}
.hb-away .bag{opacity:0;pointer-events:none}
/* ---------- Herb in 3D (canvas sits over the old drawing, a bit bigger so he can wave and hop) ---------- */
.hb-chat-btn .hb-canvas{position:absolute;left:-40%;top:-45%;width:180%;height:150%;pointer-events:none;display:block}
.hb-chat-btn.hb-3d .hb-mascot{visibility:hidden}
/* floating buttons: Herb's bubble sits above him (never over the bag), the bag sits above Herb */
.hb-tag{top:auto;bottom:calc(100% + 8px);right:0}
.hb-tag::after{right:24px;top:100%;margin-top:0;border:7px solid transparent;border-top:8px solid #000;border-bottom:0}
.hb-chat-btn.is-walking .hb-tag{transform:translateY(6px)}
@media (max-width:760px){.hb-tag{top:auto}}
.hb-chat-btn.is-held,.bag.is-held{opacity:0!important;visibility:hidden!important;pointer-events:none!important}
/* plain build (no mascot): the H tile as a chat button */
[data-herb="plain"] .hb-chat-btn{width:62px;height:62px;right:16px;bottom:16px}
[data-herb="plain"] .hb-tile{filter:drop-shadow(0 6px 14px rgba(0,0,0,.45))}
@media (max-width:760px){[data-herb="plain"] .hb-chat-btn{width:54px;height:54px;right:12px;bottom:74px}}
