.sm-companion {
  position: fixed;
  right: clamp(14px, 1.35vw, 26px);
  bottom: clamp(12px, 1.35vw, 24px);
  z-index: 880;
  display: grid;
  justify-items: end;
  gap: 10px;
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  pointer-events: none;
}

.sm-companion-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(82px, 6vw, 104px);
  height: clamp(86px, 6.3vw, 110px);
  filter: drop-shadow(0 12px 14px rgba(10, 21, 31, .12));
}

.sm-companion-robot {
  position: absolute;
  inset: 0;
  display: block;
  transform: scale(1.18);
  transform-origin: center bottom;
}

.sm-companion-robot-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  user-select: none;
}

.sm-companion-robot-body {
  clip-path: polygon(0 0, 100% 0, 100% 60%, 72% 60%, 72% 100%, 28% 100%, 28% 60%, 0 60%);
}

.sm-companion-robot-arm-left {
  clip-path: polygon(17% 60%, 36% 60%, 36% 85%, 17% 85%);
  transform-origin: 31% 66%;
  animation: sm-companion-arm-left 2.3s ease-in-out infinite;
}

.sm-companion-robot-arm-right {
  clip-path: polygon(64% 60%, 83% 60%, 83% 85%, 64% 85%);
  transform-origin: 69% 66%;
  animation: sm-companion-arm-right 2.3s ease-in-out infinite;
}

.sm-companion-eyes {
  position: absolute;
  left: 37.5%;
  top: 40%;
  z-index: 4;
  width: 25%;
  height: 4.3%;
  border-radius: 3px;
  background: #19233c;
  box-shadow: 0 0 3px 2px #19233c;
}

.sm-companion-eyes::before,
.sm-companion-eyes::after {
  content: "";
  position: absolute;
  top: 18%;
  width: 22%;
  height: 64%;
  border-radius: 2px;
  background: #22d39f;
  box-shadow: 0 0 4px rgba(34, 211, 159, .34);
  transform-origin: center;
  animation: sm-companion-eye-blink 4.8s ease-in-out infinite;
}

.sm-companion-eyes::before { left: 4%; }
.sm-companion-eyes::after { right: 4%; }

.sm-companion-clouds {
  position: absolute;
  right: -10px;
  bottom: calc(clamp(86px, 6.3vw, 110px) + 10px);
  width: min(270px, calc(100vw - 28px));
  min-height: 120px;
}

.sm-companion-cloud {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 258px;
  height: 118px;
  min-height: 118px;
  padding: 28px 38px 31px 31px;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  color: #fff;
  font: normal 600 13px/1.36 "Manrope", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  text-align: center;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  isolation: isolate;
  animation: sm-companion-cloud-in .6s cubic-bezier(.22, 1, .36, 1) both;
}

.sm-companion-cloud-shape {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 12px 22px rgba(42, 105, 137, .16));
  pointer-events: none;
}

.sm-companion-cloud-body,
.sm-companion-cloud-tail {
  fill: #82c5e5;
  stroke: none;
}

.sm-companion-cloud-tail-small { opacity: .9; }

.sm-companion-cloud-copy {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 184px;
  min-height: 50px;
  max-height: 58px;
  text-align: center;
  line-height: inherit;
  text-wrap: balance;
  text-shadow: none;
}

.sm-companion-cloud.is-leaving {
  animation: sm-companion-cloud-out .6s ease both;
}

@keyframes sm-companion-arm-left {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  45% { transform: rotate(3deg) translateY(-1px); }
  60% { transform: rotate(1.5deg) translateY(0); }
}

@keyframes sm-companion-arm-right {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  45% { transform: rotate(-3deg) translateY(-1px); }
  60% { transform: rotate(-1.5deg) translateY(0); }
}

@keyframes sm-companion-eye-blink {
  0%, 66%, 84%, 100% { opacity: 1; transform: scale(1); }
  70% { opacity: .42; transform: scale(1.08, .12); }
  75% { opacity: 1; transform: scale(1.28); box-shadow: 0 0 6px rgba(34, 211, 159, .48); }
  81% { opacity: 1; transform: scale(1); }
}

@keyframes sm-companion-cloud-in {
  from { opacity: 0; transform: translateY(5px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sm-companion-cloud-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-3px) scale(.99); }
}

@media (max-width: 640px) {
  .sm-companion {
    position: relative;
    right: auto;
    bottom: auto;
    display: block;
    width: 100%;
    height: 160px;
    margin: 4px 0 8px;
  }
  .sm-companion-avatar {
    position: absolute;
    right: 10px;
    bottom: 0;
    width: 74px;
    height: 78px;
  }
  .sm-companion-clouds {
    right: 56px;
    bottom: 52px;
    width: min(232px, calc(100vw - 22px));
    min-height: 104px;
  }
  .sm-companion-cloud {
    width: 224px;
    height: 102px;
    min-height: 102px;
    padding: 23px 33px 27px 27px;
    font-size: 11.5px;
  }
  .sm-companion-cloud-copy {
    max-width: 158px;
    min-height: 44px;
    max-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sm-companion-robot-arm,
  .sm-companion-cloud { animation: none !important; }
}
