#sc-chat-btn {
  position: fixed;
  bottom: 1.35rem;
  right: 1.35rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #e49815, #ffc857);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(26, 39, 68, 0.4);
  z-index: 1200;
  display: grid;
  place-items: center;
}

#sc-chat-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.35rem;
  width: min(400px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - 7rem));
  background: #f9fafc;
  border-radius: 16px;
  box-shadow: 0 20px 52px rgba(15, 23, 40, 0.28);
  border: 1px solid #cfd6e2;
  z-index: 1201;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#sc-chat-panel.hidden {
  display: none !important;
}

.sc-chat-header {
  padding: 0.75rem 1rem;
  background: linear-gradient(145deg, #e49815, #ffc857);
  color: black;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sc-chat-header h4 {
  margin: 0;
  font-weight: 500; 
  font-family: 'Inter', sans-serif;
}

#sc-chat-close {
  border: none;
  background: transparent;
  color: black;
  cursor: pointer;
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

#sc-chat-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

#sc-chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sc-msg {
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  max-width: 92%;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sc-msg.bot {
  align-self: flex-start;
  background: #eef2f8;
  border: 1px solid #dbe2ee;
  color: #1f2937;
}

.sc-msg.bot.sc-msg--transient {
  opacity: 0.9;
  font-size: 0.86rem;
  border-style: dashed;
}

.sc-msg.sc-typing {
  min-width: 54px;
  padding: 0.55rem 0.7rem;
}

.sc-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sc-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4b5563;
  opacity: 0.35;
  animation: scTypingPulse 1.2s infinite ease-in-out;
}

.sc-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.sc-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes scTypingPulse {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.35;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.sc-msg.user {
  align-self: flex-end;
  margin-left: auto;
  background: linear-gradient(145deg, #e49815, #ffc857);
  color: #1a1f2b;
}

.sc-chat-footer {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem;
  border-top: 1px solid #d0d8e5;
  background: #ffffff;
}

#sc-chat-input {
  flex: 1;
  resize: none;
  min-height: 42px;
  max-height: 42px;
  height: 42px;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid #d0d8e5;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.9rem;
  color: #1f2937;
}

#sc-chat-input:focus {
  outline: none;
  border-color: #e49815;
  box-shadow: 0 0 0 3px rgba(228, 152, 21, 0.15);
}

#sc-chat-send {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e49815, #ffc857);
  box-shadow: 0 5px 14px rgba(228, 152, 21, 0.35);
  color: #fff;
  flex-shrink: 0;
}

#sc-chat-send:hover {
  transform: translateY(-1px);
}
