.dp-ai-live {
  padding: 16px 18px 22px;
  color: #f7f7fa;
  font-family: Montserrat, Arial, sans-serif;
}

.dp-ai-live[hidden],
.dp-ai-live [hidden],
.dp-ai-live-tools[hidden] {
  display: none !important;
}

.dp-ai-live-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}

.dp-ai-live-head img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  object-position: center 20%;
  border: 2px solid rgba(113,55,245,.65);
  border-radius: 50%;
}

.dp-ai-live-head > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.dp-ai-live-head span {
  color: #aeb0bc;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
}

.dp-ai-live-head strong {
  margin-top: 2px;
  color: #fff;
  font-size: 15px;
  line-height: 1.3;
}

.dp-ai-live-head small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: #bfc1ca;
  font-size: 10.5px;
}

.dp-ai-live-head small i,
.dp-ai-live-dot {
  width: 7px;
  height: 7px;
  background: #9c7bff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(113,55,245,.14);
}

.dp-ai-live-back {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  color: #d7caff;
  font-size: 10px;
  font-weight: 700;
  background: rgba(113,55,245,.14);
  border: 1px solid rgba(113,55,245,.42);
  border-radius: 50%;
  cursor: pointer;
}

.dp-ai-live h2 {
  margin: 0;
  color: #fff;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}

.dp-ai-live-start > p,
.dp-ai-live-unavailable > p {
  margin: 9px 0 18px;
  color: #bfc1ca;
  font-size: 13px;
  line-height: 1.62;
}

.dp-ai-live-start > label:not(.dp-ai-live-consent):not(.dp-ai-live-hp) {
  display: block;
  margin-top: 13px;
}

.dp-ai-live-start label > span:first-child {
  display: block;
  margin-bottom: 6px;
  color: #d9dae2;
  font-size: 11px;
  font-weight: 700;
}

.dp-ai-live-start input[type="text"],
.dp-ai-live-start input[type="email"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: #fff;
  font: 500 13px/1.4 Montserrat, Arial, sans-serif;
  background: #11131a;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  outline: none;
}

.dp-ai-live-start input:focus {
  border-color: rgba(113,55,245,.85);
  box-shadow: 0 0 0 3px rgba(113,55,245,.13);
}

.dp-ai-live-hp {
  position: absolute !important;
  left: -9999px !important;
}

.dp-ai-live-consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin-top: 16px;
  color: #aaacb7;
  font-size: 10.5px;
  line-height: 1.55;
}

.dp-ai-live-consent input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: #7137f5;
}

.dp-ai-live-consent a {
  color: #c6b5ff;
}

.dp-ai-live-start-button,
.dp-ai-live-external {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 10px 18px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  background: #7137f5;
  border: 1px solid #7137f5;
  border-radius: 999px;
  cursor: pointer;
}

.dp-ai-live-start-button:disabled {
  opacity: .55;
  cursor: wait;
}

.dp-ai-live-feedback,
.dp-ai-live-status {
  min-height: 18px;
  margin-top: 10px;
  color: #b9a5ff;
  font-size: 10.5px;
  line-height: 1.5;
}

.dp-ai-live-session {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 9px 10px;
  color: #c8cad2;
  font-size: 10.5px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 6px;
}

.dp-ai-live-session code {
  margin-left: auto;
  color: #bfaeff;
  font-size: 10px;
}

.dp-ai-live-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dp-ai-live-message {
  width: fit-content;
  max-width: 88%;
  padding: 11px 13px;
  color: #f6f6f8;
  font-size: 14px;
  line-height: 1.56;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #1a1c25;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px 12px 12px 3px;
}

.dp-ai-live-message.is-visitor {
  align-self: flex-end;
  color: #fff;
  background: #7137f5;
  border-color: #7137f5;
  border-radius: 12px 12px 3px 12px;
}

.dp-ai-live-message.is-system {
  align-self: center;
  max-width: 100%;
  padding: 7px 10px;
  color: #a8aab4;
  font-size: 10.5px;
  text-align: center;
  background: transparent;
  border: 0;
}

.dp-ai-live-message small {
  display: block;
  margin-top: 5px;
  color: rgba(255,255,255,.58);
  font-size: 9.5px;
  line-height: 1.35;
}

.dp-ai-live-media {
  margin-top: 8px;
}

