:root {
  --sc-chat-orange: #ff7a18;
  --sc-chat-orange-2: #ff9d4d;
  --sc-chat-ink: #10151c;
}

#sc-chat-launch {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 9998;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--sc-chat-orange), var(--sc-chat-orange-2));
  box-shadow: 0 10px 30px rgba(255, 122, 24, .45), 0 2px 8px rgba(0, 0, 0, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s ease, box-shadow .25s ease;
  animation: sc-chat-pop .4s ease both;
}
#sc-chat-launch:hover { transform: translateY(-3px) scale(1.05); }
#sc-chat-launch svg { width: 28px; height: 28px; }
#sc-chat-launch .sc-chat-dot {
  position: absolute; top: 4px; right: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #18d36b; border: 2px solid #fff;
}
@keyframes sc-chat-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

#sc-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 9999;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 120px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(18, 21, 28, .82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  color: #f3f5f8;
  font-family: inherit;
}
#sc-chat-panel.sc-open { display: flex; animation: sc-chat-rise .28s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sc-chat-rise { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }

.sc-chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--sc-chat-orange), var(--sc-chat-orange-2));
  color: #fff;
}
.sc-chat-head .sc-ava {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.sc-chat-head .sc-ava svg { width: 22px; height: 22px; }
.sc-chat-head h4 { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.1; }
.sc-chat-head p  { margin: 2px 0 0; font-size: 11.5px; opacity: .9; }
.sc-chat-head .sc-status { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #18d36b; margin-right: 5px; }
.sc-chat-close {
  margin-left: auto; background: rgba(255, 255, 255, .15); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1;
}
.sc-chat-close:hover { background: rgba(255, 255, 255, .3); }

.sc-chat-body {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent;
}
.sc-chat-body::-webkit-scrollbar { width: 6px; }
.sc-chat-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 6px; }
.sc-msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.sc-msg.sc-bot  { align-self: flex-start; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255,255,255,.08); border-bottom-left-radius: 4px; }
.sc-msg.sc-user { align-self: flex-end; background: linear-gradient(135deg, var(--sc-chat-orange), var(--sc-chat-orange-2)); color: #fff; border-bottom-right-radius: 4px; }
.sc-msg a { color: var(--sc-chat-orange-2); }
.sc-msg.sc-user a { color: #fff; text-decoration: underline; }

.sc-chat-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 4px; }
.sc-chip {
  font-size: 12px; padding: 6px 11px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 122, 24, .14); color: var(--sc-chat-orange-2);
  border: 1px solid rgba(255, 122, 24, .35);
}
.sc-chip:hover { background: rgba(255, 122, 24, .26); }

.sc-typing { display: flex; gap: 4px; align-self: flex-start; padding: 12px 14px; background: rgba(255,255,255,.09); border-radius: 14px; border-bottom-left-radius: 4px; }
.sc-typing span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.6); animation: sc-blink 1.2s infinite both; }
.sc-typing span:nth-child(2) { animation-delay: .2s; }
.sc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes sc-blink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.sc-chat-foot { padding: 10px; border-top: 1px solid rgba(255, 255, 255, .1); background: rgba(0,0,0,.18); }
.sc-chat-form { display: flex; gap: 8px; align-items: flex-end; }
.sc-chat-form textarea {
  flex: 1; resize: none; max-height: 96px; min-height: 42px;
  padding: 11px 13px; border-radius: 12px; font: inherit; font-size: 13.5px; line-height: 1.4;
  color: #fff; background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14); outline: none;
}
.sc-chat-form textarea::placeholder { color: rgba(255,255,255,.45); }
.sc-chat-form textarea:focus { border-color: var(--sc-chat-orange); }
.sc-chat-send {
  flex: 0 0 auto; width: 42px; height: 42px; border: none; border-radius: 12px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--sc-chat-orange), var(--sc-chat-orange-2));
  display: flex; align-items: center; justify-content: center;
}
.sc-chat-send:disabled { opacity: .5; cursor: default; }
.sc-chat-send svg { width: 20px; height: 20px; }
.sc-chat-note { text-align: center; font-size: 10.5px; opacity: .55; margin: 6px 2px 0; }

@media (max-width: 480px) {
  #sc-chat-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 90px); }
  #sc-chat-launch { right: 16px; bottom: 84px; }
}
