/* ==========================================================
   KI-Chat (plchat): Grundstile
   Ursprüngliche Stile des Chats (vorher in style.css).
   Die Optik nach Prototyp A1 überschreibt Teile davon in toni-chat.css.
   ========================================================== */
.plchat{
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 45px;
}

.plchat-out{
  flex: 1 1 auto;
  overflow-y: auto;
  border: 1px solid #ddd;
  padding: 18px;
  border-radius: 14px;
  background: #fff;
  white-space: pre-wrap;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plchat-composer{
  position: relative;
  margin-top: 12px;
}

.plchat-input{
  width: 100%;
  min-height: 120px;
  padding: 18px 64px 18px 18px;
  border-radius: 14px;
  border: 1px solid #e6e6e6;
  background: #f4f4f4;
  resize: vertical;
  box-sizing: border-box;
}
.plchat-input:focus{
	border-color: #e6e6e6;
}
.plchat-send{
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: var(--color-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
  z-index: 2;
  padding: 0;
}

.plchat-send:hover{
  transform: translateY(-2px);
}

.plchat-send svg{
	position: relative;
	left: 1px;
}

.plchat-spinner{
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: none;
  z-index: 3;
}

.plchat-spinner::before{
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px solid rgba(255,255,255,0.55);
  border-top-color: #fff;
  border-radius: 50%;
  animation: plchatSpin 0.8s linear infinite;
}

.plchat.is-loading .plchat-input{
  opacity: 0.75;
  pointer-events: none;
}

.plchat.is-loading .plchat-send{
  opacity: 0;
  pointer-events: none;
}

.plchat.is-loading .plchat-spinner{
  display: block;
}

.plchat-new{
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--color-blue);
  font-family: Barlow;
	font-size: 15px;
	font-style: normal;
  font-weight: 600;
  letter-spacing: 1.44px;
  text-transform: uppercase;
  cursor: pointer;
  padding: 5px 0;
  align-self: center;
}

.plchat-msg{
  line-height: 1.4;
  white-space: pre-wrap;
}

.plchat-msg--user{
  align-self: flex-end;
  background: var(--color-blue);
 
  padding: 5px 10px;
  border-radius: 10px;
  max-width: 85%;

  color: #FFF;
font-family: Barlow;
font-size: 16px;
font-style: normal;
font-weight: 700;
line-height: 28px;
}

.plchat-msg--ai{
  align-self: flex-start;  
  max-width: 95%;
  color: #323232;
	font-family: Barlow;
	font-size: 17px;
	font-style: normal;
	font-weight: 400;
	line-height: 23.8px;

}

.plchat-msg--sys{
  align-self: flex-start;
  color: #666;
  font-style: italic;
}

.plchat-scrollDown{
  position: absolute;
  right: 18px;
  bottom: 190px;
  z-index: 10;
  width: 45px;
  height: 45px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  display: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.22);
}

.plchat-scrollDown.is-visible{
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.plchat-scrollDown.is-visible img{
  width: 25px;
  height: 25px;
  max-width: unset;
}

/* Quellen */
.plchat-sources{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e8e8e8;
  font-size: 0.95rem;
}

.plchat-sources-title{
  font-weight: 800;
  margin-bottom: 6px;
}

.plchat-source-line{
  margin: 6px 0;
}

.plchat-sources-list{
  margin: 6px 0 0 18px;
}

.plchat-sources a{
  text-decoration: underline;
  word-break: break-word;
}

.plchat-md-ul{
  margin: 8px 0 12px;
  padding-left: 22px;
}

.plchat-md-ul li{
  margin: 6px 0;
  color: #323232;
font-family: Barlow;
font-size: 16px;
font-style: normal;
font-weight: 400;
line-height: 140%;
padding-left: 16px !important;
}
.plchat-md-ul li::before{
	content: "";
  display: block;
  width: 6.8px !important;
  height: 13.7px !important;
  top: 5px !important;
}
/* KI-Bot Widget/Modal */
.plchat-modal-trigger{
  position: fixed;
  right: 0;
  bottom: 60%;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  padding: 0;
  z-index: 999999;
  background: #0575E5;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  transition: all 0.3s ease-in;
  overflow: hidden;
}

.plchat-modal-trigger img{
  width: 180%;
  height: 180%;
  object-position: 50% -20px;
  display: block;
  border-radius: 999px;
  object-fit: cover;
}

.plchat-modal-trigger:hover{
  transform: translateY(-5px) scale(1.05);
}

.plchat-modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999998;
  display: none;
}

