#musicstartx-chat-root {
  all: initial;
}

#musicstartx-chat-root,
#musicstartx-chat-root * {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

.msx-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 999999;
  background: linear-gradient(135deg, #0f172a, #2563eb);
  color: #fff;
  font-size: 26px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.msx-chat-launcher:hover {
  transform: scale(1.05);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

.msx-chat-launcher.msx-hidden {
  opacity: 0;
  pointer-events: none;
}

.msx-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 100px;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 600px;
  max-height: calc(100vh - 130px);
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  z-index: 999999;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  display: none;
  flex-direction: column;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.msx-chat-panel.msx-open {
  display: flex;
}

.msx-chat-header {
  background: linear-gradient(135deg, #111827, #2563eb);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.msx-chat-header-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.msx-chat-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.msx-chat-subtitle {
  font-size: 12px;
  opacity: 0.9;
}

.msx-chat-close {
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
}

.msx-chat-body {
  flex: 1;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.05), transparent 26%),
    radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.05), transparent 28%),
    #f8fafc;
  padding: 14px;
}

.msx-chat-msg-row {
  display: flex;
  margin-bottom: 12px;
}

.msx-chat-msg-row.user {
  justify-content: flex-end;
}

.msx-chat-msg-row.bot {
  justify-content: flex-start;
}

.msx-chat-bubble {
  max-width: 85%;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.msx-chat-msg-row.bot .msx-chat-bubble {
  background: #ffffff;
  color: #0f172a;
  border-top-left-radius: 6px;
}

.msx-chat-msg-row.user .msx-chat-bubble {
  background: #2563eb;
  color: #fff;
  border-top-right-radius: 6px;
}

.msx-chat-products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 8px 0 14px;
}

.msx-product-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.msx-product-image-wrap {
  width: 100%;
  height: 170px;
  overflow: hidden;
  background: #e5e7eb;
}

.msx-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #e5e7eb;
}

.msx-product-content {
  padding: 12px;
}

.msx-product-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

.msx-product-desc {
  font-size: 13px;
  line-height: 1.4;
  color: #334155;
  margin-bottom: 10px;
}

.msx-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.msx-product-price {
  font-size: 15px;
  font-weight: 700;
  color: #2563eb;
}

.msx-product-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 10px;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.msx-product-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.msx-chat-footer {
  background: #ffffff;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 12px;
}

.msx-chat-form {
  display: flex;
  gap: 8px;
}

.msx-chat-input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 12px 13px;
  font-size: 14px;
  outline: none;
}

.msx-chat-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.msx-chat-send {
  border: none;
  background: #2563eb;
  color: #fff;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.msx-chat-send:disabled {
  opacity: 0.6;
  cursor: default;
}

.msx-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 14px;
  border-top-left-radius: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.msx-chat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: msx-bounce 1.2s infinite ease-in-out;
}

.msx-chat-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.msx-chat-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes msx-bounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.55; }
  40% { transform: scale(1.1); opacity: 1; }
}

@media (max-width: 640px) {
  .msx-chat-panel {
    right: 10px;
    left: 10px;
    bottom: 84px;
    width: auto;
    height: 72vh;
    max-height: 72vh;
  }

  .msx-chat-launcher {
    right: 14px;
    bottom: 14px;
    width: 60px;
    height: 60px;
  }

  .msx-product-image-wrap {
    height: 150px;
  }
}
