.oc-ai-chatbot {
  --oc-ai-shadow: 0 22px 70px rgba(15, 23, 42, .22);
  bottom: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: fixed;
  z-index: 99999;
}

.oc-ai-chatbot--right {
  right: 22px;
}

.oc-ai-chatbot--left {
  left: 22px;
}

.oc-ai-chatbot * {
  box-sizing: border-box;
}

.oc-ai-chatbot__launcher {
  align-items: center;
  background: linear-gradient(135deg, var(--oc-ai-brand), var(--oc-ai-accent));
  border: 0;
  border-radius: 999px;
  box-shadow: var(--oc-ai-shadow);
  color: #fff;
  cursor: pointer;
  display: flex;
  height: 62px;
  justify-content: center;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
  width: 62px;
}

.oc-ai-chatbot__launcher:hover {
  box-shadow: 0 26px 80px rgba(15, 23, 42, .3);
  transform: translateY(-2px);
}

.oc-ai-chatbot__launcher-icon {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
}

.oc-ai-chatbot__launcher-dot {
  background: #22c55e;
  border: 3px solid #fff;
  border-radius: 999px;
  bottom: 2px;
  height: 16px;
  position: absolute;
  right: 2px;
  width: 16px;
}

.oc-ai-chatbot.has-unread .oc-ai-chatbot__launcher-dot {
  animation: ocAiUnread 1.25s infinite ease-in-out;
  background: var(--oc-ai-accent);
}

.oc-ai-chatbot__panel {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  bottom: 78px;
  box-shadow: var(--oc-ai-shadow);
  display: flex;
  flex-direction: column;
  height: min(620px, calc(100vh - 112px));
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  transform: translateY(12px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
  width: min(390px, calc(100vw - 28px));
}

.oc-ai-chatbot--right .oc-ai-chatbot__panel {
  right: 0;
}

.oc-ai-chatbot--left .oc-ai-chatbot__panel {
  left: 0;
}

.oc-ai-chatbot.is-open .oc-ai-chatbot__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.oc-ai-chatbot__header {
  align-items: center;
  background: linear-gradient(135deg, var(--oc-ai-brand), #273449);
  color: #fff;
  display: flex;
  gap: 12px;
  padding: 16px;
}

.oc-ai-chatbot__avatar {
  align-items: center;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  display: flex;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.oc-ai-chatbot__header strong,
.oc-ai-chatbot__header span {
  display: block;
  line-height: 1.2;
}

.oc-ai-chatbot__header span {
  color: rgba(255, 255, 255, .75);
  font-size: 12px;
  margin-top: 4px;
}

.oc-ai-chatbot__clear,
.oc-ai-chatbot__close {
  background: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  height: 36px;
  width: 36px;
}

.oc-ai-chatbot__clear {
  font-size: 18px;
  line-height: 34px;
  margin-left: auto;
}

.oc-ai-chatbot__close {
  font-size: 24px;
  line-height: 32px;
}

.oc-ai-chatbot__messages {
  background:
    linear-gradient(180deg, rgba(245, 158, 11, .08), transparent 180px),
    #f8fafc;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.oc-ai-chatbot__message {
  border-radius: 8px;
  clear: both;
  font-size: 14px;
  line-height: 1.48;
  margin: 0 0 10px;
  max-width: 84%;
  padding: 11px 12px;
  word-wrap: break-word;
}

.oc-ai-chatbot__message--bot {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  color: #182230;
  float: left;
}

.oc-ai-chatbot__message--user {
  background: var(--oc-ai-brand);
  color: #fff;
  float: right;
}

.oc-ai-chatbot__message--operator {
  background: #fff7ed;
  border: 1px solid rgba(245, 158, 11, .34);
  color: #1f2937;
  float: left;
}

.oc-ai-chatbot__message--typing {
  align-items: center;
  display: flex;
  gap: 5px;
  min-height: 38px;
  width: 62px;
}

.oc-ai-chatbot__message--typing span {
  animation: ocAiPulse 1s infinite ease-in-out;
  background: #94a3b8;
  border-radius: 999px;
  height: 6px;
  width: 6px;
}

.oc-ai-chatbot__message--typing span:nth-child(2) {
  animation-delay: .12s;
}

.oc-ai-chatbot__message--typing span:nth-child(3) {
  animation-delay: .24s;
}

.oc-ai-chatbot__products {
  clear: both;
  display: grid;
  gap: 8px;
  margin: 4px 0 12px;
}

.oc-ai-chatbot__product {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .09);
  border-radius: 8px;
  color: #111827;
  display: flex;
  gap: 10px;
  padding: 8px;
  text-decoration: none;
}

.oc-ai-chatbot__product:hover {
  border-color: var(--oc-ai-accent);
  color: #111827;
  text-decoration: none;
}

.oc-ai-chatbot__product img {
  border-radius: 8px;
  height: 54px;
  object-fit: cover;
  width: 54px;
}

.oc-ai-chatbot__product-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.oc-ai-chatbot__product strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oc-ai-chatbot__product em {
  color: var(--oc-ai-accent);
  font-style: normal;
  font-weight: 700;
}

.oc-ai-chatbot__composer {
  align-items: center;
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, .08);
  display: flex;
  gap: 8px;
  padding: 12px;
}

.oc-ai-chatbot__composer input,
.oc-ai-chatbot__lead input {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  color: #111827;
  font: inherit;
  min-height: 42px;
  outline: 0;
  padding: 0 12px;
  width: 100%;
}

.oc-ai-chatbot__composer input:focus,
.oc-ai-chatbot__lead input:focus {
  border-color: var(--oc-ai-accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .16);
}

.oc-ai-chatbot__composer button,
.oc-ai-chatbot__lead-actions button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
}

.oc-ai-chatbot__composer button[type="submit"] {
  background: var(--oc-ai-accent);
  color: #111827;
  flex: 0 0 46px;
  font-size: 18px;
}

.oc-ai-chatbot__lead-open {
  background: #eef2ff;
  color: var(--oc-ai-brand);
  flex: 0 0 42px;
}

.oc-ai-chatbot__lead {
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, .08);
  padding: 12px;
}

.oc-ai-chatbot__lead-grid {
  display: grid;
  gap: 8px;
}

.oc-ai-chatbot__lead-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.oc-ai-chatbot__lead-actions button {
  padding: 0 14px;
}

.oc-ai-chatbot__lead-actions button[type="button"] {
  background: #e5e7eb;
  color: #111827;
}

.oc-ai-chatbot__lead-actions button[type="submit"] {
  background: var(--oc-ai-brand);
  color: #fff;
}

.oc-ai-chatbot__composer.is-loading {
  opacity: .72;
}

@keyframes ocAiPulse {
  0%, 80%, 100% {
    opacity: .35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes ocAiUnread {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
}

@media (max-width: 480px) {
  .oc-ai-chatbot {
    bottom: 14px;
    left: 14px;
    right: 14px;
  }

  .oc-ai-chatbot--left,
  .oc-ai-chatbot--right {
    left: 14px;
    right: 14px;
  }

  .oc-ai-chatbot__panel {
    bottom: 76px;
    height: min(620px, calc(100vh - 104px));
    left: 0;
    right: 0;
    width: 100%;
  }

  .oc-ai-chatbot--right .oc-ai-chatbot__launcher {
    margin-left: auto;
  }
}
