.floating-ai-button {
  position: fixed;
  right: 25px;
  bottom: 25px;
  z-index: 1050;
  display: inline-flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .45);
  border-radius: 50%;
  background: #3156a4;
  box-shadow: 0 4px 18px rgba(30, 65, 140, .3);
  color: #fff;
  cursor: pointer;
  font-size: 1.45rem;
  transition: transform .2s ease, box-shadow .2s ease;
}

.floating-ai-button:hover,
.floating-ai-button:focus-visible {
  transform: scale(1.06);
  background: #244487;
  color: #fff;
}

.floating-ai-widget {
  position: fixed;
  right: 25px;
  bottom: 95px;
  z-index: 1050;
  display: flex;
  width: min(420px, calc(100vw - 32px));
  height: min(500px, calc(100vh - 120px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dfe4ec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(20, 35, 65, .22);
  font-family: inherit;
}

.floating-ai-widget[hidden] {
  display: none;
}

.floating-ai-widget-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .2);
  background: #3156a4;
  color: #fff;
}

.floating-ai-widget-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .98rem;
}

.floating-ai-widget-heading a {
  display: inline-block;
  margin: 3px 0 0 27px;
  color: rgba(255, 255, 255, .86);
  font-size: .75rem;
  text-decoration: underline;
}

.floating-ai-widget-heading a:hover,
.floating-ai-widget-heading a:focus-visible {
  color: #fff;
}

.floating-ai-widget-title i {
  font-size: 1.1rem;
}

.floating-ai-widget-close {
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  opacity: .9;
}

.floating-ai-widget-close:hover,
.floating-ai-widget-close:focus-visible {
  opacity: 1;
}

.floating-ai-widget-messages {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 16px;
  background: #f1f3f5;
}

.floating-ai-widget-message {
  align-self: flex-start;
  max-width: 88%;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #e2e5e9;
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  color: #202633;
  font-size: .88rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.floating-ai-widget-message.is-user {
  align-self: flex-end;
  border-color: #3156a4;
  border-radius: 14px 14px 4px 14px;
  background: #3156a4;
  color: #fff;
}

.floating-ai-widget-form {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e2e5e9;
  background: #fff;
}

.floating-ai-widget-form input {
  min-width: 0;
  min-height: 40px;
  flex: 1;
  padding: 8px 15px;
  border: 1px solid #d8dde5;
  border-radius: 22px;
  background: #fff;
  color: #202633;
  font: inherit;
  font-size: .88rem;
}

.floating-ai-widget-form input:focus {
  border-color: #3156a4;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(49, 86, 164, .15);
}

.floating-ai-widget-form button {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #3156a4;
  color: #fff;
  cursor: pointer;
}

.floating-ai-widget-form button:hover,
.floating-ai-widget-form button:focus-visible {
  background: #244487;
}

.floating-ai-widget-form button:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .floating-ai-widget {
    right: 16px;
    bottom: 88px;
    height: min(500px, calc(100vh - 104px));
  }

  .floating-ai-button {
    right: 16px;
    bottom: 16px;
  }
}
