.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scroll-behavior: smooth;
  position: relative;
}

.chat-log {
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 120px; /* Platz für das Input-Feld — verhindert dass Nachrichten unter Eingabe liegen */
}

.chat-log > .chat-row {
  max-width: 980px;
  margin: 0 auto;
}

/* gradient overlay fixed to chat container bottom */
.gradient-fade {
  position: fixed;   /* statt absolute */
  bottom: 0;
  left: 0;
  right: 0;
  height: 140px; /* größer, damit die Überblendung bei kleinem Inhalt voll wirkt */
  background: linear-gradient(0deg,
    var(--bg) 0%,
    rgba(0,0,0,1.0) 30%,
    rgba(0,0,0,1.0) 65%,
    transparent 100%);
  pointer-events: none;
  display: none;
  z-index: 50;
}

.chat-row {
  display: flex;
  width: 100%;
  animation: slideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.user-row { justify-content: flex-end; }

.user-bubble {
  background: var(--bubble-user);
  color: white;
  padding: 14px 18px;
  border-radius: 18px 18px 6px 18px;
  max-width: 75%;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.user-bubble::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  pointer-events: none;
}

.assistant-row { justify-content: flex-start; }

.assistant-bubble {
  background: var(--bubble-ai);
  color: var(--text);
  padding: 14px 18px;
  border-radius: 18px 18px 18px 6px;
  max-width: 75%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
}

.assistant-bubble pre {
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}

.assistant-bubble code {
  font-family: ui-monospace, 'SF Mono', Consolas, 'Liberation Mono', monospace;
  background: rgba(0,0,0,0.3);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Scrollbar */
.chat-container::-webkit-scrollbar { width: 6px; }
.chat-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }



