#ally-pal{position:fixed;right:22px;bottom:20px;z-index:80;font-family:Montserrat,Arial,sans-serif}#ally-pal [hidden],#ally-pal[hidden]{display:none!important}.ally-pal-launch{width:84px;height:84px;background:transparent!important;border:0!important;padding:0!important;box-shadow:none!important;animation:pal-float 4s ease-in-out infinite}.ally-pal-body{position:relative;display:inline-block;width:72px;height:66px;border-radius:45% 45% 42% 42%;background:linear-gradient(145deg,#64d8ee,#2788c2 60%,#145781);box-shadow:inset 0 3px 0 #a0ecf4,0 8px 20px #143c6840;vertical-align:middle}.ally-pal-ear{position:absolute;top:-10px;width:22px;height:30px;background:#42b9db;border-radius:90% 20% 60% 20%}.ally-pal-ear.left{left:7px;transform:rotate(-25deg)}.ally-pal-ear.right{right:7px;transform:rotate(60deg)}.ally-pal-eye{position:absolute;top:24px;width:8px;height:12px;background:#103b5e;border-radius:50%;box-shadow:inset 2px 2px 0 white;animation:pal-blink 6s infinite}.ally-pal-eye.left{left:20px}.ally-pal-eye.right{right:20px}.ally-pal-smile{position:absolute;left:30px;top:38px;width:13px;height:8px;border-bottom:3px solid #103b5e;border-radius:50%}.ally-pal-heart{position:absolute;right:0;bottom:-5px;color:#ffcc75;font-size:23px;text-shadow:0 2px 3px #135781}.ally-pal-hello{position:absolute;right:5px;bottom:102px;width:240px;background:white;color:#163d60;border:1px solid #d7e8ee;border-radius:20px 20px 4px 20px;padding:16px 30px 16px 16px;box-shadow:0 8px 25px #0f3d6820;font-size:13px;line-height:1.5}.ally-pal-hello button{position:absolute;right:3px;top:3px;background:transparent;color:#315b73;padding:3px 8px;border:0}.ally-pal-panel{position:absolute;right:0;bottom:100px;width:420px;max-width:calc(100vw - 28px);max-height:calc(100dvh - 135px);overflow:auto;background:#fff;border:1px solid #cde2eb;border-radius:24px;box-shadow:0 16px 60px #0f3d683b;color:#183f60}.ally-pal-panel header{display:flex;align-items:center;gap:12px;background:#eaf7fb;padding:16px;border-radius:24px 24px 0 0}.ally-pal-panel header .ally-pal-body{transform:scale(.6);margin:-10px -12px}.ally-pal-panel header strong{display:block;font-size:17px}.ally-pal-panel small{display:block;font-size:11px;margin-top:5px}.ally-pal-close{margin-left:auto;background:transparent!important;color:#234b65!important;border:0!important;font-size:23px;padding:2px 9px!important}.ally-pal-intro{padding:16px 18px 8px;font-size:14px;line-height:1.5}.ally-pal-shortcuts{display:flex;flex-wrap:wrap;gap:6px;padding:8px 18px}.ally-pal-shortcuts button,.ally-pal-clear{background:#edf6fa!important;color:#174e70!important;border:1px solid #d2e7ef!important;border-radius:12px;padding:7px 10px!important;font-size:11px}.ally-pal-notice{margin:6px 18px;font-size:10px;line-height:1.5;color:#607383}.ally-pal-thread{max-height:270px;overflow:auto;padding:10px 18px}.ally-pal-thread article{padding:12px;margin:8px 0;border-radius:14px;font-size:12px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.ally-pal-thread strong{display:block;font-size:10px;margin-bottom:4px}.pal-you{background:#e7f5fb;margin-left:25px!important}.pal-answer{background:#f3f5f7;margin-right:15px!important}.ally-pal-form,.ally-pal-task{padding:10px 18px}.ally-pal-form label,.ally-pal-task label{font-size:12px;display:block;margin-bottom:5px}.ally-pal-panel textarea,.ally-pal-panel input{width:100%;box-sizing:border-box;margin:0 0 8px;font:13px Montserrat,Arial,sans-serif;border:1px solid #c4dae4;border-radius:10px;padding:10px}.ally-pal-controls{display:flex;gap:8px}.ally-pal-controls select{width:auto;max-width:130px;font-size:11px;padding:6px}.ally-pal-controls button,.ally-pal-task button{padding:8px 13px;font-size:12px;border-radius:12px}.ally-pal-status,.ally-pal-task-status{font-size:11px;margin:7px 0;line-height:1.5}.ally-pal-task summary{font-size:12px;cursor:pointer}.ally-pal-task form{padding-top:10px}.ally-pal-clear{margin:5px 18px 16px}#ally-pal button:focus-visible{outline:3px solid #dfaa43;outline-offset:3px}@keyframes pal-float{50%{transform:translateY(-7px) rotate(2deg)}}@keyframes pal-blink{0%,44%,48%,100%{transform:scaleY(1)}46%{transform:scaleY(.15)}}@media(prefers-reduced-motion:reduce){.ally-pal-launch,.ally-pal-eye{animation:none}}@media(max-width:600px){#ally-pal{right:12px;bottom:10px}.ally-pal-launch{width:70px;height:72px}.ally-pal-body{transform:scale(.85)}.ally-pal-panel{bottom:85px;max-height:calc(100dvh - 105px)}.ally-pal-hello{bottom:90px}.ally-pal-thread{max-height:220px}}
#ally-pal .ally-pal-form textarea{background:#dceff9!important;color:#153e5f;border:2px solid #85bbd5;min-height:105px}#ally-pal .ally-pal-form textarea::placeholder{color:#55788f;opacity:1}#ally-pal .ally-pal-form textarea:focus{background:#d3eaf7!important;outline:3px solid #9dd4e3;outline-offset:2px}.ally-pal-voice-consent{padding:12px;background:#e0f0f8;border:1px solid #98c5da;border-radius:12px;font-size:12px;line-height:1.5}.ally-pal-voice-consent button{margin:4px;padding:8px;font-size:11px}

