.chatbot-widget {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1085;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.chatbot-widget__launcher {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f172a 0%, #0f766e 100%);
  color: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  width: 4.5rem;
  height: 4.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.chatbot-widget__launcher-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 1.35rem;
}

.chatbot-widget__panel {
  width: min(24rem, calc(100vw - 1.5rem));
  min-height: 32rem;
  max-height: min(42rem, calc(100vh - 6rem));
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background:
    radial-gradient(
      circle at top right,
      rgba(45, 212, 191, 0.16),
      transparent 32%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(248, 250, 252, 0.98)
    );
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(18px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.chatbot-widget__header {
  padding: 1.25rem 1.25rem 0.75rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.chatbot-widget__eyebrow {
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0f766e;
}

.chatbot-widget__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.chatbot-widget__intro {
  margin: 0.45rem 0 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.5;
}

.chatbot-widget__close {
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.14);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.chatbot-widget__status {
  margin: 0 1.25rem;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
  font-size: 0.8rem;
  font-weight: 600;
}

.chatbot-widget__messages {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chatbot-widget__message {
  display: flex;
}

.chatbot-widget__message--user {
  justify-content: flex-end;
}

.chatbot-widget__message--assistant {
  justify-content: flex-start;
}

.chatbot-widget__bubble {
  max-width: 85%;
  padding: 0.9rem 1rem;
  border-radius: 1.15rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.94rem;
  line-height: 1.55;
}

.chatbot-widget__message--assistant .chatbot-widget__bubble {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.26);
  color: #1e293b;
}

.chatbot-widget__message--user .chatbot-widget__bubble {
  background: linear-gradient(135deg, #0f766e 0%, #0369a1 100%);
  color: #fff;
}

.chatbot-widget__message--pending .chatbot-widget__bubble {
  opacity: 0.78;
}

.chatbot-widget__form {
  padding: 0 1.25rem 1.25rem;
}

.chatbot-widget__input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.chatbot-widget__input {
  resize: none;
  min-height: 3rem;
  max-height: 8.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.85rem 1rem;
  color: #0f172a;
  line-height: 1.45;
}

.chatbot-widget__input:focus {
  outline: 0;
  border-color: rgba(15, 118, 110, 0.7);
  box-shadow: 0 0 0 0.25rem rgba(45, 212, 191, 0.18);
}

.chatbot-widget__submit {
  min-width: 5.5rem;
  border: 0;
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  background: #0f172a;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.chatbot-widget__submit:disabled,
.chatbot-widget__input:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

@media (max-width: 575.98px) {
  .chatbot-widget {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
    align-items: stretch;
  }

  .chatbot-widget__launcher {
    width: 4.25rem;
    height: 4.25rem;
    align-self: flex-end;
  }

  .chatbot-widget__panel {
    width: 100%;
    min-height: 26rem;
    max-height: calc(100vh - 5.5rem);
  }

  .chatbot-widget__input-row {
    grid-template-columns: 1fr;
  }

  .chatbot-widget__submit {
    width: 100%;
  }
}
