.ng-ai-chat,
.ng-ai-chat * {
  box-sizing: border-box;
}

.ng-ai-chat {
  --ng-ai-primary: #111827;
  width: 100%;
  max-width: 420px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  font-family: inherit;
}

.ng-ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--ng-ai-primary);
  color: #ffffff;
}

.ng-ai-chat-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.ng-ai-chat-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.ng-ai-chat-messages {
  height: 360px;
  overflow-y: auto;
  padding: 16px;
  background: #f9fafb;
}

.ng-ai-message {
  display: flex;
  margin-bottom: 10px;
}

.ng-ai-message-user {
  justify-content: flex-end;
}

.ng-ai-message-assistant {
  justify-content: flex-start;
}

.ng-ai-message-bubble {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: normal;
}

.ng-ai-message-user .ng-ai-message-bubble {
  background: var(--ng-ai-primary);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.ng-ai-message-assistant .ng-ai-message-bubble {
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

.ng-ai-message-link {
  color: inherit;
  text-decoration: underline;
  word-break: break-word;
}

.ng-ai-message-assistant .ng-ai-message-link {
  color: #2563eb;
}

.ng-ai-message-user .ng-ai-message-link {
  color: #ffffff;
}

.ng-ai-chat-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 12px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
}

.ng-ai-chat-input {
  flex: 1;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  border: 1px solid #d1d5db !important;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  outline: none;
  background: #ffffff !important;
  color: #111827 !important;
  caret-color: var(--ng-ai-primary);
  -webkit-text-fill-color: #111827 !important;
}

.ng-ai-chat-input::placeholder {
  color: #6b7280 !important;
  opacity: 1;
  -webkit-text-fill-color: #6b7280 !important;
}

.ng-ai-chat-input:focus {
  border-color: var(--ng-ai-primary);
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.12);
}

.ng-ai-chat-send {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--ng-ai-primary);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ng-ai-chat-send:disabled,
.ng-ai-chat-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ng-ai-floating-wrapper {
  position: fixed;
  bottom: 22px;
  z-index: 999999;
}

.ng-ai-floating-right {
  right: 22px;
  left: auto;
}

.ng-ai-floating-left {
  left: 22px;
  right: auto;
}

.ng-ai-floating-button {
  --ng-ai-primary: #111827;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--ng-ai-primary);
  color: #ffffff;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.28);
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.ng-ai-floating-icon-text {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ng-ai-floating-icon-img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.ng-ai-floating-panel-holder {
  display: none;
  position: absolute;
  bottom: 74px;
  width: min(420px, calc(100vw - 32px));
}

.ng-ai-floating-right .ng-ai-floating-panel-holder {
  right: 0;
  left: auto;
}

.ng-ai-floating-left .ng-ai-floating-panel-holder {
  left: 0;
  right: auto;
}

body.ng-ai-chat-open .ng-ai-floating-panel-holder {
  display: block;
}

.ng-ai-chat-floating-panel {
  max-width: none;
}

.ng-ai-assistant-shortcode {
  margin: 20px 0;
}

@media (max-width: 480px) {
  .ng-ai-floating-wrapper {
    bottom: 12px;
  }

  .ng-ai-floating-right {
    right: 12px;
    left: auto;
  }

  .ng-ai-floating-left {
    left: 12px;
    right: auto;
  }

  .ng-ai-floating-panel-holder {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 82px;
    width: auto;
  }

  .ng-ai-chat-messages {
    height: 56vh;
  }
}
