.mmbot {
  --mmbot-bar: 0px;
  position: fixed;
  right: 48px;
  bottom: 20px;
  z-index: 900;
  font-size: 14px;
  line-height: 1.6;
  color: #141414;
}
.mmbot,
.mmbot *,
.mmbot *::before,
.mmbot *::after {
  box-sizing: border-box;
}
@media (max-width: 740px) {
  .mmbot {
    right: 12px;
    bottom: calc(var(--mmbot-bar) + 12px);
  }
}

.mmbot__launcher {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 22px 0 16px;
  border: 0;
  border-radius: 999px;
  background: #086936;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 18px rgba(8, 105, 54, 0.35);
  cursor: pointer;
  transition: translate 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s, scale 0.15s, color 0.3s;
}
.mmbot__launcher::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: #fff;
  box-shadow: inset 0 0 0 2px #086936;
  opacity: 0;
  transition: opacity 0.3s;
}
@media (hover: hover) {
  .mmbot__launcher:hover {
    color: #086936;
    translate: 0 -3px;
    box-shadow: 0 10px 24px rgba(8, 105, 54, 0.45);
    animation: mmbot-boing 0.9s linear;
  }
}
.mmbot__launcher:active {
  scale: 0.95;
}
.mmbot__launcher:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.is-open .mmbot__launcher {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 740px) {
  .mmbot__launcher {
    height: 50px;
    padding: 0 16px 0 12px;
    font-size: 14px;
  }
}

.mmbot__launcher-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 30px;
  height: 24px;
  border-radius: 12px 12px 12px 3px;
  background: #fff;
  transition: background-color 0.3s;
}
.mmbot__launcher-icon i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #086936;
}

@media (hover: hover) {
  .mmbot__launcher:hover::before {
    opacity: 1;
  }
  .mmbot__launcher:hover .mmbot__launcher-icon {
    background-color: #086936;
  }
  .mmbot__launcher:hover .mmbot__launcher-icon i {
    background: #fff;
    animation: mmbot-dot 1s ease-in-out infinite;
  }
  .mmbot__launcher:hover .mmbot__launcher-icon i:nth-child(2) {
    animation-delay: 0.15s;
  }
  .mmbot__launcher:hover .mmbot__launcher-icon i:nth-child(3) {
    animation-delay: 0.3s;
  }
}
.mmbot:not(.is-entered) .mmbot__launcher {
  animation: mmbot-enter 0.8s cubic-bezier(0.34, 1.3, 0.64, 1) 1s backwards;
}

