#te-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #7b2c8e;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  z-index: 999999;
  font-size: 24px;
}

#te-chat-widget {
  position: fixed;
  right: 24px;
  bottom: 92px;
  width: 360px;
  height: 640px;
  background: #fff;
  border-radius: 0 0 34px 34px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
  overflow: hidden;
  z-index: 999999;
  font-family: Arial, sans-serif;
}

.te-hidden {
  display: none !important;
}

.te-chat-header {
  height: 62px;
  background: #86278f;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  box-sizing: border-box;
}

.te-avatar {
  width: 34px;
  height: 34px;
  background: #fff;
  color: #86278f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
}

.te-title {
  font-weight: bold;
  font-size: 15px;
  max-width: 145px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.te-subtitle {
  font-size: 9px;
  opacity: .9;
}

.te-logo {
  margin-left: auto;
  font-size: 9px;
  line-height: 9px;
  text-align: right;
  font-weight: bold;
}

#te-close {
  border: 0;
  background: #fff;
  color: #86278f;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-weight: bold;
  padding: 0px;
}

#te-end-chat {
  border: 0;
  background: #fff;
  color: #86278f;
  border-radius: 12px;
  padding: 5px 9px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
}

.te-chat-body {
  height: 500px;
  padding: 18px 14px;
  overflow-y: auto;
  background: #fff;
  box-sizing: border-box;
}

.te-typing {
  height: 24px;
  padding: 4px 14px;
  font-size: 12px;
  color: #666;
  font-style: italic;
  box-sizing: border-box;
}

.te-input-area {
  height: 54px;
  display: flex;
  gap: 7px;
  padding: 8px 10px;
  background: #fff;
  box-sizing: border-box;
  border-top: 1px solid #eee;
}

#te-message-input {
  flex: 1;
  border: 0;
  background: #ddd;
  border-radius: 9px;
  padding: 0 12px;
  outline: none;
  min-width: 0;
}

#te-message-input:disabled {
  opacity: .6;
  cursor: not-allowed;
}

#te-send {
  width: 38px;
  border: 0;
  border-radius: 9px;
  background: #ddd;
  color: #86278f;
  cursor: pointer;
  font-size: 16px;
  flex: 0 0 38px;
}

#te-send:disabled {
  opacity: .5;
  cursor: not-allowed;
}

#te-attach {
  width: 38px;
  border: 0;
  border-radius: 9px;
  background: #ddd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
}

.te-advisor-contact {
  padding: 0 16px 10px;
  font-size: 13px;
  color: #222;
  background: #fff;
  line-height: 18px;
  box-sizing: border-box;
}

.te-advisor-contact strong {
  font-weight: bold;
}

.te-row {
  display: flex;
  margin-bottom: 12px;
  gap: 8px;
}

.te-row.user {
  justify-content: flex-end;
}

.te-bot-icon {
  width: 26px;
  height: 26px;
  background: #86278f;
  color: white;
  border-radius: 50%;
  display: flex;
  flex: 0 0 26px;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  margin-top: 4px;
  font-weight: bold;
}

.te-bubble {
  max-width: 245px;
  background: #7b2c8e;
  color: #fff;
  padding: 12px;
  border-radius: 13px;
  font-size: 13px;
  line-height: 17px;
  white-space: pre-wrap;
  word-break: break-word;
}

.te-row.user .te-bubble {
  background: #d8f5fb;
  color: #222;
}

.te-attachment {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  max-width: 230px;
  word-break: break-word;
}

.te-row.user .te-attachment {
  background: rgba(0, 0, 0, .08);
  color: #222;
}

.te-attachment:hover {
  text-decoration: underline;
}

.te-attachment-icon {
  flex: 0 0 auto;
  font-size: 15px;
}

.te-agent-name {
  font-size: 11px;
  color: #666;
  margin-bottom: 3px;
  font-weight: bold;
}

.te-time {
  margin-top: 4px;
  font-size: 10px;
  opacity: .7;
  text-align: right;
}

.te-system {
  text-align: center;
  color: #999;
  font-style: italic;
  font-size: 12px;
  margin: 12px 0;
}

.te-buttons {
  margin: 10px 0 18px 34px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.te-option {
  width: fit-content;
  min-width: 145px;
  padding: 8px 12px;
  border: 1px solid #7b2c8e;
  border-radius: 5px;
  background: #fff;
  color: #7b2c8e;
  cursor: pointer;
  font-size: 12px;
}

.te-option.primary {
  background: #c9f6f8;
}

.te-form {
  background: #fffaf0;
  padding: 14px;
  margin-bottom: 16px;
  font-size: 12px;
  border-radius: 10px;
}

.te-form label {
  display: block;
  margin: 8px 0 4px;
  font-weight: bold;
}

.te-form input,
.te-form select {
  width: 100%;
  padding: 8px;
  border: 1px solid #222;
  border-radius: 4px;
  box-sizing: border-box;
}

.te-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.te-submit {
  margin-top: 12px;
  background: #86278f;
  color: white;
  border: 0;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
}

.te-test {
  background: #555;
}

.te-error {
  color: #b00020;
  font-size: 12px;
  margin-top: 8px;
}

@media (max-width: 480px) {
  #te-chat-widget {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .te-chat-body {
    height: calc(100vh - 150px);
  }
}
