.cb-chat-root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Arial,
    sans-serif;
}
.chat-launcher {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9999;
  width: 72px;
  height: 72px;
  padding: 4px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #0c1a34;
  color: #fff;
  box-shadow: 0 10px 28px #07112445;
  cursor: pointer;
  isolation: isolate;
}
.chat-launcher img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.chat-launcher-badge {
  position: absolute;
  right: -4px;
  bottom: -5px;
  z-index: 1;
  padding: 3px 7px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #2c66e8;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}
.chat-launcher[hidden],
.chat-panel[hidden] {
  display: none;
}
.chat-panel {
  height: 650px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #304968;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  box-shadow: 0 16px 42px #040b192f;
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 18px;
  background: #0c1a34;
  color: #fff;
}
.chat-header small {
  display: block;
  color: #c4d2e8;
}
.chat-close {
  border: 0;
  background: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.chat-panel:not(.floating) .chat-close {
  display: none;
}
.chat-mode {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  background: #edf3fa;
  border-bottom: 1px solid #dbe3ee;
  font-size: 0.78rem;
}
.chat-mode label {
  display: flex;
  align-items: center;
  gap: 5px;
}
.chat-mode input {
  width: auto;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  background: #f4f7fb;
}
.chat-message {
  max-width: 87%;
  margin: 0 0 12px;
  padding: 11px 13px;
  border-radius: 9px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.chat-message.assistant {
  border: 1px solid #dbe3ee;
  background: #fff;
}
.chat-message.user {
  margin-left: auto;
  background: #2c66e8;
  color: #fff;
}
.chat-message.pending {
  color: #667386;
}
.chat-message.error {
  border-color: #e2b6b1;
  color: #8d2923;
}
.chat-message.summary {
  max-width: 100%;
  border-left: 4px solid #20c7df;
}
.chat-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 16px;
}
.chat-choices button,
.chat-confirmation button {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #2c66e8;
  border-radius: 5px;
  background: #fff;
  color: #15335e;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.chat-choices button:hover {
  background: #eaf0fa;
}
.chat-choices button:disabled {
  opacity: 0.52;
}
.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #dbe3ee;
}
.chat-input {
  flex: 1;
  min-width: 0;
  max-height: 105px;
  padding: 11px;
  border: 1px solid #9aabc0;
  border-radius: 6px;
  resize: vertical;
  font: inherit;
  font-size: 16px;
}
.chat-send {
  min-height: 44px;
  padding: 0 15px;
  border: 0;
  border-radius: 6px;
  background: #2c66e8;
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}
.chat-send:disabled {
  opacity: 0.55;
}
.chat-note {
  padding: 0 10px 10px;
  text-align: center;
  color: #647084;
  font-size: 11px;
}

/* Gleiche Eingabezeile wie bei den bestehenden CB-IT-Chatbots */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.chat-form {
  width: 100%;
  flex: 0 0 auto;
}
.chat-form .chat-input {
  width: 100%;
  min-height: 60px;
  box-sizing: border-box;
}
.chat-form .chat-send {
  flex: 0 0 auto;
  min-width: 86px;
  min-height: 60px;
}
.chat-confirmation {
  margin: 4px 0 16px;
  padding: 13px;
  border: 1px solid #b6c8df;
  border-radius: 7px;
  background: #eef4fb;
  font-size: 0.84rem;
}
.chat-confirmation p {
  margin: 0 0 10px;
}
.chat-confirmation div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chat-confirmation .chat-confirm-send {
  border-color: #2c66e8;
  background: #2c66e8;
  color: #fff;
}
.chat-confirmation .chat-confirm-edit {
  border-color: #76869b;
}
.chat-panel.floating {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9999;
  width: min(420px, calc(100vw - 28px));
  height: min(650px, calc(100dvh - 36px));
}
.chat-launcher:focus-visible,
.chat-close:focus-visible,
.chat-send:focus-visible,
.chat-choices button:focus-visible,
.chat-confirmation button:focus-visible,
.chat-input:focus-visible {
  outline: 3px solid #20c7df;
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .chat-panel.floating {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .chat-mode {
    padding-inline: 10px;
  }
  .chat-choices {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 360px) {
  .chat-mode {
    flex-direction: column;
    gap: 4px;
  }
}
