#yai-cs-root {
  --yai-primary: #0f766e;
  color: #172426;
  font-family: Arial, Helvetica, sans-serif;
}

.yai-cs-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99999;
  min-width: 190px;
  height: 68px;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--yai-primary);
  color: #fff;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  animation: yai-cs-attention 2.8s ease-in-out infinite;
}

.yai-cs-launcher-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.yai-cs-launcher-text {
  display: block;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yai-cs-close svg,
.yai-cs-send svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.yai-cs-launcher svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.yai-cs-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.32);
}

@keyframes yai-cs-attention {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.yai-cs-panel {
  position: fixed;
  right: 22px;
  bottom: 94px;
  z-index: 99999;
  width: min(380px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 120px));
  min-height: 460px;
  background: #fff;
  border: 1px solid rgba(19, 39, 42, 0.12);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  display: none;
  flex-direction: column;
}

.yai-cs-panel.is-open {
  display: flex;
}

.yai-cs-header {
  background: var(--yai-primary);
  color: #fff;
  min-height: 62px;
  padding: 0 14px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.yai-cs-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.yai-cs-subtitle {
  font-size: 12px;
  opacity: 0.84;
  margin-top: 2px;
}

.yai-cs-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.yai-cs-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f6f8f8;
}

.yai-cs-message {
  max-width: 86%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.yai-cs-message.bot {
  background: #fff;
  border: 1px solid rgba(19, 39, 42, 0.08);
  margin-right: auto;
}

.yai-cs-message.user {
  background: var(--yai-primary);
  color: #fff;
  margin-left: auto;
}

.yai-cs-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 16px 12px;
  background: #f6f8f8;
}

.yai-cs-quick button {
  border: 1px solid rgba(15, 118, 110, 0.24);
  color: var(--yai-primary);
  background: #fff;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.yai-cs-actions {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid rgba(19, 39, 42, 0.08);
  background: #fff;
}

.yai-cs-actions a {
  flex: 1;
  text-align: center;
  color: var(--yai-primary);
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 6px;
  padding: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.yai-cs-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(19, 39, 42, 0.08);
  background: #fff;
}

.yai-cs-input {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 1px solid rgba(19, 39, 42, 0.18);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  height: 42px;
  max-height: 96px;
}

.yai-cs-send {
  width: 44px;
  height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--yai-primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.yai-cs-send:disabled {
  opacity: 0.55;
  cursor: wait;
}

@media (max-width: 520px) {
  .yai-cs-launcher {
    right: 16px;
    bottom: 16px;
    min-width: 166px;
    height: 62px;
    padding: 0 16px 0 12px;
    font-size: 14px;
  }

  .yai-cs-launcher-icon {
    width: 38px;
    height: 38px;
  }

  .yai-cs-launcher svg {
    width: 28px;
    height: 28px;
  }

  .yai-cs-panel {
    right: 10px;
    bottom: 84px;
    width: calc(100vw - 20px);
    height: min(620px, calc(100vh - 104px));
  }
}
