.fundabot-chat-widget {
  position: fixed;
  bottom: 2.5rem;
  z-index: 9999;
  display: inline-flex;
  flex-direction: column-reverse;
  gap: 1rem;
  align-items: flex-end;
}

.fundabot-chat-widget--right {
  right: 2.5rem;
  align-items: flex-end;
}

.fundabot-chat-widget--left {
  left: 2.5rem;
  align-items: flex-start;
}

.fundabot-chat-widget__toggle {
  pointer-events: auto;
  background: #ff8200;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(41, 40, 39, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.fundabot-chat-widget__toggle:hover,
.fundabot-chat-widget__toggle:focus {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 16px 32px rgba(41, 40, 39, 0.45);
  background: #ff9629;
}

.fundabot-chat-widget__toggle:focus {
  outline: 3px solid rgba(255, 130, 0, 0.4);
  outline-offset: 3px;
}

.fundabot-chat-widget__toggle-icon {
  display: block;
  width: 50px;
  height: auto;
}

/* Make FundaBot icon and toggle smaller on mobile only */
@media (max-width: 768px) {
  .fundabot-chat-widget__toggle {
    width: 55px;
    height: 55px;
  }

  .fundabot-chat-widget__toggle-icon {
    width: 34px;
    height: auto;   /* keeps proportions */
    display: block; /* optional, same as now */
  }
}

.fundabot-chat-widget__panel {
  width: min(380px, calc(100vw - 3rem));
  height: min(560px, calc(100vh - 5rem));
  background: #ffffff;
  border-radius: 22px;
  border: 1px solid #f3efec;
  box-shadow: 0 25px 60px rgba(41, 40, 39, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-16px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.fundabot-chat-widget[data-expanded="true"] .fundabot-chat-widget__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.fundabot-chat-widget--left .fundabot-chat-widget__panel {
  align-self: flex-start;
}

.fundabot-chat-widget--right .fundabot-chat-widget__panel {
  align-self: flex-end;
}

.fundabot-chat-widget__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.2rem;
  background: #292827;
  color: #ffffff;
}

.fundabot-chat-widget__brand {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fundabot-chat-widget__brand img {
  width: 32px;
  height: auto;
}

.fundabot-chat-widget__heading {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.fundabot-chat-widget__title {
  font-size: 1rem;
  font-weight: 600;
  color: #ff8200;
}

.fundabot-chat-widget__subtitle {
  font-size: 0.82rem;
  color: #f3efec;
  letter-spacing: 0.01em;
}

.fundabot-chat-widget__body {
  flex: 1;
  background: #eae4e0;
}

.fundabot-chat-widget__frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

@media (max-width: 640px) {
  .fundabot-chat-widget {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    bottom: 1.5rem;
  }

  .fundabot-chat-widget--left,
  .fundabot-chat-widget--right {
    left: 50%;
    right: auto;
    align-items: center;
  }

  .fundabot-chat-widget__panel {
    width: calc(100vw - 2rem);
    height: calc(100vh - 14rem);
  }
}
