.chat-article {
  --chat-accent: #6b4eff;
  --chat-surface: #f5f4fb;
  --chat-border: #e5e2f0;
  --chat-text: #26242d;
}

.chat-article.is-desktop-classic .chat-article-intro {
  display: none;
}

.chat-article-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 26px;
  padding: 14px 0;
  border-top: 1px solid var(--chat-border);
  border-bottom: 1px solid var(--chat-border);
}

.chat-article-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--chat-text);
  font-size: 16px;
  font-weight: 700;
}

.chat-article-heading-icon,
.chat-article-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #785cf6, #4731bf);
  font-weight: 700;
}

.chat-article-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--chat-border);
  border-radius: 999px;
  background: #fff;
}

.chat-article-toggle-button {
  border: 0;
  border-radius: 999px;
  padding: 7px 11px;
  color: #5c5867;
  background: transparent;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.chat-article-toggle-button.is-active {
  color: #fff;
  background: var(--chat-accent);
}

.chat-article-message {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0 0 18px;
}

.chat-article-avatar {
  width: 30px;
  height: 30px;
  margin-top: 4px;
  font-size: 13px;
}

.chat-article-message-column {
  min-width: 0;
  width: calc(100% - 41px);
}

.chat-article-typing {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  margin: 0 0 7px 4px;
  color: #696474;
  font-size: 13px;
  transition: opacity 180ms ease, min-height 180ms ease, margin 180ms ease;
}

.chat-article-typing.is-finished {
  min-height: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
}

.chat-article-typing-dots {
  display: inline-flex;
  gap: 3px;
}

.chat-article-typing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: chat-article-dot 900ms infinite ease-in-out;
}

.chat-article-typing-dots i:nth-child(2) { animation-delay: 150ms; }
.chat-article-typing-dots i:nth-child(3) { animation-delay: 300ms; }

@keyframes chat-article-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.chat-article-message-body {
  min-width: 0;
  width: 100%;
  padding: 17px 19px;
  border: 1px solid var(--chat-border);
  border-radius: 6px 20px 20px 20px;
  color: var(--chat-text);
  background: var(--chat-surface);
}

.chat-article-message-body > :first-child,
.chat-article-message-body > :first-child > :first-child { margin-top: 0; }
.chat-article-message-body > :last-child,
.chat-article-message-body > :last-child > :last-child { margin-bottom: 0; }

.chat-article:not(.is-classic-view) .chat-article-rich-content {
  margin: 26px 0;
}

.chat-article-content > .chat-article-rich-content img,
.chat-article-content > .chat-article-rich-content iframe,
.chat-article-content > .chat-article-rich-content video {
  max-width: 100%;
}

.chat-article.is-classic-view .chat-article-avatar { display: none; }

.chat-article.is-classic-view .chat-article-content > .chat-article-message,
.chat-article.is-classic-view .chat-article-message-column,
.chat-article.is-classic-view .chat-article-message-body {
  display: contents;
}

.chat-article.is-classic-view .chat-article-typing { display: none; }

.chat-article-conversation {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 22px 0 14px 38px;
}

.chat-article-reply {
  display: flex;
  flex-direction: column;
  max-width: 90%;
}

.chat-article-reply.is-user { align-self: flex-end; }
.chat-article-reply.is-bot { align-self: flex-start; }

.chat-article-reply-label {
  margin: 0 7px 5px;
  color: #716b7e;
  font-size: 12px;
  font-weight: 700;
}

.chat-article-reply.is-user .chat-article-reply-label { text-align: right; }

.chat-article-reply-bubble {
  padding: 12px 15px;
  border: 1px solid var(--chat-border);
  border-radius: 17px 17px 17px 5px;
  color: var(--chat-text);
  background: var(--chat-surface);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.chat-article-reply.is-user .chat-article-reply-bubble {
  border-color: var(--chat-accent);
  border-radius: 17px 17px 5px 17px;
  color: #fff;
  background: var(--chat-accent);
}

.chat-article-reply.is-typing .chat-article-reply-bubble {
  display: inline-flex;
  gap: 5px;
  width: fit-content;
}

.chat-article-reply.is-typing .chat-article-reply-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #777181;
  animation: chat-article-dot 900ms infinite ease-in-out;
}

.chat-article-reply.is-typing .chat-article-reply-bubble span:nth-child(2) { animation-delay: 150ms; }
.chat-article-reply.is-typing .chat-article-reply-bubble span:nth-child(3) { animation-delay: 300ms; }

