/* ── Floating trigger (pill button) ─────────────────────────────────────── */
.fc-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #635BFF;
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99,91,255,0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.fc-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99,91,255,0.58);
}

/* ── Chat window ──────────────────────────────────────────────────────────── */
.fc-window {
  position: fixed;
  bottom: 84px;
  right: 24px;
  z-index: 9001;
  width: 380px;
  height: 520px;
  background: var(--bg);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  border: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
}

.fc-window.fc-anim-open  { animation: fcOpen  0.2s ease both; }
.fc-window.fc-anim-close { animation: fcClose 0.2s ease both; }

@keyframes fcOpen {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fcClose {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.95); }
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.fc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  background: #635BFF;
  flex-shrink: 0;
}

.fc-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fc-bot-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fc-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 3px;
  font-family: var(--font-sans);
}

.fc-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0;
  font-family: var(--font-sans);
}

.fc-close-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.fc-close-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ── Messages area ────────────────────────────────────────────────────────── */
.fc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.fc-messages::-webkit-scrollbar { width: 4px; }
.fc-messages::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 4px; }

/* Example chips */
.fc-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 4px;
}

.fc-chip {
  background: var(--bg);
  color: #635BFF;
  border: 1.5px solid rgba(99,91,255,0.25);
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.fc-chip:hover {
  background: #635BFF;
  color: #fff;
  border-color: #635BFF;
}

/* Messages */
.fc-msg { display: flex; }
.fc-msg-user      { justify-content: flex-end; }
.fc-msg-assistant { justify-content: flex-start; align-items: flex-end; gap: 7px; }

.fc-msg-user .fc-bubble {
  background: #635BFF;
  color: #fff;
  border-radius: 16px 16px 0 16px;
  padding: 9px 13px;
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 83%;
  word-break: break-word;
  font-family: var(--font-sans);
}

.fc-avatar {
  width: 26px;
  height: 26px;
  min-width: 26px;
  background: #635BFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.fc-msg-assistant .fc-bubble {
  background: var(--bg);
  color: var(--text);
  border: 0.5px solid var(--border);
  border-radius: 16px 16px 16px 0;
  padding: 9px 13px;
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 83%;
  word-break: break-word;
  font-family: var(--font-sans);
}

/* Code blocks inside chat */
.fc-code {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 7px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  margin: 6px 0 2px;
  white-space: pre;
  display: block;
}

.fc-inline-code {
  background: rgba(99,91,255,0.1);
  color: #635BFF;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1px 4px;
  border-radius: 3px;
}

/* Typing indicator */
.fc-typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 3px 2px;
}

.fc-typing-dots span {
  width: 6px;
  height: 6px;
  background: #9CA3AF;
  border-radius: 50%;
  animation: fcDotBounce 1.2s infinite ease-in-out;
}

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

@keyframes fcDotBounce {
  0%, 60%, 100% { transform: translateY(0);   opacity: 0.4; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── Input area ───────────────────────────────────────────────────────────── */
.fc-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
  flex-shrink: 0;
}

.fc-textarea {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 13.5px;
  font-family: var(--font-sans);
  color: var(--text);
  resize: none;
  outline: none;
  line-height: 1.5;
  min-height: 38px;
  max-height: 96px;
  overflow-y: auto;
  background: var(--bg-input);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.fc-textarea:focus {
  border-color: #635BFF;
  box-shadow: 0 0 0 3px rgba(99,91,255,0.1);
  background: var(--bg);
}

.fc-textarea::placeholder { color: var(--text-muted); font-size: 13px; }

.fc-send-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: #635BFF;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.fc-send-btn:hover:not(:disabled) {
  background: #4F46E5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,91,255,0.45);
}

.fc-send-btn:disabled { opacity: 0.5; cursor: default; }

/* ───────────────────────────────────────────────────────────────────────────
   반응형 — 플로팅 채팅
   ─────────────────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .fc-window { width: calc(100vw - 24px); right: 12px; }
}