.plchat-modal-backdrop.is-open{
  display: none;
}

.plchat-modal{
  position: fixed;
  right: 70px;
  top: 242px;
  width: 662px;
  height: 73vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.25);
  z-index: 999999;
  display: none;
  overflow: hidden;
}

.plchat-modal.is-open{
  display: flex;
  flex-direction: column;
}

.plchat-modal.is-maximized{
  width: min(1280px, calc(100vw - 90px));
}

.plchat-modal-header{
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #eee;
}

.plchat-modal-title{
  color: #323232;
font-family: Montserrat;
font-size: 18px;
font-style: normal;
font-weight: 600;
line-height: 140%;
}

.plchat-modal-actions{
  display: inline-flex;
  align-items: center;
  gap: 0px;
}

.plchat-modal-maximize{
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: #0e0d0d;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.plchat-modal-maximize svg.plchat-icon{
  width: 22px;
  height: 22px;
  display: block;
  min-width: 22px;  
}

.plchat-modal-maximize svg.plchat-icon.plchat-icon--collapse{
  display: none;
}

.plchat-modal.is-maximized .plchat-modal-maximize svg.plchat-icon.plchat-icon--expand{
  display: none;
}

.plchat-modal.is-maximized .plchat-modal-maximize svg.plchat-icon.plchat-icon--collapse{
  display: block;
}

.plchat-modal-close{
  width: 16.5px;
  height: 16.5px;
  cursor: pointer;
  border: 0;
  background: #878787;
  mask-image: url('/wp-content/uploads/icon_close.svg');
  mask-repeat: no-repeat;
  mask-size: 16.5px;
  mask-position: center;
  -webkit-mask-image: url('/wp-content/uploads/icon_close.svg');
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 16.5px;
  -webkit-mask-position: center;
}

.plchat-modal-body{
  flex: 1;
  overflow: hidden;
  padding: 16px;
  display: flex;
}

.plchat-modal-body .plchat{
  flex: 1;
}

@media (max-width: 768px){
  .plchat-modal{
    left: 5vw;
    right: auto;
    top: 6vh;
    width: 90vw;
    height: 88vh;
  }

  .plchat-modal.is-maximized{
    width: 90vw;
  }

  .plchat-scrollDown{
    bottom: 200px;
  }
}

@keyframes plchatSpin { to { transform: rotate(360deg); } }
.hinweis-ki-bot{	
	width: 100%;
	height: auto;
	font-size: 12px;
	font-weight: 400;
	padding: 0 16px 8px;
}
.hinweis-ki-bot a {
	text-decoration: underline;
}

/* Vorschlags-Buttons */
.plchat-suggestions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.plchat-suggestion{
 align-self: flex-end;
  background: var(--color-blue);
  padding: 5px 10px;
  border-radius: 10px;
  max-width: 85%;
  color: #FFF;
  font-family: Barlow;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 28px;
  transition: transform 0.15s ease-out, background 0.15s ease-out, border-color 0.15s ease-out;
  text-align: start;
}

.plchat-suggestion:hover{
  transform: translateY(-1px);
  background: #f7f7f7;
  border-color: #d8d8d8;
  color: var(--color-blue);
}

.plchat.is-loading .plchat-suggestion{
  opacity: 0.5;
  pointer-events: none;
}
