.avatar-chat{position:fixed;left:max(20px,env(safe-area-inset-left));bottom:max(20px,env(safe-area-inset-bottom));z-index:70;font-family:inherit;line-height:1.5;color:#132c24;word-break:keep-all}.avatar-launch{display:flex;align-items:center;gap:12px;padding:7px 18px 7px 7px;border:1px solid #fff9;border-radius:999px;background:#132c24;color:#fff;box-shadow:0 8px 30px #081f2433;cursor:pointer;text-align:left}.avatar-launch img{width:58px;height:58px;object-fit:cover;object-position:50% 22%;border-radius:50%;border:2px solid #c5fa76}.avatar-launch strong{display:block;font-size:15px}.avatar-launch small{display:block;color:#d8edc3;font-size:12px;margin-top:2px}.avatar-launch:hover{background:#214736}.avatar-chat button:focus-visible,.avatar-chat a:focus-visible,.avatar-chat textarea:focus-visible{outline:3px solid #7baa44;outline-offset:3px}.avatar-dialog{position:absolute;left:0;bottom:87px;width:min(390px,calc(100vw - 40px));height:min(580px,calc(100dvh - 125px));min-height:260px;background:#fff;border:1px solid #d0dec7;border-radius:18px;box-shadow:0 18px 70px #061b2140;display:flex;flex-direction:column;overflow:hidden}.avatar-chat [hidden]{display:none!important}.avatar-head{display:flex;align-items:center;gap:11px;background:#132c24;color:white;padding:17px}.avatar-head img{width:45px;height:45px;object-fit:cover;object-position:50% 22%;border-radius:50%;border:1px solid #c5fa76}.avatar-head h2{font-size:17px;letter-spacing:-.3px;margin:0;line-height:1.4}.avatar-head p{font-size:12px;color:#d1e4c6;margin:3px 0 0}.avatar-close{margin-left:auto;border:0;background:transparent;color:#fff;font-size:25px;width:36px;height:36px;cursor:pointer;border-radius:5px}.avatar-close:hover{background:#ffffff20}.avatar-log{overflow:auto;overscroll-behavior:contain;padding:18px 16px;flex:1;min-height:0;scroll-behavior:smooth;background:#f6f9f2}.avatar-message{padding:12px 14px;border-radius:13px;max-width:95%;font-size:15px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal;margin:0 0 12px;background:#fff;border:1px solid #e0e8d9}.avatar-message.user{margin-left:auto;background:#dff2c9;border-color:#c9e2b4}.avatar-message.error{border-color:#d7aa8d;background:#fff7ef}.avatar-author{display:block;font-size:12px;font-weight:700;margin-bottom:5px;color:#587247}.avatar-suggestions{display:flex;flex-wrap:wrap;gap:7px;padding:0 16px 12px;background:#f6f9f2}.avatar-suggestions button{background:#fff;color:#244927;border:1px solid #baccad;border-radius:20px;padding:7px 10px;font:inherit;font-size:13px;cursor:pointer}.avatar-suggestions button:hover{background:#e6f2d9}.avatar-status{font-size:13px;color:#52634c;padding:0 16px;background:#f6f9f2;min-height:20px}.avatar-form{border-top:1px solid #dce5d5;padding:12px 14px 8px;background:white}.avatar-input-row{display:flex;align-items:flex-end;gap:9px}.avatar-form textarea{min-width:0;flex:1;border:1px solid #c3d1b8;border-radius:10px;padding:10px;font:inherit;font-size:16px;line-height:1.5;height:68px;max-height:120px;resize:vertical;color:#132c24;background:white}.avatar-send{border:0;border-radius:10px;background:#132c24;color:#fff;padding:12px;font:inherit;font-size:14px;cursor:pointer;min-height:46px}.avatar-send:disabled{opacity:.45;cursor:wait}.avatar-note{font-size:12px;color:#627257;margin:7px 0 0;line-height:1.5}.avatar-links{display:flex;justify-content:space-between;align-items:center;padding:7px 15px 13px;gap:12px;background:#fff}.avatar-links a{color:#244b29;font-size:14px;font-weight:650;text-decoration:underline;text-underline-offset:3px}.avatar-reset{border:0;background:transparent;font:inherit;color:#65765c;font-size:12px;cursor:pointer;padding:5px}.avatar-reset:disabled{opacity:.5}.avatar-message a{color:#285e21;text-decoration:underline}.avatar-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:560px){.avatar-chat{left:12px;bottom:max(12px,env(safe-area-inset-bottom))}.avatar-launch{padding:5px 13px 5px 5px;gap:8px}.avatar-launch img{width:48px;height:48px}.avatar-launch strong{font-size:14px}.avatar-launch small{display:none}.avatar-dialog{bottom:70px;width:calc(100vw - 24px);height:min(560px,calc(100dvh - 100px))}.avatar-head{padding:12px 14px}.avatar-log{padding:13px}.avatar-form textarea{height:58px}.avatar-note{font-size:12px}.avatar-chat.is-open .avatar-launch{padding-right:13px}}@media(prefers-reduced-motion:reduce){.avatar-log{scroll-behavior:auto}}

/* Right-side chatbot pet */
.avatar-chat{left:auto;right:max(20px,env(safe-area-inset-right))}
.avatar-dialog{left:auto;right:0;bottom:86px}
.avatar-launch{flex-direction:column-reverse;gap:2px;padding:0;border:0;border-radius:0;background:transparent;color:#132c24;box-shadow:none;text-align:center}
.avatar-launch:hover{background:transparent}
.avatar-launch img{width:130px;height:130px;object-fit:contain;object-position:center;border:0;border-radius:0;filter:drop-shadow(0 6px 5px #132c2429);transform-origin:50% 90%;animation:pet-greeting 2s ease-in-out 2}
.avatar-launch>span{padding:8px 14px;border:1px solid #d2dfc7;border-radius:14px;background:#fff;box-shadow:0 4px 16px #132c2414}
.avatar-launch strong{font-size:14px}.avatar-launch small{display:block;color:#4c6545;font-size:12px}
.avatar-launch:hover img{transform:rotate(-4deg) translateY(-3px)}
.avatar-chat.is-open .avatar-launch{padding:0}.avatar-chat.is-open .avatar-launch img{width:65px;height:65px;animation:none}.avatar-chat.is-open .avatar-launch>span{display:none}
.avatar-head img{object-fit:contain;object-position:center;border:0;border-radius:0;width:48px;height:48px}
@keyframes pet-greeting{0%,100%{transform:translateY(0) rotate(0)}25%{transform:translateY(-6px) rotate(-4deg)}60%{transform:translateY(-3px) rotate(3deg)}}
@media(max-width:560px){.avatar-chat{left:auto;right:max(12px,env(safe-area-inset-right))}.avatar-launch img{width:104px;height:104px}.avatar-launch>span{padding:6px 10px}.avatar-launch strong{font-size:13px}.avatar-launch small{font-size:12px}.avatar-dialog{left:auto;right:0;bottom:72px;width:calc(100vw - 24px);height:min(560px,calc(100dvh - 100px))}.avatar-chat.is-open .avatar-launch img{width:56px;height:56px}}
@media(prefers-reduced-motion:reduce){.avatar-launch img{animation:none!important}.avatar-launch:hover img{transform:none}}

/* Movable pet with local visibility preferences */
.avatar-chat{left:max(12px,env(safe-area-inset-left));right:auto;bottom:max(12px,env(safe-area-inset-bottom));width:max-content;max-width:calc(100vw - 24px)}
.avatar-chat[hidden],.avatar-restore[hidden]{display:none!important}
.avatar-dialog{position:fixed;right:auto;bottom:auto;min-height:0;max-height:calc(100dvh - 24px);max-width:calc(100vw - 24px)}
.avatar-launch{touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}
.avatar-launch img{-webkit-user-drag:none;pointer-events:none}
.avatar-launch>span{pointer-events:none}
.avatar-launch small{font-size:12px}
.avatar-chat.is-dragging .avatar-launch{cursor:grabbing}
.avatar-chat.is-dragging .avatar-launch img{animation:none;transform:none}
.avatar-pet-controls{display:flex;justify-content:center;gap:6px;margin-top:3px}
.avatar-pet-controls button{border:1px solid #d6e0ce;background:#fff;color:#45633d;border-radius:12px;padding:5px 8px;font:inherit;font-size:12px;cursor:pointer;min-height:30px;box-shadow:0 2px 7px #132c2410}
.avatar-pet-controls button:hover{background:#eaf3e1}
.avatar-chat.is-open .avatar-pet-controls{display:none}
.avatar-restore{position:fixed;left:max(12px,env(safe-area-inset-left));bottom:max(12px,env(safe-area-inset-bottom));z-index:70;border:1px solid #b9c9ad;background:#fff;color:#244927;border-radius:22px;padding:10px 14px;font:inherit;font-size:14px;line-height:1.4;cursor:pointer;box-shadow:0 4px 15px #132c241c}
.avatar-restore:focus-visible{outline:3px solid #7baa44;outline-offset:3px}
@media(max-width:560px){.avatar-chat{left:12px;right:auto}.avatar-dialog{left:12px;right:auto;bottom:auto;max-height:calc(100dvh - 24px)}.avatar-pet-controls button{min-height:32px}}

/* Collapse to a small fox when visitors click elsewhere. */
.avatar-chat.is-open .avatar-launch>span{display:block}
.avatar-chat.is-open .avatar-pet-controls{display:flex}
.avatar-chat.is-compact .avatar-launch>span,.avatar-chat.is-compact .avatar-pet-controls{display:none}
.avatar-chat.is-compact .avatar-launch img{width:64px;height:64px;animation:none}
@media(max-width:560px){.avatar-chat.is-compact .avatar-launch img{width:56px;height:56px}}
