.ai-chat-main {
  background: #f2f4f7;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.ai-chat-main .container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.ai-chat-main .header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.ai-chat-main .header h1 {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  font-size: 24px;
  margin: 0;
}
.ai-chat-main .header h1 > * {
  min-width: 0;
}
.ai-chat-main .header h1 svg {
  flex-shrink: 0;
}
.ai-chat-main .backLink {
  color: #6899d9;
  text-decoration: none;
  display: flex;
  flex-direction: row;
  gap: 5px;
  align-items: center;
}
.ai-chat-main .backLink > * {
  min-width: 0;
}
.ai-chat-main .backLink:hover {
  text-decoration: underline;
}
.ai-chat-main .chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-height: calc(100vh - 240px);
}
.ai-chat-main .messages {
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1;
}
.ai-chat-main .messages .welcome {
  color: #9da5b1;
  text-align: center;
  padding: 20px;
  display: none;
}
.ai-chat-main .messages .welcome p {
  margin: 0;
}
.ai-chat-main .message {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 85%;
}
.ai-chat-main .message.user {
  align-self: flex-end;
}
.ai-chat-main .message.user .bubble {
  background: #6899d9;
  color: white;
  border-radius: 16px 16px 4px 16px;
}
.ai-chat-main .message.assistant {
  align-self: flex-start;
}
.ai-chat-main .message.assistant .bubble {
  background: #ebedef;
  color: #636f83;
  border-radius: 16px 16px 16px 4px;
}
.ai-chat-main .bubble {
  padding: 12px 16px;
  line-height: 1.5;
}
.ai-chat-main .bubble p {
  margin: 0 0 0.5em;
}
.ai-chat-main .bubble p:last-child {
  margin-bottom: 0;
}
.ai-chat-main .bubble ul,
.ai-chat-main .bubble ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}
.ai-chat-main .followups {
  padding: 0 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.ai-chat-main .followups .followupBtn {
  background: #ebedef;
  border: 1px solid #d7dadf;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: #768192;
}
.ai-chat-main .followups .followupBtn:hover {
  background: #d7dadf;
  border-color: #c4c9d0;
}
.ai-chat-main .loading {
  padding: 15px 20px;
  color: #9da5b1;
  font-style: italic;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}
.ai-chat-main .loading > * {
  min-width: 0;
}
.ai-chat-main .error {
  padding: 15px 20px;
  background: rgba(217, 105, 105, 0.1);
  color: #d96969;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}
.ai-chat-main .error > * {
  min-width: 0;
}
.ai-chat-main .form {
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid #d7dadf;
  background: #f2f4f7;
}
.ai-chat-main .form > * {
  min-width: 0;
}
.ai-chat-main .form textarea {
  flex: 1;
  border: 1px solid #c4c9d0;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 16px;
  resize: none;
  font-family: inherit;
  max-height: 150px;
  line-height: 1.4;
}
.ai-chat-main .form button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #6899d9;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}
.ai-chat-main .form button:hover {
  background: #3f7dcf;
}
.ai-chat-main .form button:disabled {
  background: #c4c9d0;
  cursor: not-allowed;
}
.ai-chat-main .form button i {
  font-size: 18px;
}
