/* Removed gradient overlay - it was interfering with images */#chat-log {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 48px;
  padding-right: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* Фикс: добавляем relative для absolute позиционирования ::before */
  position: relative;
}

#chat-log.chat-centered {
  justify-content: center;
}

#chat-log::before {
  content: '';
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 1;
  display: block;
  margin-bottom: -40px;
  /* Фикс: убираем sticky поведение, которое мешает скроллу */
  position: absolute;
}

#chat-log::-webkit-scrollbar {
  display: none;
}

.msg {
  margin: 0 0 16px 0;
  font-size: 18px;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.8);
  opacity: 0;
  animation: fadeIn 0.3s ease-in forwards;
  overflow: visible;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.meta {
  font-weight: normal;
}

.msg-text {
  display: inline;
}

.paragraph-break {
  display: block;
  margin: 4px 0;
}

.system-msg {
  margin: 0 0 16px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-nimbus-dark);
  opacity: 0;
  animation: fadeIn 0.3s ease-in forwards;
}

.system-meta {
  font-weight: normal;
}

.system-text {
  display: inline;
}

/* SYSTEM_MSG_CLASS: Allow images to display properly in system messages */
.system-msg img,
.system-text img {
  display: block !important;
}

.system-spinner {
  display: inline;
  font-family: 'Ubuntu Mono', monospace;
}

.system-action-btn {
  display: inline;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  background: transparent;
  border: none;
  color: var(--color-nimbus-dark);
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: all 0.2s;
  opacity: 1 !important;
  pointer-events: all !important;
}

.system-action-btn:hover {
  opacity: 0.7;
}

.quote-block {
  border-left: 3px solid rgba(0, 0, 0, 0.15);
  padding-left: 12px;
  margin: 6px 0;
  display: block;
  font-style: italic;
}

.quote-text {
  font-size: 16px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.8);
  margin-bottom: 2px;
}

.quote-author {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.4);
  margin-top: 2px;
  font-style: normal;
}

.quote-author[data-target-message] {
  cursor: pointer;
  transition: color 0.2s;
}

.quote-author[data-target-message]:hover {
  color: rgba(0, 0, 0, 0.8);
}
