:root {
  --chat-primary: #2563eb;
  --chat-primary-dark: #1d4ed8;
  --chat-bg: #ffffff;
  --chat-text: #1f2937;
  --chat-muted: #6b7280;
  --chat-border: #e5e7eb;
  --chat-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

#pasion-chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

.pasion-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--chat-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--chat-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.15s ease, background 0.15s ease;
}

.pasion-chat-toggle:hover {
  background: var(--chat-primary-dark);
  transform: scale(1.05);
}

.pasion-chat-toggle-label {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: #fff;
  color: var(--chat-text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid var(--chat-border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.pasion-chat-window {
  width: 380px;
  height: 500px;
  background: var(--chat-bg);
  border-radius: 12px;
  box-shadow: var(--chat-shadow);
  border: 1px solid var(--chat-border);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.pasion-chat-header {
  background: var(--chat-primary);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.pasion-chat-close {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

.pasion-chat-messages {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
  background: #f9fafb;
}

.pasion-chat-message {
  margin-bottom: 10px;
  display: flex;
}

.pasion-chat-message.user {
  justify-content: flex-end;
}

.pasion-chat-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.pasion-chat-bubble.waiting {
  color: var(--chat-muted);
  font-style: italic;
  position: relative;
}

.pasion-chat-bubble.waiting::after {
  content: " ...";
  animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: " ."; }
  40% { content: " .."; }
  60% { content: " ..."; }
  80%, 100% { content: " ...."; }
}

.pasion-chat-message.user .pasion-chat-bubble {
  background: var(--chat-primary);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.pasion-chat-message.ai .pasion-chat-bubble {
  background: #fff;
  color: var(--chat-text);
  border: 1px solid var(--chat-border);
  border-bottom-left-radius: 2px;
}

.pasion-chat-input {
  border-top: 1px solid var(--chat-border);
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
}

.pasion-chat-input textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--chat-border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  line-height: 1.4;
  height: 48px;
}

.pasion-chat-input button {
  background: var(--chat-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
}

.pasion-chat-disclaimer {
  padding: 8px 12px 12px;
  font-size: 11px;
  color: var(--chat-muted);
  background: #fff;
  border-top: 1px dashed var(--chat-border);
}

.pasion-chat-error {
  color: #b91c1c;
  font-size: 12px;
  padding: 4px 8px;
}

@media (max-width: 520px) {
  .pasion-chat-window {
    width: 90vw;
    height: 70vh;
    right: 5vw;
    bottom: 90px;
  }
}
