/* Companion motion uses transforms/opacity only; content and transport remain independent. */
.assistant-launcher {z-index:125;display:flex;flex-direction:column;gap:0;padding:6px 8px;border:0;border-radius:14px;background:transparent;color:#245a49;box-shadow:none;touch-action:none;user-select:none;-webkit-user-select:none}
.assistant-launcher::before {display:none}
.assistant-launcher-label {padding:0 2px;color:#245a49;background:transparent;border:0;box-shadow:none;font-size:13px;font-weight:600;line-height:1.6}
.assistant-launcher[aria-expanded=true] .assistant-launcher-label {display:none}
.assistant-launcher:focus-visible {outline:2px solid #8b6339;outline-offset:3px}
.assistant-mascot-float {position:relative;display:block;width:112px;height:96px;isolation:isolate;animation:companion-hover 5.2s ease-in-out infinite}
.assistant-mascot-gesture {position:relative;display:block;width:100%;height:100%;transform:perspective(300px) rotateY(var(--companion-look-x,0deg)) rotateX(var(--companion-look-y,0deg));transition:transform .3s ease}
.companion-pose-out {position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;animation:companion-pose-out .24s ease-out both}
.assistant-launcher .assistant-mascot {display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;transform-origin:50% 70%;animation:companion-ready 10s ease-in-out infinite}
.companion-effects {position:absolute;inset:0;pointer-events:none}
.companion-aura {position:absolute;inset:12% 5% 8%;border-radius:50%;background:radial-gradient(ellipse,#e7eee08c 0%,#e7eee000 72%);z-index:-1;animation:companion-aura 5.2s ease-in-out infinite}
.companion-particle {position:absolute;width:4px;height:4px;background:#d39a46;border-radius:50%;opacity:.65;animation:companion-particle 7s ease-in-out infinite}
.companion-particle-one {left:12%;top:62%}
.companion-particle-two {right:10%;top:44%;width:3px;height:3px;animation-delay:-3.5s;background:#71947b}
.companion-dots {position:absolute;right:1%;top:4%;display:none;height:12px}
.companion-dots i {display:block}
.companion-bulb {display:none;position:absolute;left:7%;top:0;width:19px;height:24px;transform-origin:50% 100%}
.companion-bulb svg {width:100%;height:100%;overflow:visible;stroke:#b2782e;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.companion-bulb-glass {fill:#ffe3a0;fill-opacity:.9}
.companion-bulb-rays {stroke:#dfad57}
.companion-spark {display:none;position:absolute;color:#d4a24c;font-size:16px;line-height:1}
.companion-spark-one {left:8%;top:20%}
.companion-spark-two {right:4%;top:16%;font-size:11px;animation-delay:.45s}
.assistant-launcher[data-companion-state=thinking] .assistant-mascot {animation:companion-think 4.8s ease-in-out infinite}
.assistant-launcher[data-companion-state=thinking] .companion-aura {background:radial-gradient(ellipse,#f1dca545 0%,#f1dca500 72%)}
.assistant-launcher[data-companion-state=found] .assistant-mascot {animation:companion-header 8s ease-in-out infinite}
.companion-symbol {position:absolute;top:1%;right:1%;width:22px;height:22px;color:#789b80;opacity:0;transform:translateY(3px) scale(.85);transition:opacity .22s ease,transform .22s ease}
.companion-symbol svg {display:block;width:100%;height:100%;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.companion-dots {display:flex;opacity:0;transition:opacity .22s ease}
.assistant-launcher:is([data-companion-stage=understanding],[data-companion-stage=waiting]) .companion-dots {opacity:1}
.assistant-launcher[data-companion-stage=attentive] .companion-attention,
.assistant-launcher[data-companion-stage=listening] .companion-listen,
.assistant-launcher[data-companion-stage=searching] .companion-search,
.assistant-launcher[data-companion-stage=writing] .companion-write,
.assistant-launcher[data-companion-stage=checking] .companion-check,
.assistant-launcher[data-companion-stage=paused] .companion-pause,
.assistant-launcher[data-companion-stage=reconnecting] .companion-signal,
.assistant-launcher[data-companion-stage=error] .companion-error {opacity:1;transform:translateY(0) scale(1)}
.assistant-launcher[data-companion-stage=attentive] .assistant-mascot {animation:companion-attentive 4s ease-in-out infinite}
.assistant-launcher[data-companion-stage=listening] .companion-listen svg {animation:companion-listen 1.2s ease-in-out infinite}
.assistant-launcher[data-companion-stage=searching] .companion-search svg {animation:companion-search 3s ease-in-out infinite}
.assistant-launcher[data-companion-stage=searching] .assistant-mascot {animation:companion-search-body 5s ease-in-out infinite}
.assistant-launcher[data-companion-stage=writing] .companion-write svg {animation:companion-write 1.8s ease-in-out infinite}
.assistant-launcher[data-companion-stage=writing] .assistant-mascot {animation:companion-nod 3s ease-in-out infinite}
.assistant-launcher[data-companion-stage=checking] .companion-scan {animation:companion-scan 2.8s ease-in-out infinite}
.assistant-launcher:is([data-companion-stage=waiting],[data-companion-stage=reconnecting]) .assistant-mascot {animation:companion-header 8s ease-in-out infinite}
.assistant-launcher[data-companion-stage=reconnecting] .companion-signal svg {animation:companion-signal 2.4s ease-in-out infinite}
.assistant-launcher:is([data-companion-stage=paused],[data-companion-stage=error]) .companion-particle {opacity:0;animation:none}
.assistant-launcher[data-companion-stage=error] .assistant-mascot {animation:companion-header 10s ease-in-out infinite}
.companion-error,.companion-signal {color:#a17b4c}
.assistant-launcher[data-celebrating=true] .companion-bulb {display:flex;animation:companion-idea-once 2.4s ease both}
.assistant-launcher[data-celebrating=true] .companion-bulb-rays {animation:companion-rays 2.4s ease both}
.assistant-launcher[data-celebrating=true] .companion-spark {display:flex;animation:companion-idea-once 2.1s ease both}
.assistant-launcher[data-celebrating=true] .assistant-mascot {animation:companion-celebrate 2.4s ease both}
.assistant-launcher:active:not([data-dragging=true]) .assistant-mascot-gesture {transform:scale(.96);transition-duration:.1s}
.assistant-launcher[data-dragging=true] {cursor:grabbing}
.assistant-launcher[data-dragging=true] *,
.assistant-launcher[data-motion-paused=true] *,
#toolkit-assistant[data-companion-motion-paused=true] .assistant-brand-mascot {animation-play-state:paused!important}
#toolkit-assistant .assistant-brand {display:flex;align-items:center;gap:8px}
#toolkit-assistant .assistant-brand-mascot {display:block;flex:none;width:44px;height:38px;object-fit:contain;animation:companion-header 8s ease-in-out infinite}
#toolkit-assistant[data-companion-state=thinking] .assistant-brand-mascot {animation:companion-think 4.8s ease-in-out infinite}
#toolkit-assistant[data-celebrating=true] .assistant-brand-mascot {animation:companion-header-found 2.4s ease both}
@media(hover:hover) and (pointer:fine) {
  .assistant-launcher:hover .companion-aura {background:radial-gradient(ellipse,#d9e7cebb 0%,#d9e7ce00 72%)}
  .assistant-launcher:hover .companion-particle {animation-duration:4s}
  .assistant-launcher:hover .assistant-mascot-float {animation-duration:3.8s}
}
@keyframes companion-hover {0%,100% {transform:translateY(0)} 50% {transform:translateY(-5px)}}
@keyframes companion-pose-out {from {opacity:1} to {opacity:0}}
@keyframes companion-attentive {0%,100% {transform:rotate(-2deg)} 50% {transform:rotate(1deg) translateY(-2px)}}
@keyframes companion-listen {0%,100% {transform:scaleY(.7)} 50% {transform:scaleY(1)}}
@keyframes companion-search {0%,100% {transform:translate(0,0)} 33% {transform:translate(-3px,2px)} 66% {transform:translate(2px,-1px)}}
@keyframes companion-search-body {0%,100% {transform:rotate(-3deg)} 50% {transform:rotate(3deg)}}
@keyframes companion-write {0%,100% {transform:translateX(-2px);opacity:.5} 50% {transform:translateX(1px);opacity:1}}
@keyframes companion-nod {0%,100% {transform:rotate(0)} 45% {transform:translateY(2px) rotate(2deg)} 65% {transform:translateY(-1px)}}
@keyframes companion-scan {0%,100% {transform:translateY(-1px);opacity:.5} 50% {transform:translateY(2px);opacity:1}}
@keyframes companion-signal {0%,100% {opacity:.4} 50% {opacity:1}}
@keyframes companion-idea-once {0% {opacity:0;transform:translateY(4px) scale(.65)} 20%,65% {opacity:1;transform:translateY(-3px) scale(1)} 100% {opacity:0;transform:translateY(-5px) scale(.9)}}
@keyframes companion-ready {0%,28%,100% {transform:rotate(0) scale(1)} 40% {transform:rotate(-4deg) scale(1.02)} 51% {transform:rotate(3deg) scale(1.015)} 60% {transform:rotate(-1.5deg)} 73% {transform:rotate(0) scale(1)}}
@keyframes companion-think {0%,100% {transform:rotate(-2deg) translateY(0)} 35% {transform:rotate(3deg) translateY(-2px)} 68% {transform:rotate(-1deg) translateY(0)}}
@keyframes companion-celebrate {0%,10%,100% {transform:translateY(0) rotate(0)} 20% {transform:translateY(-5px) rotate(-3deg)} 29% {transform:translateY(1px) rotate(2deg)} 38% {transform:translateY(-2px) rotate(-1deg)} 49% {transform:translateY(0) rotate(0)}}
@keyframes companion-aura {0%,100% {transform:scale(.91);opacity:.5} 50% {transform:scale(1.06);opacity:.9}}
@keyframes companion-particle {0%,100% {transform:translate(0,0) scale(.7);opacity:.2} 35% {transform:translate(4px,-7px) scale(1);opacity:.7} 70% {transform:translate(-3px,-3px) scale(.8);opacity:.45}}
@keyframes companion-rays {0%,25%,100% {opacity:.15;transform:scale(.9);transform-origin:16px 12px} 50%,70% {opacity:.9;transform:scale(1)}}
@keyframes companion-header {0%,45%,100% {transform:translateY(0) rotate(0)} 60% {transform:translateY(-1px) rotate(-4deg)} 75% {transform:translateY(0) rotate(2deg)}}
@keyframes companion-header-found {0%,15%,60%,100% {transform:translateY(0)} 30% {transform:translateY(-2px)} 43% {transform:translateY(1px)}}
@media(max-width:640px) {
  .assistant-mascot-float {width:88px;height:76px}
  .assistant-launcher[aria-expanded=true] .assistant-mascot-float {width:72px;height:64px}
  .companion-bulb {width:15px;height:19px}
  .companion-dots {top:0}
}
@media(prefers-reduced-motion:reduce) {
  .assistant-launcher *,#toolkit-assistant .assistant-brand-mascot {animation:none!important;transition:none!important}
  .assistant-mascot-gesture {transform:none!important}
  .companion-dots i {opacity:.7}
  .companion-particle,.companion-spark {display:none!important}
}

/* Closed: the companion is the invitation. Larger, lifted off any background, with a clear "Ask me" tag.
   Open: the panel header carries its own copy, so the floating one is not shown. */
.assistant-launcher[aria-expanded=true] {display:none}
.assistant-launcher {align-items:center;gap:0;padding:4px 6px}
.assistant-launcher .assistant-mascot-float {width:140px;height:120px}
.assistant-launcher .assistant-mascot-float::before {content:"";position:absolute;inset:6% 2% 2%;border-radius:50%;background:radial-gradient(ellipse,#fffffff2 0%,#ffffffb8 45%,#ffffff00 72%);z-index:-2}
.assistant-launcher .assistant-mascot {filter:drop-shadow(0 6px 9px #0b2a2e66)}
.assistant-launcher-label {margin-top:-12px;padding:7px 18px;border-radius:999px;background:#103c43;color:#fff;border:1px solid #ffffffb3;box-shadow:0 6px 18px #0b2a2e59;font-size:15px;font-weight:700;letter-spacing:.01em;white-space:nowrap;transition:background .2s ease,transform .2s ease}
.assistant-launcher:hover .assistant-launcher-label {background:#1f6f78;transform:translateY(-1px)}
.assistant-launcher:focus-visible .assistant-launcher-label {outline:3px solid #d96a12;outline-offset:2px}
@media(max-width:640px){
  .assistant-launcher .assistant-mascot-float {width:96px;height:83px}
  .assistant-launcher-label {font-size:13px;padding:5px 14px}
}
/* Shared-phrase prompt */
.assistant-phrase {width:min(440px,calc(100vw - 32px));padding:28px 28px 24px;border:1px solid #d7ddd3;border-radius:14px;background:#fdfcf8;color:#1e3a33;box-shadow:0 18px 50px #0b2a2e55;font:inherit;font-size:14px;line-height:1.55}
.assistant-phrase::backdrop {background:#0b2a2e99}
.assistant-phrase h2 {margin:0 0 8px;font-size:20px;line-height:1.25;color:#103c43;padding-right:28px}
.assistant-phrase-lead {margin:0 0 18px;color:#3d5a52}
.assistant-phrase label {display:block;margin:0 0 6px;font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#5a6e66}
.assistant-phrase input {display:block;width:100%;box-sizing:border-box;margin:0 0 6px;padding:11px 12px;font:inherit;font-size:16px;color:#1e3a33;background:#fff;border:1px solid #a9b7b0;border-radius:8px}
.assistant-phrase input:focus-visible {outline:3px solid #d96a12;outline-offset:1px;border-color:#103c43}
.assistant-phrase-hint {margin:0 0 14px;font-size:12px;color:#5a6e66}
.assistant-phrase-error {margin:0 0 14px;padding:9px 12px;border:1px solid #f0cfa8;border-radius:8px;background:#fdf0e1;color:#7a3a05}
.assistant-phrase-error[hidden],.assistant-phrase-full[hidden] {display:none}
.assistant-phrase-actions {display:flex;gap:10px;flex-wrap:wrap}
.assistant-phrase button {font:inherit;font-weight:700;min-height:44px;padding:10px 20px;border-radius:8px;cursor:pointer}
.assistant-phrase-submit {color:#fff;background:#103c43;border:1px solid #103c43}
.assistant-phrase-submit:hover:not(:disabled) {background:#1f6f78;border-color:#1f6f78}
.assistant-phrase-submit:disabled {opacity:.7;cursor:progress}
.assistant-phrase-cancel {color:#103c43;background:transparent;border:1px solid #a9b7b0}
.assistant-phrase button:focus-visible,.assistant-phrase-full:focus-visible {outline:3px solid #d96a12;outline-offset:2px}
.assistant-phrase-x {position:absolute;top:10px;right:10px;min-height:36px!important;width:36px;padding:0!important;font-size:22px!important;line-height:1;color:#5a6e66;background:transparent;border:0!important}
.assistant-phrase-full {display:inline-block;margin-top:12px;color:#1f6f78;font-size:13px}

/* Placement: tucked into the bottom-right corner, where pages keep their margin, and a size that
   shrinks with the window so it covers as little of the page as possible. */
.assistant-launcher {right: 14px; bottom: 14px}
@media(max-width:1500px),(max-height:820px){
  .assistant-launcher .assistant-mascot-float {width:112px;height:96px}
  .assistant-launcher-label {font-size:14px;padding:6px 15px;margin-top:-10px}
}
@media(max-width:640px){.assistant-launcher {right: 8px; bottom: 8px}}
