:root {
  --cb-radius: 12px;
  --cb-gap: 10px;
  --cb-shadow: 0 12px 30px rgba(0,0,0,.15);
  --cb-primary: #c51415; 
  --cb-hover: #e25b5c; 
  --cb-white: #fff;
  --cb-text: #1f2328;
  --cb-muted: #6e7781;
  --cb-bot: #f2f2ff;
  --cb-user: #e7f1ff;
}

.wp-chatbot {
  position: fixed;
  inset: auto 24px 24px auto;
  z-index: 99999;
  color: var(--cb-text);
}

.wp-chatbot[data-position="bottom-left"] {
  inset: auto auto 24px 24px;
}

.wp-chatbot[data-position="embed"] {
  position: relative;
  inset: unset;
}

/* Toggle button */
.wp-chatbot__toggle {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 0;
  background: var(--cb-primary);
  color: var(--cb-white);
  box-shadow: var(--cb-shadow);
  cursor: pointer;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.wp-chatbot__toggle span {
	color: #fff;
	position: absolute;
}

.wp-chatbot[data-position="embed"] .wp-chatbot__toggle {
  display: none;
}

body.show-chatbot .wp-chatbot__toggle {
  transform: rotate(90deg);
}

body.show-chatbot .wp-chatbot__toggle .wp-chatbot__open, .wp-chatbot__toggle .wp-chatbot__closed {
  opacity: 0;
}

body.show-chatbot .wp-chatbot__toggle .wp-chatbot__closed {
  opacity: 1;
}

/* Panel */
.wp-chatbot__panel {
  position: fixed;
  right: 24px;
  bottom: 90px;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 500px;
  background: var(--cb-white);
  border-radius: 16px;
  box-shadow: var(--cb-shadow);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(.98);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.wp-chatbot[data-position="bottom-left"] .wp-chatbot__panel {
  left: 24px;
  right: auto;
}

.wp-chatbot__panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.wp-chatbot[data-position="embed"] .wp-chatbot__panel {
  position: relative;
  width: 100%;
  height: 520px;
  right: auto; bottom: auto;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* Header */
.wp-chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 14px;
  background: var(--cb-primary);
  border-bottom: 1px solid var(--cb-primary);
  color: var(--cb-white);
} 

.wp-chatbot__title {
  color: var(--cb-white);
  font-weight: 600;
}

.wp-chatbot__close {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: var(--cb-white);
  transition: 0.2s ease;
}

.wp-chatbot__close:hover {
  background: var(--cb-hover);
}

/* Messages */
.wp-chatbot__messages {
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--cb-gap);
}

.wp-chatbot__bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--cb-radius);
  border-bottom-left-radius: 3px;
  line-height: 1.35;
  font-size: 1.45rem;
  background: var(--cb-bot);
  color: var(--cb-text);
}

.wp-chatbot__messages span.bot-avatar {
	height: 35px;
	width: 35px;
	padding: 6px;
	fill: #fff;
	flex-shrink: 0;
	margin-bottom: 2px;
	align-self: flex-end;
	background: #c51415;
	border-radius: 50%;
	background-image: url("../img/TUV-Favicon.png");
  background-size: contain;
  fill: none;
  background-position: center;
  background-repeat: no-repeat;
  display: inline-block;
}

.wp-chatbot__bubble.is-bot a {
  color: var(--cb-primary);
  text-decoration: underline;
}

.wp-chatbot__bubble.is-bot a:hover,
.wp-chatbot__bubble.is-bot a:focus {
  text-decoration: none;
}

.wp-chatbot__bubble.is-user {
  margin-left: auto;
  background: var(--cb-primary);
  color: var(--cb-white);
  border-radius: 13px 13px 3px 13px;
}

.wp-chatbot__bubble.is-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.wp-chatbot__bubble.is-typing span {
  width: 6px; height: 6px;
  background: #9aa4af;
  border-radius: 999px;
  animation: cb-bounce 1.1s infinite ease-in-out;
}
.wp-chatbot__bubble.is-typing span:nth-child(2) { animation-delay: .12s; }
.wp-chatbot__bubble.is-typing span:nth-child(3) { animation-delay: .24s; }

@keyframes cb-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .6; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.wp-block-container .wp-chatbot__references, .wp-chatbot__references {
  margin: 8px 0 0 0;
  /* display: inline-flex !important; */
  font-size: 13px;
}

.wp-block-container .wp-chatbot__references li, .wp-chatbot__references li {
  margin-bottom: 4px;
  padding-left: 0 !important;
  display: contents !important;
}

.wp-block-container .wp-chatbot__references li:before, .wp-chatbot__references li:before {
  margin-right: 0 !important;
  border: none !important;
  background-color: transparent !important;
  border-radius: 0 !important; 
}

.wp-block-container .wp-chatbot__references li a, .wp-chatbot__references li a {
  text-decoration: underline;
  display: inline-block;
  position: relative;
  background: transparent;
  color: var(--cb-primary);
  font-weight: bold;
}

/* Form */
.wp-chatbot__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #eef1f6;
  background: var(--cb-white);
}

.wp-chatbot__input {
  border: 1px solid #d0d7de;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1.45rem;
  outline: none;
  text-align: left;
}

.wp-chatbot__input:focus {
  border-color: var(--cb-white);
  box-shadow: 0 0 0 3px rgba(31,111,235,.12);
}

.wp-chatbot__send {
  background: var(--cb-primary);
  color: var(--cb-white);
  border: 0;
  border-radius: 100%;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
  width: 45px;
  height: 45px;
}

.wp-chatbot__send:hover {
 	background: var(--cb-hover);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Small screens */
@media (max-width: 480px) {
  .wp-chatbot__panel {
    width: calc(100vw - 20px);
    height: 70vh;
  }
}