/* KI24Solutions Chat-Widget. Farben und Radius wie die übrige Seite. */

.cwg-launcher,
.cwg-panel,
.cwg-panel * {
  box-sizing: border-box;
}

.cwg-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 220;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: #16763f;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(21, 30, 27, 0.28);
  transition: background 0.16s ease-out, transform 0.16s ease-out;
}

.cwg-launcher svg {
  width: 26px;
  height: 26px;
}

.cwg-launcher:hover {
  background: #105d30;
}

.cwg-launcher:active {
  transform: scale(0.97);
}

.cwg-launcher:focus-visible {
  outline: 2px solid #16763f;
  outline-offset: 3px;
}

.cwg-launcher.is-open {
  display: none;
}

.cwg-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 230;
  width: min(392px, calc(100vw - 32px));
  height: min(560px, calc(100svh - 40px));
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #1f262b;
  border: 1px solid #d6e3da;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(21, 30, 27, 0.28);
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
}

.cwg-panel[hidden] {
  display: none !important;
}

.cwg-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px 16px;
  background: #151e1b;
  color: #fff;
}

.cwg-head-text {
  min-width: 0;
}

.cwg-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.cwg-notice {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #c6d1ca;
}

.cwg-notice a {
  color: #93e6b3;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cwg-notice a:hover {
  color: #fff;
}

.cwg-notice a:focus-visible {
  outline: 2px solid #93e6b3;
  outline-offset: 2px;
}

.cwg-close {
  flex: none;
  width: 36px;
  height: 36px;
  margin: -4px -4px 0 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e8eee9;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.16s ease-out;
}

.cwg-close svg {
  width: 18px;
  height: 18px;
}

.cwg-close:hover {
  background: #24332d;
}

.cwg-close:focus-visible {
  outline: 2px solid #93e6b3;
  outline-offset: 2px;
}

.cwg-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px;
  background: #f3f6f4;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-color: #8aa394 #e6eee8;
}

.cwg-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.cwg-msg--bot,
.cwg-msg--system {
  align-self: flex-start;
  background: #fff;
  color: #1f262b;
  border: 1px solid #dce4df;
  box-shadow: 0 1px 2px rgba(21, 30, 27, 0.04);
}

.cwg-msg--user {
  align-self: flex-end;
  background: #16763f;
  color: #fff;
  border: 1px solid #16763f;
}

.cwg-msg--system {
  color: #3f5648;
  background: #edf5ef;
}

.cwg-msg a {
  color: #16763f;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cwg-msg--user a {
  color: #fff;
}

.cwg-msg a:focus-visible {
  outline: 2px solid #16763f;
  outline-offset: 2px;
}

.cwg-booking {
  align-self: flex-start;
  width: 100%;
  max-width: 92%;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #c5dfcc;
  box-shadow: 0 1px 2px rgba(21, 30, 27, 0.04);
}

.cwg-booking strong {
  display: block;
  font-size: 13px;
  color: #16763f;
  margin-bottom: 6px;
}

.cwg-booking p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #1f262b;
}

.cwg-booking a {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #16763f;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cwg-booking a:focus-visible {
  outline: 2px solid #16763f;
  outline-offset: 2px;
}

.cwg-booking-note {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #3f5648;
}

.cwg-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cwg-typing {
  position: relative;
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #dce4df;
  border-radius: 10px;
}

.cwg-typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.cwg-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16763f;
  opacity: 0.35;
  animation: cwg-dot 1.1s ease-in-out infinite;
}

.cwg-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.cwg-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes cwg-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.cwg-form {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #dce4df;
}

.cwg-input {
  width: 100%;
  min-height: 44px;
  max-height: 132px;
  resize: none;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid #d6e3da;
  border-radius: 10px;
  background: #f7fbf8;
  color: #1f262b;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  caret-color: #16763f;
}

.cwg-input:focus-visible {
  outline: 2px solid #16763f;
  outline-offset: 2px;
  background: #fff;
}

.cwg-input:disabled {
  opacity: 0.7;
}

.cwg-send {
  height: 44px;
  padding: 0 14px;
  border: 1px solid #16763f;
  border-radius: 10px;
  background: #16763f;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease-out;
}

.cwg-send:hover {
  background: #105d30;
}

.cwg-send:focus-visible {
  outline: 2px solid #16763f;
  outline-offset: 2px;
}

.cwg-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cwg-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  font-size: 11px;
  color: #56615b;
}

.cwg-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Kontaktkachel Chatbot als Schalter, optisch wie die anderen Kacheln. */
.kt-item-chat {
  display: contents;
}

button.kt-tile {
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

button.kt-tile .kt-tile-title {
  display: block;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: #16351f;
}

button.kt-tile .kt-tile-text {
  display: block;
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #4c6354;
  font-weight: 400;
}

@media (min-width: 1101px) {
  button.kt-tile .kt-tile-text {
    margin-top: 5px;
  }
}

@media (hover: hover) and (pointer: fine) {
  button.kt-tile:hover {
    border-color: #8cc5a0;
  }
}

button.kt-tile:focus-visible {
  outline: 2px solid #16763f;
  outline-offset: 2px;
}

@media (max-width: 650px) {
  .cwg-launcher {
    right: 14px;
    bottom: 14px;
    width: 52px;
    height: 52px;
  }

  .cwg-panel {
    inset: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cwg-launcher,
  .cwg-close,
  .cwg-send {
    transition: none;
  }

  .cwg-launcher:active {
    transform: none;
  }

  .cwg-typing-dots span,
  .cwg-typing--static .cwg-typing-dots span {
    animation: none;
    opacity: 0.7;
    transform: none;
  }
}