@keyframes mmbot-enter {
  from {
    transform: translateX(calc(100% + 60px));
    opacity: 0;
  }
  70% {
    opacity: 1;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.mmbot__launcher.is-beat {
  animation: mmbot-beat 2.2s both;
}

.mmbot__launcher.is-jelly {
  animation: mmbot-jelly 1s both;
  transform-origin: 50% 100%;
}

.mmbot__launcher.is-twitch {
  animation: mmbot-twitch 0.7s linear both;
}

@media (hover: hover) {
  .mmbot__launcher.is-beat:hover,
  .mmbot__launcher.is-jelly:hover,
  .mmbot__launcher.is-twitch:hover {
    animation: mmbot-boing 0.9s linear;
  }
}
@keyframes mmbot-beat {
  0% {
    transform: scale(1);
    box-shadow: 0 6px 18px rgba(8, 105, 54, 0.35), 0 0 0 0 rgba(8, 105, 54, 0.3);
    animation-timing-function: cubic-bezier(0.33, 0, 0.2, 1);
  }
  13% {
    transform: scale(1.12);
    animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
  }
  30% {
    transform: scale(1);
    animation-timing-function: ease-in-out;
  }
  50% {
    transform: scale(1);
    animation-timing-function: cubic-bezier(0.33, 0, 0.2, 1);
  }
  61% {
    transform: scale(1.08);
    animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
  }
  78% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 6px 18px rgba(8, 105, 54, 0.35), 0 0 26px 20px rgba(8, 105, 54, 0);
  }
}
@keyframes mmbot-jelly {
  0% {
    transform: scale(1, 1);
  }
  18% {
    transform: scale(1.12, 0.86);
  }
  36% {
    transform: scale(0.93, 1.09);
  }
  52% {
    transform: scale(1.05, 0.96);
  }
  68% {
    transform: scale(0.98, 1.02);
  }
  84% {
    transform: scale(1.01, 0.995);
  }
  100% {
    transform: scale(1, 1);
  }
}
@keyframes mmbot-twitch {
  0%, 100% {
    transform: none;
  }
  10% {
    transform: translate(-1.5px, 0) rotate(-1.5deg);
  }
  20% {
    transform: translate(1.5px, -1px) rotate(1.5deg);
  }
  30% {
    transform: translate(-1.5px, 0) rotate(-1deg);
  }
  40% {
    transform: translate(1.5px, -1px) rotate(1.5deg);
  }
  50% {
    transform: translate(-1px, 0) rotate(-1.5deg);
  }
  60% {
    transform: translate(1.5px, -1px) rotate(1deg);
  }
  70% {
    transform: translate(-1px, 0) rotate(-1deg);
  }
  80% {
    transform: translate(1px, -1px) rotate(1deg);
  }
  90% {
    transform: translate(0, -2px) scale(1.03);
  }
}
@keyframes mmbot-boing {
  0% {
    scale: 1;
  }
  2.5% {
    scale: 1.0408;
  }
  5% {
    scale: 1.0724;
  }
  7.5% {
    scale: 1.0929;
  }
  10% {
    scale: 1.1019;
  }
  12.5% {
    scale: 1.1;
  }
  15% {
    scale: 1.0887;
  }
  17.5% {
    scale: 1.0704;
  }
  20% {
    scale: 1.0477;
  }
  22.5% {
    scale: 1.0234;
  }
  25% {
    scale: 1;
  }
  27.5% {
    scale: 0.9796;
  }
  30% {
    scale: 0.9638;
  }
  32.5% {
    scale: 0.9535;
  }
  35% {
    scale: 0.949;
  }
  37.5% {
    scale: 0.95;
  }
  40% {
    scale: 0.9556;
  }
  42.5% {
    scale: 0.9648;
  }
  45% {
    scale: 0.9761;
  }
  47.5% {
    scale: 0.9883;
  }
  50% {
    scale: 1;
  }
  52.5% {
    scale: 1.0102;
  }
  55% {
    scale: 1.0181;
  }
  57.5% {
    scale: 1.0232;
  }
  60% {
    scale: 1.0255;
  }
  62.5% {
    scale: 1.025;
  }
  65% {
    scale: 1.0222;
  }
  67.5% {
    scale: 1.0176;
  }
  70% {
    scale: 1.0119;
  }
  72.5% {
    scale: 1.0059;
  }
  75% {
    scale: 1;
  }
  77.5% {
    scale: 0.9949;
  }
  80% {
    scale: 0.991;
  }
  82.5% {
    scale: 0.9884;
  }
  85% {
    scale: 0.9873;
  }
  87.5% {
    scale: 0.9875;
  }
  90% {
    scale: 0.9889;
  }
  92.5% {
    scale: 0.9912;
  }
  95% {
    scale: 0.994;
  }
  97.5% {
    scale: 0.9971;
  }
  100% {
    scale: 1;
  }
}
@keyframes mmbot-dot {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}
.mmbot__panel {
  display: flex;
  flex-direction: column;
  width: 360px;
  height: min(600px, 100vh - 140px);
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.25);
}
.mmbot__panel[hidden] {
  display: none;
}
@media (max-width: 740px) {
  .mmbot__panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    width: auto;
    height: 82vh;
    height: 82dvh;
    border-radius: 14px 14px 0 0;
  }
}

.mmbot__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 12px 14px 12px 18px;
  background: #086936;
  color: #fff;
}

.mmbot__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.mmbot__close {
  position: relative;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
}
.mmbot__close span::before,
.mmbot__close span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  background: #fff;
}
.mmbot__close span::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.mmbot__close span::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.mmbot__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.mmbot__log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: #dde9c3;
  overscroll-behavior: contain;
}

.mmbot__msg {
  max-width: 88%;
  margin: 0 0 10px;
  padding: 10px 13px;
  border-radius: 12px;
  white-space: pre-line;
  word-break: break-word;
  animation: mmbot-in 0.25s ease-out;
}
.mmbot__msg.-bot {
  border-radius: 3px 12px 12px 12px;
  background: #fff;
}
.mmbot__msg.-user {
  margin-left: auto;
  border-radius: 12px 3px 12px 12px;
  background: #086936;
  color: #fff;
}

@keyframes mmbot-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.mmbot__opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 6px;
}

.mmbot__opt {
  display: block;
  width: 100%;
  padding: 10px 36px 10px 14px;
  border: 1px solid #086936;
  border-radius: 8px;
  background: #fff;
  color: #086936;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.mmbot__opt::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}
.mmbot__opt:hover, .mmbot__opt:focus-visible {
  background: #086936;
  color: #fff;
}
.mmbot__opt.-link {
  border-style: dashed;
}

.mmbot__foot {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  padding: 10px 12px;
  border-top: 1px solid #dfdfdf;
  background: #fff;
}
@media (max-width: 740px) {
  .mmbot__foot {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

.mmbot__foot-btn {
  padding: 8px 10px;
  border: 1px solid #bebebe;
  border-radius: 6px;
  background: #fff;
  color: #141414;
  font-size: 12px;
  cursor: pointer;
}
.mmbot__foot-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.mmbot__foot-btn.-primary {
  flex: 1;
  border-color: #fbcf21;
  background: #fbcf21;
  font-size: 13px;
  font-weight: 700;
}
.mmbot__foot-btn.-primary:hover {
  filter: brightness(0.95);
}
.mmbot__foot-btn.-primary[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .mmbot__launcher,
  .mmbot__launcher:hover,
  .mmbot__launcher-icon i,
  .mmbot__msg {
    animation: none !important;
  }
}
