.ai-panel {
  min-height: 65dvh;
}
.nav .ai-orb {
  position: relative;
  isolation: isolate;
  overflow: visible;
  background: radial-gradient(
    circle at 32% 22%,
    #62e8b1,
    #0cad76 50%,
    #087868 100%
  );
  box-shadow:
    inset 0 1px 3px #d5fff280,
    0 4px 15px #0bbf7938;
}
.nav .ai-orb::before,
.nav .ai-orb::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: -3px;
  border-radius: 50%;
  z-index: -1;
  background: conic-gradient(
    from 0deg,
    #69f2a5,
    #58c9ed,
    #afa4ff,
    #ffcd9d,
    #68eaaa,
    #69f2a5
  );
  animation: orb-flow 7s linear infinite;
  filter: blur(3px);
  opacity: 0.72;
}
.nav .ai-orb::before {
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 6px),
    #000 calc(100% - 4px)
  );
}
.nav .ai-orb::after {
  inset: 3px;
  opacity: 0.25;
  filter: blur(4px);
  animation: orb-flow 10s linear infinite reverse;
}
.nav .ai-orb-label {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: 19px;
  font-weight: 750;
  text-shadow: 0 1px 4px #07513e90;
}
.nav button[aria-expanded="true"] .ai-orb {
  box-shadow:
    0 0 0 5px #39d68a12,
    0 5px 18px #18c08b50;
}
.nav .ai-orb.is-thinking::before {
  animation:
    orb-flow 2.2s linear infinite,
    orb-breathe 1.7s ease-in-out infinite;
  opacity: 0.9;
}
.nav .ai-orb.is-thinking::after {
  animation-duration: 2.8s;
}
@keyframes orb-flow {
  to {
    transform: rotate(360deg);
  }
}
@keyframes orb-breathe {
  50% {
    scale: 1.12;
    filter: blur(5px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .nav .ai-orb::before,
  .nav .ai-orb::after {
    animation: none !important;
  }
}
.ai-panel .chat > :last-child {
  scroll-margin-bottom: 180px;
}
.ai-mascot {
  display: inline-block;
  width: 150px;
  line-height: 0;
}
.ai-mascot svg {
  width: 100%;
  overflow: visible;
}
.chat-intro > .ai-mascot {
  width: 176px;
  margin: 0 auto 6px;
}
.ai-mascot .mascot-body {
  transform-origin: 84px 115px;
}
.ai-mascot .mascot-head {
  transform-origin: 84px 102px;
}
.ai-mascot .mascot-eyes {
  transform-origin: 87px 75px;
}
.ai-mascot .mascot-sprout {
  transform-origin: 78px 40px;
}
.ai-mascot .mascot-wing.left {
  transform-origin: 57px 98px;
}
.ai-mascot .mascot-wing.right {
  transform-origin: 112px 97px;
}
.ai-mascot .mascot-hand {
  transform-origin: 111px 113px;
}
.ai-mascot .mascot-shadow {
  transform-origin: 83px 151px;
}
.ai-mascot .mascot-thoughts,
.ai-mascot .mascot-hand {
  opacity: 0;
}
.ai-mascot.idle .mascot-body {
  animation: mascot-breathe 4.5s ease-in-out infinite;
}
.ai-mascot.idle .mascot-eyes {
  animation: mascot-blink 5.8s infinite;
}
.ai-mascot.idle .mascot-wing.right {
  animation: mascot-wave 7s ease-in-out infinite;
}
.ai-mascot.thinking .mascot-body {
  animation: mascot-think 3.6s ease-in-out infinite;
}
.ai-mascot.thinking .mascot-head {
  animation: mascot-tilt 3.6s ease-in-out infinite;
}
.ai-mascot.thinking .mascot-eyes {
  animation:
    mascot-blink 3.6s infinite,
    mascot-glance 3.6s ease-in-out infinite;
}
.ai-mascot.thinking .mascot-sprout {
  animation: mascot-sprout 3.6s ease-in-out infinite;
}
.ai-mascot.thinking .mascot-wing.left {
  animation: mascot-flutter 3.6s ease-in-out infinite;
}
.ai-mascot.thinking .mascot-hand {
  opacity: 1;
  animation: mascot-chin 3.6s ease-in-out infinite;
}
.ai-mascot.thinking .mascot-thoughts {
  opacity: 1;
}
.ai-mascot.thinking .thought {
  animation: mascot-bubble 2.4s ease-in-out infinite;
}
.ai-mascot.thinking .thought.two {
  animation-delay: 0.22s;
}
.ai-mascot.thinking .thought.three {
  animation-delay: 0.44s;
}
.ai-mascot.thinking .mascot-shadow {
  animation: mascot-shadow 3.6s ease-in-out infinite;
}
.ai-mascot.thinking .mascot-spark {
  animation: mascot-bubble 3.6s ease-in-out infinite;
}
.ai-thinking {
  display: flex;
  align-items: center;
  gap: 2px;
  align-self: flex-start;
  padding: 2px 14px 2px 0;
  border-radius: 22px;
  background: var(--surface-ffffff, #fff);
  border: 1px solid var(--line);
  max-width: 100%;
}
.ai-thinking .ai-mascot {
  width: 112px;
  flex-shrink: 0;
}
.ai-thinking-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  line-height: 1.5;
}
.ai-thinking-copy strong {
  font-size: 14px;
  color: var(--ink);
}
.ai-thinking-copy > span {
  font-size: 11px;
  color: var(--text-52755e, #52755e);
}
.thinking-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 5px;
}
.thinking-dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  animation: mascot-dot 1.4s ease-in-out infinite;
}
.thinking-dots i:nth-child(2) {
  animation-delay: 0.16s;
}
.thinking-dots i:nth-child(3) {
  animation-delay: 0.32s;
}
.ai-answer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.ai-answer > .ai-mascot {
  width: 43px;
  margin-left: 3px;
}
.ai-answer .bubble {
  max-width: 100%;
}
.ai-closing {
  overflow: clip;
}
@keyframes mascot-breathe {
  50% {
    transform: translateY(-3px) rotate(1deg);
  }
}
@keyframes mascot-blink {
  0%,
  36%,
  42%,
  76%,
  82%,
  100% {
    scale: 1 1;
  }
  39%,
  79% {
    scale: 1 0.12;
  }
}
@keyframes mascot-wave {
  0%,
  70%,
  100% {
    rotate: 0deg;
  }
  76%,
  88% {
    rotate: -18deg;
  }
  82%,
  94% {
    rotate: -6deg;
  }
}
@keyframes mascot-think {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  35%,
  65% {
    transform: translateY(-5px) rotate(3deg);
  }
}
@keyframes mascot-tilt {
  0%,
  100% {
    rotate: -3deg;
  }
  35%,
  65% {
    rotate: 5deg;
  }
}
@keyframes mascot-glance {
  0%,
  100% {
    translate: 0 0;
  }
  28%,
  68% {
    translate: 2px -2px;
  }
}
@keyframes mascot-sprout {
  0%,
  70%,
  100% {
    rotate: 0deg;
  }
  26%,
  50% {
    rotate: -9deg;
  }
  38%,
  62% {
    rotate: 5deg;
  }
}
@keyframes mascot-flutter {
  0%,
  28%,
  65%,
  100% {
    rotate: 0deg;
  }
  37%,
  53% {
    rotate: 12deg;
  }
  45% {
    rotate: -4deg;
  }
}
@keyframes mascot-chin {
  0%,
  100% {
    rotate: 0deg;
  }
  35%,
  65% {
    rotate: 6deg;
  }
}
@keyframes mascot-bubble {
  0%,
  100% {
    opacity: 0.3;
    translate: 0 2px;
  }
  45%,
  65% {
    opacity: 1;
    translate: 0 -2px;
  }
}
@keyframes mascot-shadow {
  35%,
  65% {
    scale: 0.85 1;
    opacity: 0.07;
  }
}
@keyframes mascot-dot {
  0%,
  65%,
  100% {
    opacity: 0.3;
    translate: 0 0;
  }
  32% {
    opacity: 1;
    translate: 0 -3px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ai-mascot *,
  .thinking-dots i {
    animation: none !important;
  }
}