.dp-ai-live-media img,
.dp-ai-live-media video {
  display: block;
  width: min(100%, 260px);
  max-height: 260px;
  object-fit: cover;
  border-radius: 6px;
}

.dp-ai-live-media audio {
  display: block;
  width: min(260px, 100%);
  height: 36px;
}

.dp-ai-live-media a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dp-ai-live-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
  align-items: center;
}

.dp-ai-live-tools button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  color: #d9ccff;
  font: 700 17px/1 Montserrat, Arial, sans-serif;
  background: rgba(113,55,245,.12);
  border: 1px solid rgba(113,55,245,.34);
  border-radius: 50%;
  cursor: pointer;
}

.dp-ai-live-tools button.is-recording {
  color: #fff;
  background: #d93d63;
  border-color: #d93d63;
  animation: dp-ai-live-pulse 1.1s ease-in-out infinite;
}

@keyframes dp-ai-live-pulse {
  50% { box-shadow: 0 0 0 7px rgba(217,61,99,.15); }
}

.dp-ai-live-unavailable {
  padding-top: 6px;
}

.dp-ai-live button:focus-visible,
.dp-ai-live a:focus-visible,
.dp-ai-live-tools button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .dp-ai-live {
    padding: 15px 15px 24px;
  }

  .dp-ai-live-message {
    max-width: 92%;
    font-size: 13.5px;
  }

  .dp-ai-live-tools {
    gap: 3px;
  }

  .dp-ai-live-tools button {
    width: 31px;
    height: 31px;
    font-size: 15px;
  }
}
/* Version 1.5.1: verständliche Rücknavigation und sichere Textumbrüche */
.dp-ai-live .dp-ai-live-back {
  display: inline-flex;
  width: auto;
  height: auto;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px 12px;
  color: #f7f7fa;
  font: 700 11px/1.2 Montserrat, Arial, sans-serif;
  background: #181a23;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
}

.dp-ai-live .dp-ai-live-head {
  grid-template-columns: 52px minmax(0, 1fr);
}

.dp-ai-panel .dp-ai-live h2 {
  max-width: 100%;
  margin: 0;
  font-size: 18px !important;
  line-height: 1.3 !important;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  letter-spacing: 0;
}

.dp-ai-live-head strong,
.dp-ai-live-head small,
.dp-ai-live-start label > span,
.dp-ai-live-session span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

.dp-ai-live-head small i,
.dp-ai-live-dot {
  flex: 0 0 auto;
}

@media (max-width: 560px) {
  .dp-ai-panel .dp-ai-live h2 {
    font-size: 17px !important;
  }
}

/* Version 1.6.0: stabiler Verlauf und wahrheitsgetreuer Anwesenheitsstatus */
.dp-ai-live-messages {
  min-height: 1px;
  outline: none;
  scroll-margin-block: 12px;
}

.dp-ai-live-presence.is-online i {
  background: #40c97a;
  box-shadow: 0 0 0 4px rgba(64,201,122,.14);
}

.dp-ai-live-presence.is-read i {
  background: #9c7bff;
  box-shadow: 0 0 0 4px rgba(156,123,255,.14);
}

.dp-ai-live-presence[hidden] {
  display: none !important;
}

/* Version 1.8.0: erste persönliche Nachricht direkt in den WhatsApp-vermittelten Chat übernehmen */
.dp-ai-live-start textarea.dp-ai-live-first-message {
  box-sizing: border-box;
  width: 100%;
  min-height: 76px;
  max-height: 118px;
  padding: 10px 12px;
  color: #fff;
  font: 500 13px/1.5 Montserrat, Arial, sans-serif;
  resize: vertical;
  background: #11131a;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  outline: none;
}

.dp-ai-live-start textarea.dp-ai-live-first-message:focus {
  border-color: rgba(113,55,245,.85);
  box-shadow: 0 0 0 3px rgba(113,55,245,.13);
}

@media (max-height: 700px) {
  .dp-ai-live {
    padding-top: 12px;
  }

  .dp-ai-live-head {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .dp-ai-live-start > p {
    margin-bottom: 10px;
  }

  .dp-ai-live-start > label:not(.dp-ai-live-consent):not(.dp-ai-live-hp) {
    margin-top: 9px;
  }

  .dp-ai-live-consent,
  .dp-ai-live-start-button {
    margin-top: 11px;
  }
}
