.smart-kefu {
  --smart-kefu-primary: #0f766e;
  position: fixed;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.smart-kefu--bottom-right {
  right: 24px;
  bottom: 24px;
}

.smart-kefu--bottom-left {
  left: 24px;
  bottom: 24px;
}

.smart-kefu__launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  background: var(--smart-kefu-primary);
  color: #fff;
  padding: 14px 18px;
  box-shadow: 0 18px 40px rgba(15, 118, 110, 0.28);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.smart-kefu__launcher-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #99f6e4;
  box-shadow: 0 0 0 6px rgba(153, 246, 228, 0.18);
}

.smart-kefu__panel {
  width: min(380px, calc(100vw - 24px));
  height: 560px;
  margin-bottom: 14px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, #f7fffd 0%, #ffffff 22%);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.16);
  border: 1px solid rgba(15, 118, 110, 0.14);
  display: flex;
  flex-direction: column;
}

.smart-kefu__panel[hidden] {
  display: none !important;
}

.smart-kefu__header {
  background: linear-gradient(135deg, var(--smart-kefu-primary) 0%, #134e4a 100%);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.smart-kefu__header strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.smart-kefu__header div div {
  font-size: 12px;
  opacity: 0.84;
}

.smart-kefu__close,
.smart-kefu__send {
  border: 0;
  cursor: pointer;
}

.smart-kefu__close {
  background: transparent;
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.smart-kefu__messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  background:
    radial-gradient(circle at top right, rgba(153, 246, 228, 0.26), transparent 30%),
    linear-gradient(180deg, rgba(240, 253, 250, 0.7), rgba(255, 255, 255, 0.8));
}

.smart-kefu__message {
  display: flex;
  margin-bottom: 12px;
}

.smart-kefu__message--user {
  justify-content: flex-end;
}

.smart-kefu__bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.smart-kefu__message--assistant .smart-kefu__bubble {
  background: #fff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.smart-kefu__message--user .smart-kefu__bubble {
  background: var(--smart-kefu-primary);
  color: #fff;
}

.smart-kefu__composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

.smart-kefu__input {
  resize: none;
  min-height: 48px;
  max-height: 120px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}

.smart-kefu__input:focus {
  border-color: var(--smart-kefu-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.smart-kefu__send {
  border-radius: 16px;
  padding: 0 18px;
  background: var(--smart-kefu-primary);
  color: #fff;
  font-weight: 600;
}

.smart-kefu__meta {
  padding: 0 14px 14px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 640px) {
  .smart-kefu--bottom-right,
  .smart-kefu--bottom-left {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }

  .smart-kefu__panel {
    width: auto;
    height: min(72vh, 560px);
  }
}