.chat-article-ask-box {
  position: sticky;
  bottom: 8px;
  z-index: 30;
  margin: 25px 0 0 38px;
  padding: 16px 0 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 28%);
}

.chat-article-composer {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  margin: 0;
  padding: 7px 7px 7px 17px;
  border: 1px solid #d8d5df;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 5px 22px rgba(35, 27, 68, .14);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.chat-article-composer:focus-within {
  border-color: rgba(107, 78, 255, .7);
  box-shadow: 0 0 0 3px rgba(107, 78, 255, .11), 0 9px 26px rgba(55, 42, 112, .13);
  transform: translateY(-1px);
}

.chat-article-composer textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 58px;
  max-height: 150px;
  padding: 9px 0;
  border: 0;
  outline: 0;
  resize: none;
  overflow-y: auto;
  color: var(--chat-text);
  background: transparent;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
}

.chat-article-composer textarea::placeholder { color: #918c9b; opacity: 1; }

.chat-article-composer button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #5b3df2;
  box-shadow: 0 5px 12px rgba(91, 61, 242, .3);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  margin-bottom: 2px;
}

.chat-article-composer button:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 7px 16px rgba(91, 61, 242, .38);
}

.chat-article-composer button:active:not(:disabled) { transform: scale(.95); }

.chat-article-composer button:disabled,
.chat-article-composer textarea:disabled { opacity: .55; }

.chat-article-composer-note {
  margin: 8px 5px 0 !important;
  color: #777181;
  font-size: 11px !important;
  line-height: 1.4;
}

.chat-article-zodiac-picker {
  margin: 0 4px 9px;
  padding: 10px 12px;
  border: 1px solid rgba(107, 78, 255, .2);
  border-radius: 16px;
  background: #f6f3ff;
}

.chat-article-zodiac-picker label {
  display: block;
  margin: 0 0 6px;
  color: #4e426c;
  font-size: 12px;
  font-weight: 700;
}

.chat-article-zodiac-picker select {
  width: 100%;
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid #d7d0eb;
  border-radius: 12px;
  color: var(--chat-text);
  background: #fff;
  font: inherit;
  font-size: 14px;
}

.chat-article-zodiac-picker.is-selected { display: none; }

body.chat-article-active .relatedpost,
body.chat-article-active .footer-bs,
body.chat-article-active .neadiatrofis-poll-box {
  display: none !important;
}

.chat-article.is-classic-view .chat-article-conversation,
.chat-article.is-classic-view .chat-article-ask-box,
.chat-article.is-classic-view .chat-article-composer,
.chat-article.is-classic-view .chat-article-composer-note,
.chat-article.is-desktop-classic .chat-article-conversation,
.chat-article.is-desktop-classic .chat-article-ask-box,
.chat-article.is-desktop-classic .chat-article-composer,
.chat-article.is-desktop-classic .chat-article-composer-note {
  display: none;
}

@media (max-width: 767px) {
  .chat-article-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-article-toggle { width: 100%; }
  .chat-article-toggle-button { flex: 1 1 50%; }

  .chat-article-message {
    position: relative;
    display: block;
    padding-top: 34px;
  }

  .chat-article-avatar {
    position: absolute;
    top: 0;
    left: 0;
    width: 27px;
    height: 27px;
  }

  .chat-article-message-column { width: 100%; }

  .chat-article-typing {
    position: absolute;
    top: 3px;
    left: 32px;
    margin: 0;
  }

  .chat-article-typing.is-finished {
    position: absolute;
  }

  .chat-article-message-body {
    width: 100%;
    padding: 17px;
    border-radius: 7px 19px 19px 19px;
  }

  .chat-article-conversation,
  .chat-article-composer { margin-left: 0; }

  .chat-article-ask-box {
    position: fixed;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    z-index: 9999;
    margin: 0;
    padding: 14px 2px 2px;
  }

  .chat-article:not(.is-classic-view) { padding-bottom: 112px; }
  .chat-article:not(.is-classic-view):has(.chat-article-zodiac-picker:not(.is-selected)) { padding-bottom: 205px; }

  .chat-article-composer-note {
    margin-right: 8px !important;
    margin-left: 8px !important;
    text-align: center;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .chat-article.is-chat-ready:not(.is-classic-view) .chat-article-message,
  .chat-article.is-chat-ready:not(.is-classic-view) .chat-article-rich-content {
    animation: chat-article-enter 260ms ease-out both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-article-typing-dots i,
  .chat-article-reply.is-typing .chat-article-reply-bubble span { animation: none; }
}

@keyframes chat-article-enter {
  from { opacity: .01; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
