.si-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
  z-index: 9999;
  transition: transform 0.2s, box-shadow 0.2s;
}
.si-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(14, 165, 233, 0.45);
}
.si-chat-toggle svg {
  width: 26px;
  height: 26px;
  fill: white;
}

.si-chat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 380px;
  max-height: 520px;
  background: #0c1a2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  display: none;
  flex-direction: column;
  z-index: 9998;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.si-chat-panel.open {
  display: flex;
}

.si-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.si-chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.si-chat-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
}
.si-chat-header-icon svg {
  width: 18px;
  height: 18px;
  fill: white;
}
.si-chat-header-title {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
}
.si-chat-header-sub {
  font-size: 11px;
  color: #64748b;
}
.si-chat-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s;
}
.si-chat-close:hover {
  color: #e2e8f0;
}

.si-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: 340px;
}
.si-chat-messages::-webkit-scrollbar {
  width: 4px;
}
.si-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.si-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.si-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: #e2e8f0;
  word-wrap: break-word;
}
.si-msg-user {
  align-self: flex-end;
  background: #0ea5e9;
  color: white;
  border-bottom-right-radius: 4px;
}
.si-msg-assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border-bottom-left-radius: 4px;
}
.si-msg-assistant p {
  margin: 0 0 8px 0;
}
.si-msg-assistant p:last-child {
  margin-bottom: 0;
}
.si-msg-assistant strong {
  color: #93c5fd;
  font-weight: 600;
}
.si-msg-assistant ol,
.si-msg-assistant ul {
  margin: 6px 0;
  padding-left: 20px;
}
.si-msg-assistant li {
  margin: 3px 0;
}

.si-msg-welcome {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
}
.si-msg-welcome strong {
  color: #e2e8f0;
}

.si-chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}
.si-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  animation: si-bounce 1.2s ease-in-out infinite;
}
.si-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.si-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes si-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

.si-chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}
.si-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #e2e8f0;
  outline: none;
  font-family: inherit;
  resize: none;
  min-height: 20px;
  max-height: 80px;
}
.si-chat-input::placeholder {
  color: #475569;
}
.si-chat-input:focus {
  border-color: rgba(14, 165, 233, 0.4);
}
.si-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #0ea5e9;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.si-chat-send:hover {
  background: #0284c7;
}
.si-chat-send:disabled {
  background: #1e3a5f;
  cursor: not-allowed;
}
.si-chat-send svg {
  width: 16px;
  height: 16px;
  fill: white;
}

@media (max-width: 440px) {
  .si-chat-panel {
    right: 8px;
    left: 8px;
    bottom: 88px;
    width: auto;
    max-height: 70vh;
  }
  .si-chat-toggle {
    bottom: 16px;
    right: 16px;
  }
}
