#sika-assistant-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99998;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#sika-assistant-launcher {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, #1e3a8a 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#sika-assistant-launcher:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
}

#sika-assistant-launcher .sika-pulse {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: sika-live-ring 1.8s infinite;
}

.sika-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 5px;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: sika-live-ring 1.8s infinite;
}

@keyframes sika-live-ring {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

#sika-greeting-bubble {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: 280px;
  background: linear-gradient(155deg, #f0338f 0%, #e91e8c 45%, #b8106a 100%);
  color: #fff;
  border-radius: 22px;
  border-bottom-right-radius: 6px;
  padding: 22px 24px 24px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.1px;
  white-space: pre-line;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow:
    0 4px 10px rgba(184, 16, 106, 0.25),
    0 18px 40px rgba(184, 16, 106, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#sika-greeting-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#sika-greeting-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  right: 26px;
  width: 16px;
  height: 16px;
  background: #b8106a;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0 0 4px 0;
  transform: rotate(45deg);
}

#sika-greeting-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sika-greeting-line-primary {
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: 0.15px;
}

.sika-greeting-line:not(.sika-greeting-line-primary) {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.92);
}

#sika-greeting-bubble .sika-greeting-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

#sika-greeting-bubble .sika-greeting-close:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

@keyframes sika-launcher-pop-in {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

#sika-assistant-launcher.sika-pop-in {
  animation: sika-launcher-pop-in 0.35s ease-out;
}

#sika-assistant-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.12);
}

#sika-assistant-panel.open {
  display: flex;
  animation: sika-panel-in 0.18s ease-out;
}

@keyframes sika-panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.sika-assistant-header {
  background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, #1e3a8a 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sika-assistant-header img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.sika-assistant-header .sika-title {
  flex: 1;
  min-width: 0;
}

.sika-assistant-header .sika-title strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.sika-assistant-header .sika-title span {
  font-size: 11px;
  opacity: 0.85;
}

.sika-assistant-header button {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sika-assistant-header button:hover {
  background: rgba(255, 255, 255, 0.28);
}

.sika-assistant-header button.active {
  background: #22c55e;
}

#sika-assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sika-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
}

.sika-msg.user {
  align-self: flex-end;
  background: var(--primary-color, #2563eb);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.sika-msg.model {
  align-self: flex-start;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.sika-msg.model p { margin: 0 0 8px; }
.sika-msg.model p:last-child { margin-bottom: 0; }
.sika-msg.model ul, .sika-msg.model ol { margin: 4px 0 8px 18px; padding: 0; }
.sika-msg.model strong { color: #1e3a8a; }
.sika-msg.model a { color: var(--primary-color, #2563eb); }

.sika-msg-time {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.6;
}

.sika-msg.user .sika-msg-time { text-align: right; color: #e0e7ff; }
.sika-msg.model .sika-msg-time { color: #64748b; }

.sika-cta-wrap {
  align-self: flex-start;
  max-width: 85%;
}

.sika-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, #1e3a8a 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sika-cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
  color: #fff;
}

.sika-cta-button::after {
  content: "\2192";
}

.sika-msg.error {
  align-self: flex-start;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.sika-msg.typing {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.sika-msg.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: sika-typing 1s infinite ease-in-out;
}

.sika-msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.sika-msg.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes sika-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.sika-assistant-input {
  border-top: 1px solid #e2e8f0;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: #fff;
}

.sika-assistant-input textarea {
  flex: 1;
  resize: none;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13.5px;
  max-height: 90px;
  min-height: 38px;
  font-family: inherit;
}

.sika-assistant-input textarea:focus {
  outline: none;
  border-color: var(--primary-color, #2563eb);
}

.sika-assistant-input button {
  border: none;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.sika-assistant-input .sika-send-btn {
  background: var(--primary-color, #2563eb);
  color: #fff;
}

.sika-assistant-input .sika-mic-btn {
  background: #f1f5f9;
  color: #1e3a8a;
}

.sika-assistant-input .sika-mic-btn.listening {
  background: #ef4444;
  color: #fff;
  animation: sika-mic-pulse 1s infinite;
}

@keyframes sika-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

@media (max-width: 480px) {
  #sika-assistant-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 88px;
  }
}