/* Round Ally face, with expressions driven by actual companion activity. */
#ally-pal .ally-pal-body{width:72px;height:72px;border-radius:50%;background:radial-gradient(ellipse at 72% 18%,#8dfcf5aa,transparent 34%),radial-gradient(ellipse at 23% 78%,#02abef,transparent 48%),linear-gradient(155deg,#48e1f1 8%,#22c5ec 48%,#079bdd 100%);box-shadow:inset 0 2px 3px #c7ffffa0,inset -3px -5px 8px #0080c245,0 8px 18px #0f3d682b;overflow:hidden}
#ally-pal .ally-pal-eye{top:27px;width:19px;height:23px;background:linear-gradient(145deg,#fff,#ecf3f7);border-radius:52% 52% 45% 45%;border-top:2px solid #122849;box-shadow:inset 0 0 2px #0d224a70;animation:pal-face-blink 6s infinite;transform-origin:center}
#ally-pal .ally-pal-eye.left{left:13px}#ally-pal .ally-pal-eye.right{right:13px}
.ally-pal-pupil{position:absolute;right:0;top:3px;width:14px;height:19px;border-radius:50%;background:radial-gradient(ellipse at 40% 25%,white 0 17%,transparent 20%),radial-gradient(ellipse at 57% 44%,#05172d 0 48%,transparent 51%),linear-gradient(#154758,#1bc8c1);transition:transform .3s}
#ally-pal .ally-pal-eye.right .ally-pal-pupil{right:auto;left:0}
.ally-pal-brow{position:absolute;top:19px;width:15px;height:6px;border-top:4px solid #142440;border-radius:65%;transition:transform .3s,top .3s}
.ally-pal-brow.left{left:15px;transform:rotate(-22deg)}.ally-pal-brow.right{right:15px;transform:rotate(22deg)}
#ally-pal .ally-pal-smile{left:28px;top:51px;width:18px;height:9px;background:#112541;border:0;border-radius:8% 8% 60% 60%;clip-path:polygon(0 0,15% 30%,35% 45%,65% 45%,85% 30%,100% 0,90% 70%,65% 100%,35% 100%,10% 70%);transition:all .3s}
.ally-pal-cheek{position:absolute;top:47px;width:13px;height:9px;border-radius:50%;background:#61f8ded0;filter:blur(3px);opacity:.65}.ally-pal-cheek.left{left:7px}.ally-pal-cheek.right{right:7px}
#ally-pal[data-expression="listening"] .ally-pal-body{box-shadow:inset 0 2px 3px #c7ffffa0,0 0 0 5px #51dace30,0 8px 18px #0f3d682b}
#ally-pal[data-expression="listening"] .ally-pal-brow{top:15px}
#ally-pal[data-expression="listening"] .ally-pal-smile{left:33px;top:53px;width:7px;height:7px;border-radius:50%;clip-path:none}
#ally-pal[data-expression="listening"] .ally-pal-pupil{transform:translateY(-2px)}
#ally-pal[data-expression="thinking"] .ally-pal-pupil{animation:pal-look 2s ease-in-out infinite}
#ally-pal[data-expression="thinking"] .ally-pal-brow.left{transform:rotate(-35deg);top:15px}
#ally-pal[data-expression="thinking"] .ally-pal-smile{left:31px;top:54px;width:13px;height:4px;border-radius:50%;clip-path:none;transform:rotate(-10deg)}
#ally-pal[data-expression="happy"] .ally-pal-smile{left:25px;top:50px;width:23px;height:13px}
#ally-pal[data-expression="happy"] .ally-pal-cheek{opacity:1}
#ally-pal[data-expression="happy"] .ally-pal-launch{animation:pal-happy 1.5s ease-in-out 2,pal-float 4s ease-in-out infinite}
#ally-pal[data-expression="concerned"] .ally-pal-brow.left{transform:rotate(24deg)}
#ally-pal[data-expression="concerned"] .ally-pal-brow.right{transform:rotate(-24deg)}
#ally-pal[data-expression="concerned"] .ally-pal-smile{left:30px;top:55px;width:13px;height:3px;clip-path:none;border-radius:50%}
.ally-pal-controls{flex-wrap:wrap}
.ally-pal-live-consent{padding:12px;background:#e0f0f8;border:1px solid #98c5da;border-radius:12px;font-size:12px;line-height:1.5}
.ally-pal-live-consent button{margin:4px;padding:8px;font-size:11px}
@keyframes pal-face-blink{0%,43%,47%,100%{transform:scaleY(1)}45%{transform:scaleY(.08)}}
@keyframes pal-look{0%,100%{transform:translate(-2px,-2px)}50%{transform:translate(2px,-1px)}}
@keyframes pal-happy{0%,100%{transform:translateY(0)}50%{transform:translateY(-9px) rotate(-3deg)}}
@media(prefers-reduced-motion:reduce){#ally-pal .ally-pal-launch,#ally-pal .ally-pal-eye,#ally-pal .ally-pal-pupil{animation:none!important}#ally-pal .ally-pal-smile,#ally-pal .ally-pal-brow,#ally-pal .ally-pal-pupil{transition:none}}

/* Separate companion surfaces from the pale Hub background. */
#ally-pal .ally-pal-hello{background:#124c75;color:#fff;border:2px solid #73c9e7;box-shadow:0 8px 28px #0c355b45}
#ally-pal .ally-pal-hello button{color:#fff}
#ally-pal .ally-pal-panel{background:#d5eaf5;border:2px solid #4797bb;box-shadow:0 18px 65px #0c355b55}
#ally-pal .ally-pal-panel header{background:#b9dff0;border-bottom:1px solid #80b6ce}
#ally-pal .ally-pal-notice{color:#365b70}
#ally-pal .pal-answer{background:#edf6fc;border:1px solid #92b9d0}
#ally-pal .pal-you{background:#155783;color:#fff;border:1px solid #0f4469}
#ally-pal .ally-pal-form textarea{background:#eef8ff!important;border-color:#5b9bb9}
#ally-pal .ally-pal-form textarea:focus{background:#e4f4ff!important}

/* Compact mascot with a comfortable touch target. */
#ally-pal .ally-pal-launch{width:60px;height:60px;display:flex;align-items:center;justify-content:center}
#ally-pal .ally-pal-launch .ally-pal-body{transform:scale(.62);flex-shrink:0}
#ally-pal .ally-pal-panel header .ally-pal-body{transform:scale(.46);margin:-17px -17px}
#ally-pal .ally-pal-hello{bottom:76px}
#ally-pal .ally-pal-panel{bottom:76px}
@media(max-width:600px){#ally-pal .ally-pal-launch{width:54px;height:54px}#ally-pal .ally-pal-launch .ally-pal-body{transform:scale(.56)}#ally-pal .ally-pal-hello,#ally-pal .ally-pal-panel{bottom:68px}}

/* Soft grounding shadow for the expressive round companion. */
#ally-pal .ally-pal-body{box-shadow:inset 0 2px 3px #c7ffffa0,inset -3px -5px 8px #0080c245,0 7px 14px #0f3d6845}
#ally-pal[data-expression="listening"] .ally-pal-body{box-shadow:inset 0 2px 3px #c7ffffa0,0 0 0 5px #51dace30,0 7px 14px #0f3d6845}

.ally-pal-privacy{margin:0 18px 16px;font-size:11px;color:#365b70}.ally-pal-privacy summary{cursor:pointer;padding:6px 0}.ally-pal-privacy .ally-pal-notice{margin:6px 0}.ally-pal-thread:empty{display:none}

/* Thought-cloud greeting, connected to Ally with two small dots. */
#ally-pal .ally-pal-hello{border-radius:32px 36px 30px 34px;padding:17px 30px 17px 18px;overflow:visible}
#ally-pal .ally-pal-hello::before,#ally-pal .ally-pal-hello::after{content:"";position:absolute;background:#124c75;border:2px solid #73c9e7;border-radius:50%;box-shadow:0 3px 7px #0c355b25}
#ally-pal .ally-pal-hello::before{width:15px;height:12px;right:25px;bottom:-17px}
#ally-pal .ally-pal-hello::after{width:7px;height:7px;right:16px;bottom:-30px}
.ally-pal-encouragement{margin:7px 18px;padding:10px 12px;background:#e8f6fb;border-left:3px solid #31aabd;border-radius:10px;color:#24546e;font-size:11px;line-height:1.5}

/* A scalloped thought cloud instead of a pill-shaped speech bubble. */
#ally-pal .ally-pal-hello{width:280px;min-height:112px;box-sizing:border-box;padding:29px 37px 25px;background:transparent;border:0;border-radius:0;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20320%20140%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20d%3D%22M42%2030%20C34%2010%2072%202%2093%2015%20C106%201%20147%201%20163%2015%20C184%202%20220%203%20235%2018%20C262%205%20295%2018%20291%2037%20C315%2042%20325%2068%20305%2083%20C316%20106%20291%20124%20267%20118%20C256%20139%20218%20140%20200%20126%20C177%20141%20147%20139%20134%20125%20C108%20143%2075%20132%2067%20116%20C40%20130%2014%20109%2023%2090%20C-2%2082%202%2054%2024%2047%20C18%2033%2031%2024%2042%2030%20Z%22%20fill%3D%22%23124c75%22%20stroke%3D%22%2373c9e7%22%20stroke-width%3D%222%22%2F%3E%3C%2Fsvg%3E");background-size:100% 100%;background-repeat:no-repeat;box-shadow:none;filter:drop-shadow(0 5px 8px #0c355b38);bottom:84px;right:0}
#ally-pal .ally-pal-hello button{right:24px;top:18px;font-size:15px}
#ally-pal .ally-pal-hello::before{right:32px;bottom:-13px;width:14px;height:11px}
#ally-pal .ally-pal-hello::after{right:21px;bottom:-26px;width:7px;height:7px}
@media(max-width:600px){#ally-pal .ally-pal-hello{width:260px;max-width:calc(100vw - 28px);bottom:76px;padding:28px 33px 24px}}

/* Restore the original greeting bubble shape. */
#ally-pal .ally-pal-hello{width:240px;min-height:0;box-sizing:content-box;padding:16px 30px 16px 16px;background:#124c75;background-image:none;border:2px solid #73c9e7;border-radius:20px 20px 4px 20px;box-shadow:0 8px 28px #0c355b45;filter:none;bottom:76px;right:5px}
#ally-pal .ally-pal-hello::before,#ally-pal .ally-pal-hello::after{display:none}
#ally-pal .ally-pal-hello button{right:3px;top:3px;font-size:13px}
@media(max-width:600px){#ally-pal .ally-pal-hello{bottom:68px;width:240px;max-width:calc(100vw - 76px)}}

/* Keep the chat controls compact, especially on phones. */
#ally-pal .ally-pal-controls select,#ally-pal .ally-pal-record{display:none}
#ally-pal .ally-pal-controls{flex-wrap:nowrap;justify-content:flex-end;gap:8px}
#ally-pal .ally-pal-status:empty{display:none}
#ally-pal .ally-pal-form{padding-bottom:4px}
#ally-pal .ally-pal-clear{display:inline-block;vertical-align:middle;margin:4px 10px 10px 18px}
#ally-pal .ally-pal-privacy{display:inline-block;vertical-align:middle;margin:4px 18px 10px 0}
#ally-pal .ally-pal-privacy[open]{display:block;margin:0 18px 12px}
#ally-pal .ally-pal-privacy summary{padding:4px 0}

/* Full body Ally, compact and grounded with a soft shadow. */
#ally-pal .ally-pal-mascot{display:block;width:64px;height:54px;object-fit:contain;filter:drop-shadow(0 5px 4px #0f3d6845);transform-origin:center bottom}
#ally-pal .ally-pal-launch{width:68px;height:60px}
#ally-pal .ally-pal-panel header .ally-pal-mascot{width:42px;height:36px;flex-shrink:0}
#ally-pal[data-expression="listening"] .ally-pal-mascot{animation:pal-listen 1.8s ease-in-out infinite}
#ally-pal[data-expression="thinking"] .ally-pal-mascot{animation:pal-think 2.4s ease-in-out infinite}
#ally-pal[data-expression="concerned"] .ally-pal-mascot{transform:rotate(-5deg)}
@keyframes pal-listen{50%{transform:rotate(4deg)}}
@keyframes pal-think{0%,100%{transform:rotate(-4deg)}50%{transform:rotate(4deg) translateY(-2px)}}
@media(max-width:600px){#ally-pal .ally-pal-launch{width:60px;height:54px}#ally-pal .ally-pal-mascot{width:56px;height:47px}}
@media(prefers-reduced-motion:reduce){#ally-pal .ally-pal-mascot{animation:none!important;transform:none!important}}

/* Border-free companion surfaces; color and soft shadows define their edges. */
#ally-pal .ally-pal-hello,#ally-pal .ally-pal-panel,#ally-pal .pal-answer,#ally-pal .pal-you{border:0!important;outline:none!important}
#ally-pal .ally-pal-panel header{border:0!important}
#ally-pal .ally-pal-form textarea,#ally-pal .ally-pal-form textarea:focus,#ally-pal .ally-pal-form textarea:focus-visible{border:0!important;outline:none!important;box-shadow:none!important}

/* Anchor to the visible screen rather than an overflowing document. */
#ally-pal{right:auto;bottom:auto;width:0;height:0;max-width:none;z-index:80}
#ally-pal,#ally-pal *{box-sizing:border-box}
#ally-pal .ally-pal-launch{position:absolute;right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));width:60px;height:60px;min-width:60px;min-height:60px;margin:0;animation:none;touch-action:manipulation}
#ally-pal .ally-pal-mascot{width:56px;height:48px;max-width:100%;object-fit:contain}
#ally-pal .ally-pal-hello{right:max(16px,env(safe-area-inset-right));bottom:calc(max(16px,env(safe-area-inset-bottom)) + 72px);width:272px;max-width:calc(var(--pal-viewport-width,100vw) - 32px);padding:16px 48px 16px 16px;font-size:14px;line-height:1.5;overflow-wrap:anywhere;border-radius:18px 18px 6px 18px}
#ally-pal .ally-pal-hello button{width:44px;height:44px;min-width:44px;min-height:44px;right:0;top:0;margin:0;padding:0;font-size:20px;display:flex;align-items:center;justify-content:center}
#ally-pal .ally-pal-panel{right:max(16px,env(safe-area-inset-right));bottom:calc(max(16px,env(safe-area-inset-bottom)) + 72px);width:420px;max-width:calc(var(--pal-viewport-width,100vw) - 32px);max-height:calc(var(--pal-viewport-height,100dvh) - 104px - env(safe-area-inset-bottom));overflow:auto;overscroll-behavior:contain}
#ally-pal .ally-pal-close{min-width:44px;min-height:44px;flex-shrink:0}
#ally-pal .ally-pal-panel input,#ally-pal .ally-pal-panel textarea{font-size:16px}
@media(max-width:720px){
 #ally-pal .ally-pal-launch{width:56px;height:56px;min-width:56px;min-height:56px}
 #ally-pal .ally-pal-mascot{width:52px;height:44px}
 #ally-pal .ally-pal-panel{width:calc(var(--pal-viewport-width,100vw) - 32px);border-radius:20px}
 #ally-pal .ally-pal-hello{display:none}
 #ally-pal .ally-pal-thread{max-height:min(220px,28dvh)}
 .shell .main{padding-bottom:100px}
}

/* The same welcoming hug in the corner and panel. */
#ally-pal .ally-pal-launch .ally-pal-hug{width:60px;height:60px;max-width:none;filter:drop-shadow(0 3px 2px #063d4e30)}
#ally-pal .ally-pal-panel header .ally-pal-hug{width:64px;height:43px;max-width:none;flex-shrink:0;filter:none}
#ally-pal .ally-pal-panel header{background:linear-gradient(120deg,#d9f4f3,#d6edf7)}
#ally-pal[data-expression="happy"] .ally-pal-launch{animation:none}
@media(max-width:720px){#ally-pal .ally-pal-launch .ally-pal-hug{width:56px;height:56px}}

/* Playful, activity-driven motion with long resting pauses. */
#ally-pal .ally-pal-launch{isolation:isolate}
#ally-pal .ally-pal-launch .ally-pal-hug{transform-origin:50% 82%;animation:pal-curious 14s ease-in-out infinite}
#ally-pal .ally-pal-launch::before,#ally-pal .ally-pal-launch::after{content:"";position:absolute;pointer-events:none;opacity:0}
#ally-pal .ally-pal-launch::before{inset:6px;border:2px solid #28c9d0;border-radius:50%;z-index:-1}
#ally-pal[data-expression="welcome"] .ally-pal-hug{animation:pal-welcome .85s ease-out both}
#ally-pal[data-expression="welcome"] .ally-pal-hug{animation:pal-hug-hello 1s ease-out both}
#ally-pal[data-expression="listening"] .ally-pal-hug,#ally-pal[data-expression="listening"] .ally-pal-hug{animation:pal-attentive 2.4s ease-in-out infinite}
#ally-pal[data-expression="listening"] .ally-pal-launch::before{animation:pal-listen-ring 2s ease-out infinite}
#ally-pal[data-expression="thinking"] .ally-pal-hug,#ally-pal[data-expression="thinking"] .ally-pal-hug{animation:pal-ponder 3s ease-in-out infinite}
#ally-pal[data-expression="thinking"] .ally-pal-launch::after{content:"•••";right:4px;top:-9px;color:#08768b;font-size:15px;letter-spacing:2px;animation:pal-thought-dots 1.6s ease-in-out infinite}
#ally-pal[data-expression="happy"] .ally-pal-hug,#ally-pal[data-expression="happy"] .ally-pal-hug{animation:pal-cheer 1.1s ease-in-out 2}
#ally-pal[data-expression="happy"] .ally-pal-launch::after{content:"✦";right:0;top:-5px;color:#0b9bab;font-size:20px;animation:pal-sparkle 1.1s ease-out 2}
#ally-pal[data-expression="concerned"] .ally-pal-hug,#ally-pal[data-expression="concerned"] .ally-pal-hug{animation:pal-soft-tilt .7s ease-out both}
@media(hover:hover){#ally-pal[data-expression="idle"] .ally-pal-launch:hover .ally-pal-hug{animation:pal-boop .65s ease-in-out}}
#ally-pal .ally-pal-launch:active .ally-pal-hug{scale:.93}
@keyframes pal-curious{0%,76%,100%{transform:none}80%{transform:translateY(-3px) rotate(-7deg)}84%{transform:translateY(-4px) rotate(5deg)}88%{transform:translateY(0) scale(1.04,.96)}92%{transform:none}}
@keyframes pal-welcome{0%{transform:scale(1)}22%{transform:scale(1.08,.92)}55%{transform:translateY(-8px) rotate(-8deg) scale(.96,1.04)}80%{transform:scale(1.04,.96)}100%{transform:none}}
@keyframes pal-hug-hello{0%{transform:scale(.9) rotate(-8deg)}48%{transform:scale(1.1) rotate(6deg)}76%{transform:scale(.98) rotate(-3deg)}100%{transform:none}}
@keyframes pal-attentive{0%,100%{transform:rotate(-5deg)}50%{transform:translateY(-2px) rotate(-1deg) scale(1.025)}}
@keyframes pal-listen-ring{0%{opacity:.5;transform:scale(.9)}100%{opacity:0;transform:scale(1.32)}}
@keyframes pal-ponder{0%,100%{transform:rotate(-8deg)}45%{transform:translateY(-3px) rotate(6deg)}70%{transform:translateY(-1px) rotate(6deg)}}
@keyframes pal-thought-dots{0%,100%{opacity:.35;transform:translateY(0)}50%{opacity:.9;transform:translateY(-3px)}}
@keyframes pal-cheer{0%,100%{transform:none}18%{transform:scale(1.08,.92)}46%{transform:translateY(-9px) rotate(8deg) scale(.97,1.03)}75%{transform:scale(1.05,.95)}}
@keyframes pal-sparkle{0%,100%{opacity:0;transform:scale(.5)}45%{opacity:1;transform:translateY(-5px) rotate(20deg) scale(1)}}
@keyframes pal-soft-tilt{to{transform:rotate(-6deg)}}
@keyframes pal-boop{35%{transform:translateY(-5px) rotate(7deg)}70%{transform:rotate(-4deg)}100%{transform:none}}
@media(prefers-reduced-motion:reduce){
 #ally-pal .ally-pal-mascot,#ally-pal .ally-pal-launch,#ally-pal .ally-pal-launch::before,#ally-pal .ally-pal-launch::after{animation:none!important;transform:none!important;scale:1!important}
 #ally-pal .ally-pal-launch::before,#ally-pal .ally-pal-launch::after{display:none}
}


/* Layer the original artwork so the arms can wave around the smiling face. */
#ally-pal .ally-pal-hug{position:relative;display:block;overflow:visible;flex-shrink:0}
#ally-pal .ally-pal-launch .ally-pal-hug{width:80px;height:54px;max-width:none}
#ally-pal .ally-pal-panel header .ally-pal-hug{width:72px;height:48px}
#ally-pal .ally-hug-layer{position:absolute;inset:0;display:block;width:100%;height:100%;max-width:none;object-fit:contain;pointer-events:none;user-select:none}
#ally-pal .ally-hug-body{clip-path:polygon(0 0,100% 0,100% 29%,77% 29%,71% 55%,67% 76%,100% 89%,100% 100%,0 100%,0 89%,33% 76%,29% 55%,23% 29%,0 29%)}
#ally-pal .ally-hug-left{clip-path:polygon(0 29%,24% 29%,30% 55%,34% 77%,0 90%);transform-origin:33% 77%;animation:pal-left-arm 9s ease-in-out infinite}
#ally-pal .ally-hug-right{clip-path:polygon(76% 29%,100% 29%,100% 90%,66% 77%,70% 55%);transform-origin:67% 77%;animation:pal-right-arm 9s ease-in-out infinite}
#ally-pal[data-expression="welcome"] .ally-hug-layer,#ally-pal[data-expression="happy"] .ally-hug-layer{animation-duration:2s}
@media(hover:hover){#ally-pal .ally-pal-launch:hover .ally-hug-layer{animation-duration:2s}}
@keyframes pal-left-arm{0%,12%,100%{transform:rotate(0)}3%,9%{transform:rotate(9deg)}6%{transform:rotate(-5deg)}}
@keyframes pal-right-arm{0%,12%,100%{transform:rotate(0)}3%,9%{transform:rotate(-9deg)}6%{transform:rotate(5deg)}}
@media(prefers-reduced-motion:reduce){#ally-pal .ally-hug-layer{animation:none!important;transform:none!important}}

/* Encouragement belongs to Ally, in a small speech bubble. */
#ally-pal .ally-pal-hello{border-radius:20px 20px 4px 20px;background:#edfafa;color:#17495b}
#ally-pal .ally-pal-encouragement{position:relative;border:1px solid #a8dcd9;border-radius:16px 16px 16px 4px;background:#effaf8;padding:12px 14px;font-size:13px}
#ally-pal .ally-pal-encouragement small{font-weight:600;color:#237474}
#ally-pal .ally-pal-encouragement p{margin:8px 0;line-height:1.6}
#ally-pal .ally-pal-another{padding:5px 0;background:transparent;color:#175b69;border:0;text-decoration:underline;font:inherit;cursor:pointer}
#ally-pal[data-idle] .ally-pal-hello{display:block;max-width:calc(var(--pal-viewport-width,100vw) - 36px)}
#ally-pal[data-idle="dance"] .ally-pal-launch .ally-pal-hug{animation:pal-dance 1.2s ease-in-out infinite}
#ally-pal[data-idle="dance"] .ally-hug-left,#ally-pal[data-idle="dance"] .ally-hug-right{animation-duration:1.2s}
#ally-pal[data-idle="kiss"] .ally-pal-launch .ally-pal-hug{animation:pal-kiss 2s ease-in-out infinite}
#ally-pal[data-idle="kiss"] .ally-pal-launch::after{content:"♥";color:#d85d87;right:4px;top:2px;font-size:20px;animation:pal-kiss-heart 2s ease-out infinite}
#ally-pal[data-idle="hug"] .ally-pal-launch .ally-hug-left{animation:pal-self-hug-left 2.4s ease-in-out infinite}
#ally-pal[data-idle="hug"] .ally-pal-launch .ally-hug-right{animation:pal-self-hug-right 2.4s ease-in-out infinite}
#ally-pal[data-idle="hug"] .ally-pal-launch .ally-pal-hug{animation:pal-snuggle 2.4s ease-in-out infinite}
@keyframes pal-dance{0%,100%{transform:rotate(-9deg) translateY(0)}25%{transform:rotate(0) translateY(-7px)}50%{transform:rotate(9deg) translateY(0)}75%{transform:rotate(0) translateY(-7px)}}
@keyframes pal-kiss{0%,100%{transform:none}40%{transform:rotate(-7deg) scale(1.06)}65%{transform:rotate(5deg)}}
@keyframes pal-kiss-heart{0%{opacity:0;transform:translate(0,0) scale(.5)}30%{opacity:1}100%{opacity:0;transform:translate(-18px,-42px) scale(1.25)}}
@keyframes pal-self-hug-left{0%,100%{transform:none}35%,65%{transform:rotate(28deg)}}
@keyframes pal-self-hug-right{0%,100%{transform:none}35%,65%{transform:rotate(-28deg)}}
@keyframes pal-snuggle{0%,100%{transform:none}35%,65%{transform:scale(.97,1.03) rotate(-3deg)}}
@media(prefers-reduced-motion:reduce){#ally-pal[data-idle] .ally-hug-layer,#ally-pal[data-idle] .ally-pal-hug{animation:none!important;transform:none!important}#ally-pal[data-idle] .ally-pal-launch::after{display:none!important}}

/* Distinct teal speech and a steady composer, with one conversation scroll area. */
#ally-pal .ally-pal-hello,#ally-pal .ally-pal-encouragement{background:#b9eaf6;color:#123f59;border-color:#8bd3e7;box-shadow:0 6px 22px #124c6a26}
#ally-pal .ally-pal-hello button,#ally-pal .ally-pal-encouragement small,#ally-pal .ally-pal-another{color:#123f59}
#ally-pal .ally-pal-panel{display:flex;flex-direction:column;height:min(650px,calc(var(--pal-viewport-height,100dvh) - 104px - env(safe-area-inset-bottom)));overflow:hidden;background:#edf9f8}
#ally-pal .ally-pal-panel header{flex:0 0 auto;padding:12px 16px}
#ally-pal .ally-pal-content{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable}
#ally-pal .ally-pal-thread{max-height:none;overflow:visible}
#ally-pal .ally-pal-form{flex:0 0 auto;margin:0;padding:10px 16px 12px;background:#d9efed;border-top:1px solid #99c9c7}
#ally-pal .ally-pal-form textarea{display:block;height:64px;min-height:48px;max-height:100px;resize:none;margin:4px 0 6px;background:#fff;color:#183f60}
#ally-pal .ally-pal-form textarea:focus-visible{outline:2px solid #087e83!important;outline-offset:1px}
#ally-pal .ally-pal-key-hint{display:block;margin:0 0 6px;font-size:10px;color:#345963}
#ally-pal .ally-pal-controls{display:flex;position:static;align-items:center;gap:8px}
#ally-pal .ally-pal-controls button{min-height:40px}
#ally-pal .ally-pal-options{padding:6px 0 10px}
#ally-pal .ally-pal-status{margin-bottom:0}
@media(max-height:550px){
 #ally-pal .ally-pal-panel{bottom:12px;height:calc(var(--pal-viewport-height,100dvh) - 24px);max-height:calc(var(--pal-viewport-height,100dvh) - 24px)}
 #ally-pal .ally-pal-panel header{padding:6px 12px}
 #ally-pal .ally-pal-panel header .ally-pal-hug{width:54px;height:36px}
 #ally-pal .ally-pal-form{padding:6px 12px 8px}
 #ally-pal .ally-pal-form textarea{height:48px}
 #ally-pal .ally-pal-key-hint{display:none}
}

/* Fit the content instead of reserving an empty conversation area. */
#ally-pal .ally-pal-panel{height:auto;max-height:min(620px,calc(var(--pal-viewport-height,100dvh) - 104px - env(safe-area-inset-bottom)))}
#ally-pal .ally-pal-panel header{padding:10px 14px;gap:10px}
#ally-pal .ally-pal-panel header .ally-pal-hug{width:60px;height:40px}
#ally-pal .ally-pal-intro{padding:10px 14px 4px;font-size:13px}
#ally-pal .ally-pal-encouragement{margin:6px 14px;padding:10px 12px}
#ally-pal .ally-pal-shortcuts{padding:8px 14px;gap:6px}
#ally-pal .ally-pal-thread{padding:0 14px}
#ally-pal .ally-pal-thread article{margin:8px 0;padding:10px}
#ally-pal .ally-pal-options{padding:2px 0 6px}
#ally-pal .ally-pal-clear{margin:4px 8px 4px 14px}
#ally-pal .ally-pal-privacy{margin:4px 10px 4px 0}
#ally-pal .ally-pal-form{padding:8px 14px 10px}
#ally-pal .ally-pal-form textarea{height:48px;min-height:48px;max-height:48px}
#ally-pal .ally-pal-hello{width:230px;min-height:0;padding:12px 28px 12px 14px;line-height:1.45;right:max(16px,env(safe-area-inset-right));bottom:calc(max(16px,env(safe-area-inset-bottom)) + 62px);border-radius:16px}
#ally-pal .ally-pal-hello::before{display:none}
#ally-pal .ally-pal-hello::after{display:block;content:"";position:absolute;width:0;height:0;right:23px;bottom:-11px;border-left:7px solid transparent;border-right:7px solid transparent;border-top:12px solid #b9eaf6;border-bottom:0;border-radius:0;background:transparent;box-shadow:none}
@media(max-width:720px){#ally-pal .ally-pal-hello::after{right:21px}}
@media(max-height:550px){#ally-pal .ally-pal-panel{height:auto;max-height:calc(var(--pal-viewport-height,100dvh) - 24px);bottom:12px}}


/* Give the conversation space; secondary controls stay in one disclosure. */
#ally-pal .ally-pal-options{margin:4px 14px 8px;padding:0;font-size:12px;color:#345963}
#ally-pal .ally-pal-options>summary{cursor:pointer;padding:6px 0}
#ally-pal .ally-pal-options[open]{padding-bottom:8px}
#ally-pal .ally-pal-options label{display:flex;align-items:center;gap:8px;margin:8px 0}
#ally-pal .ally-pal-options select{display:block;width:auto;padding:5px 8px;font:inherit;border:1px solid #99c9c7;border-radius:8px;background:#fff}
#ally-pal .ally-pal-options button{padding:6px 10px;margin:4px 8px 4px 0;font:inherit}
#ally-pal .ally-pal-options .ally-pal-privacy{display:block;margin:8px 0 0}
#ally-pal .ally-pal-controls{justify-content:flex-end}
#ally-pal .ally-pal-encouragement{box-shadow:none;padding:8px 12px;font-size:12px}
#ally-pal .ally-pal-encouragement p{margin:4px 0}
#ally-pal .ally-pal-encouragement small{display:none}
#ally-pal .ally-pal-another{padding:2px 0;font-size:11px}
#ally-pal .ally-pal-live-consent:not([hidden]),#ally-pal .ally-pal-voice-consent:not([hidden]){margin:8px 14px;padding:12px;border-radius:12px;background:#fff;border:1px solid #99c9c7}

/* Greetings live beside Ally on every screen, never in the chat panel. */
#ally-pal .ally-pal-hello{display:block;box-sizing:border-box;max-width:calc(var(--pal-viewport-width,100vw) - 36px);padding-right:46px}

/* Match the soft blue card outlines, including the speech-bubble tail. */
#ally-pal .ally-pal-hello{border:1px solid #bdd7df!important;box-shadow:0 6px 22px #124c6a18}
#ally-pal .ally-pal-hello::before{display:block;content:"";position:absolute;width:0;height:0;right:22px;bottom:-13px;border-left:8px solid transparent;border-right:8px solid transparent;border-top:13px solid #bdd7df;border-bottom:0;border-radius:0;background:transparent;box-shadow:none}
#ally-pal .ally-pal-hello::after{bottom:-11px}
@media(max-width:720px){#ally-pal .ally-pal-hello::before{right:20px}}

/* A visible soft shadow for Ally’s invitation. */
#ally-pal .ally-pal-hello{box-shadow:0 9px 24px #124c6a2b,0 2px 6px #124c6a18}
#ally-pal .ally-pal-hello .ally-pal-hello-message{position:static;display:block;width:100%;height:auto;min-width:0;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:transparent;color:inherit;font:inherit;line-height:inherit;text-align:left;cursor:pointer}
#ally-pal .ally-pal-tour{padding:18px;overflow-y:auto;min-height:0;overscroll-behavior:contain}
#ally-pal .ally-pal-tour-progress{font-size:11px;font-weight:600;color:#32616d;margin:0 0 10px}
#ally-pal .ally-pal-tour h2{font-size:22px;line-height:1.25;color:#123f59;margin:0 0 12px}
#ally-pal .ally-pal-tour-copy{font-size:15px;line-height:1.65;margin:0 0 20px}
#ally-pal .ally-pal-tour-actions{display:flex;justify-content:space-between;gap:10px}
#ally-pal .ally-pal-tour button{min-height:44px;padding:10px 16px;font:inherit;font-size:13px}
#ally-pal .ally-pal-tour-back,#ally-pal .ally-pal-tour-skip{background:transparent;color:#215469;border:1px solid #bdd7df}
#ally-pal .ally-pal-tour-skip{display:block;margin:12px 0 0 auto}
#ally-pal .ally-pal-tour button:disabled{opacity:.5;cursor:default}
#ally-pal .ally-pal-tour-error{font-size:12px;color:#8a3544}
#ally-pal .ally-pal-tour-error:empty{display:none}

/* Keep the real page visible while Ally guides the visit. */
#ally-pal[data-tour="active"] .ally-pal-panel{width:360px;max-height:min(390px,calc(var(--pal-viewport-height,100dvh) - 104px))}
#ally-pal[data-tour="active"] .ally-pal-panel header{padding:8px 12px}
#ally-pal[data-tour="active"] .ally-pal-panel header small{display:none}
#ally-pal[data-tour="active"] .ally-pal-tour{padding:12px 16px}
#ally-pal[data-tour="active"] .ally-pal-tour h2{font-size:19px}
#ally-pal[data-tour="active"] .ally-pal-tour-copy{font-size:13px;line-height:1.5;margin-bottom:12px}
.ally-tour-highlight{outline:2px solid #61b9c8;outline-offset:6px;border-radius:6px;background:#e5f7f7}
@media(max-width:720px){#ally-pal[data-tour="active"] .ally-pal-panel{max-height:45dvh}}

/* Carry the Hub navy from Ally’s greeting into the opened companion. */
#ally-pal{--pal-navy:#073f59}
#ally-pal .ally-pal-hello{background:var(--pal-navy);color:#fff}
#ally-pal .ally-pal-hello button{color:#fff}
#ally-pal .ally-pal-hello::after{border-top-color:var(--pal-navy)}
#ally-pal .ally-pal-panel header{background:var(--pal-navy);color:#fff}
#ally-pal .ally-pal-panel header strong{color:#fff}
#ally-pal .ally-pal-panel header small{color:#d7edf3}
#ally-pal .ally-pal-close{color:#fff!important}
#ally-pal .ally-pal-send,#ally-pal .ally-pal-tour-next{background:var(--pal-navy);color:#fff}

/* A small cartoon flinch only on an intentional tap over the open menu. */
/* Personality lives in the small speech bubble, not a second dashboard. */
#ally-pal .ally-pal-hello{width:280px;max-width:calc(var(--pal-viewport-width,100vw) - 32px);padding:14px 36px 12px 14px;font-size:13px;line-height:1.55;overflow-wrap:anywhere}
#ally-pal .ally-pal-bubble-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}
#ally-pal .ally-pal-hello .ally-pal-bubble-actions button{position:static;width:auto;height:auto;min-height:44px;padding:7px 10px;border:1px solid #8eb8c8;border-radius:12px;background:#e9f6fa;color:#073f59;font-size:12px;line-height:1.35}
#ally-pal .ally-pal-bubble-actions button:last-child{background:transparent;color:#e8f6fa;border-color:#7299ac}
#ally-pal .ally-pal-fun-setting{display:flex;align-items:flex-start;gap:8px;margin:10px 0;font-size:12px;line-height:1.5}
#ally-pal .ally-pal-fun-setting input{width:20px;height:20px;flex:0 0 20px;margin:0}
#ally-pal[data-idle="wave"] .ally-hug-right{animation:pal-fun-wave .8s ease-in-out 5;transform-origin:50% 80%}
#ally-pal[data-idle="peek"] .ally-pal-launch .ally-pal-hug{animation:pal-fun-peek 2s ease-in-out 2}
#ally-pal .ally-pal-confetti{position:absolute;right:5px;bottom:25px;width:90px;height:110px;pointer-events:none;overflow:visible}
#ally-pal .ally-pal-confetti i{position:absolute;left:45%;top:40%;width:7px;height:9px;border-radius:2px;background:#20bcb6;animation:pal-fun-confetti 2s ease-out both;--angle:calc(var(--i)*30deg)}
#ally-pal .ally-pal-confetti i:nth-child(3n){background:#edb953}
#ally-pal .ally-pal-confetti i:nth-child(3n + 1){background:#76a8d0}
@keyframes pal-fun-wave{50%{transform:rotate(-18deg) translateY(-5px)}}
@keyframes pal-fun-peek{50%{transform:translateX(-12px) rotate(-12deg)}}
@keyframes pal-fun-confetti{0%{opacity:1;transform:rotate(var(--angle)) translateY(0)}100%{opacity:0;transform:rotate(var(--angle)) translateY(-80px) rotate(180deg)}}
@media(prefers-reduced-motion:reduce){
 #ally-pal[data-idle="wave"] .ally-hug-right,#ally-pal[data-idle="peek"] .ally-pal-hug{animation:none!important}
 #ally-pal .ally-pal-confetti{display:none!important}
}
#ally-pal[data-menu-reaction="ouch"] .ally-pal-launch .ally-pal-hug{animation:pal-menu-ouch .6s ease-out!important;transform-origin:50% 85%}
@keyframes pal-menu-ouch{
 0%,100%{transform:translateY(0) rotate(0) scale(1)}
 18%{transform:translateY(3px) rotate(-10deg) scale(1.1,.85)}
 42%{transform:translateY(-8px) rotate(9deg) scale(.94,1.08)}
 68%{transform:translateY(0) rotate(-5deg) scale(1.03,.97)}
}
@media(prefers-reduced-motion:reduce){
 #ally-pal[data-menu-reaction="ouch"] .ally-pal-launch .ally-pal-hug{animation:none!important;filter:brightness(1.12)}
}


/* Keep pointer taps transparent; show a round focus ring only for keyboard use. */
#ally-pal .ally-pal-launch{border-radius:50%;-webkit-tap-highlight-color:transparent}
#ally-pal .ally-pal-launch:focus,#ally-pal .ally-pal-launch:active{background:transparent!important;box-shadow:none!important;outline:none!important}
#ally-pal .ally-pal-launch:focus-visible{outline:2px solid #dfaa43!important;outline-offset:4px}

/* Full menu presentation, with compact controls that remain usable on phones. */
#ally-pal .ally-pal-controls .ally-pal-tour-replay{display:inline-flex;align-items:center;width:auto;min-height:44px;margin:0 auto 0 0;padding:4px 0;background:transparent;color:#345963;border:0;border-radius:4px;box-shadow:none;font:inherit;font-size:12px;font-weight:400;line-height:1.4;text-align:left;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
#ally-pal .ally-pal-controls .ally-pal-tour-replay:hover{color:#073f59;background:transparent}
#ally-pal .ally-pal-send{flex-shrink:0}
#ally-pal[data-tour="active"] .ally-pal-panel{width:390px;max-height:min(610px,calc(var(--pal-viewport-height,100dvh) - 104px))}
#ally-pal .ally-pal-tour-picker{display:grid;gap:5px;font-size:11px;color:#32616d;margin-bottom:14px}
#ally-pal .ally-pal-tour-picker select{width:100%;min-height:38px;padding:7px 9px;border:1px solid #bdd7df;border-radius:9px;background:#f5fbfc;color:#123f59;font:inherit;font-size:12px}
#ally-pal .ally-pal-tour-tools{display:flex;gap:8px;margin:12px 0}
#ally-pal .ally-pal-tour-tools button{flex:1;background:#edf7f8;color:#123f59;border:1px solid #bdd7df;padding:8px;min-height:40px}
#ally-pal .ally-pal-tour-tools button[aria-pressed="true"]{background:#d2f0ed;border-color:#52a99e}
#workspace-navigation .ally-tour-highlight{outline:3px solid #7bd9ca;outline-offset:-3px;background:#ffffff24;border-radius:10px}
@media(max-width:720px){#ally-pal[data-tour="active"] .ally-pal-panel{max-height:60dvh}#ally-pal .ally-pal-tour-picker{margin-bottom:8px}#ally-pal .ally-pal-tour-copy{font-size:13px}}
