
/* Lebendige Roboter-Animationen: Farben bleiben unverändert. */
@keyframes lambertiRobotFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(-1.5deg); }
}

@keyframes lambertiRobotGlow {
  0%, 100% { filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .24)); }
  50% { filter: drop-shadow(0 18px 26px rgba(242, 143, 34, .42)); }
}

@keyframes lambertiBubblePop {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.04); }
}

@keyframes lambertiPanelIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes lambertiTypingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-4px); opacity: 1; }
}

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

.lamberti-rag-chat {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
}

.lamberti-rag-inline {
  max-width: 720px;
  margin: 24px 0;
}

.lamberti-rag-floating {
  position: fixed;
  right: 22px;
  bottom: 16px;
  z-index: 99999;
}

.lamberti-rag-toggle {
  width: 118px;
  height: 138px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #172033;
  cursor: pointer;
  position: relative;
  display: block;
}

.lamberti-rag-toggle-robot {
  width: 112px;
  height: 132px;
  object-fit: contain;
  display: block;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .24));
  transition: transform .18s ease, filter .18s ease;
  animation: lambertiRobotFloat 3.6s ease-in-out infinite, lambertiRobotGlow 4.8s ease-in-out infinite;
}

.lamberti-rag-toggle:hover .lamberti-rag-toggle-robot,
.lamberti-rag-toggle:focus-visible .lamberti-rag-toggle-robot {
  transform: translateY(-6px) scale(1.07) rotate(-3deg);
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .28));
}

.lamberti-rag-toggle-bubble {
  position: absolute;
  right: 78px;
  top: 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff7d6;
  border: 1px solid #f2b33d;
  color: #7a1d17;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
  pointer-events: none;
  animation: lambertiBubblePop 2.8s ease-in-out infinite;
}

.lamberti-rag-toggle-bubble::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: 5px;
  width: 9px;
  height: 9px;
  background: #fff7d6;
  border-right: 1px solid #f2b33d;
  border-bottom: 1px solid #f2b33d;
  transform: rotate(-45deg);
}

.lamberti-rag-panel {
  width: min(380px, calc(100vw - 28px));
  height: 540px;
  max-height: calc(100vh - 110px);
  border: 1px solid #d9e1ef;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 46px rgba(18, 32, 55, .2);
  display: flex;
  flex-direction: column;
}

.lamberti-rag-floating .lamberti-rag-panel {
  display: none;
  position: absolute;
  right: 0;
  bottom: 146px;
}

.lamberti-rag-floating.is-open .lamberti-rag-panel {
  display: flex;
  animation: lambertiPanelIn .22s ease-out;
}

.lamberti-rag-floating.is-open .lamberti-rag-toggle {
  display: none;
}

.lamberti-rag-header {
  padding: 12px 14px;
  background: linear-gradient(90deg, #9e171a 0%, #e13622 34%, #f28f22 68%, #ffd447 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lamberti-rag-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lamberti-rag-header-title strong {
  text-shadow: 0 1px 2px rgba(0, 0, 0, .28);
}

.lamberti-rag-robot-avatar {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .16);
}

.lamberti-rag-close {
  border: 0;
  background: rgba(0, 0, 0, .18);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.lamberti-rag-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f9fc;
}

.lamberti-rag-message {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  animation: lambertiMessageIn .18s ease-out;
}

.lamberti-rag-message-assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.lamberti-rag-message-user {
  align-self: flex-end;
  background: #9e171a;
  color: #fff;
}

.lamberti-rag-sources {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: #526070;
}

.lamberti-rag-sources a {
  color: #9e171a;
  text-decoration: underline;
}

.lamberti-rag-privacy {
  margin: 0;
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1.35;
  color: #526070;
  background: #fff;
  border-top: 1px solid #edf2f7;
}

.lamberti-rag-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #d9e1ef;
  background: #fff;
}

.lamberti-rag-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 14px;
}

.lamberti-rag-input:focus {
  outline: 2px solid rgba(242, 143, 34, .35);
  border-color: #f28f22;
}

.lamberti-rag-send {
  border: 0;
  border-radius: 10px;
  padding: 10px 13px;
  background: #9e171a;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.lamberti-rag-send:hover,
.lamberti-rag-send:focus-visible {
  background: #c9271f;
}

.lamberti-rag-send:disabled,
.lamberti-rag-input:disabled {
  opacity: .65;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .lamberti-rag-floating {
    right: 12px;
    bottom: 10px;
  }

  .lamberti-rag-toggle {
    width: 92px;
    height: 112px;
  }

  .lamberti-rag-toggle-robot {
    width: 88px;
    height: 108px;
  }

  .lamberti-rag-toggle-bubble {
    display: none;
  }

  .lamberti-rag-floating .lamberti-rag-panel {
    bottom: 118px;
  }

  .lamberti-rag-panel {
    height: 78vh;
  }
}


.lamberti-rag-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.lamberti-rag-typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #f28f22;
  display: inline-block;
  animation: lambertiTypingBounce 1.15s infinite ease-in-out;
}

.lamberti-rag-typing span:nth-child(2) { animation-delay: .14s; }
.lamberti-rag-typing span:nth-child(3) { animation-delay: .28s; }

.lamberti-rag-floating.is-open .lamberti-rag-robot-avatar {
  animation: lambertiRobotFloat 3.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .lamberti-rag-toggle-robot,
  .lamberti-rag-toggle-bubble,
  .lamberti-rag-floating.is-open .lamberti-rag-panel,
  .lamberti-rag-message,
  .lamberti-rag-typing span,
  .lamberti-rag-robot-avatar {
    animation: none !important;
  }
}
