/* css/components/chat.css */
.chat-wrap {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--nav-height) - 60px);
  height: calc(100dvh - var(--nav-height) - 60px);
}

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-4);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.chat-bubble {
  max-width: 85%;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-lg);
  font-size: 14px; line-height: 1.5;
}

.chat-message {
  display: flex;
  flex-direction: column;
}

.chat-message--ai { align-items: flex-start; }
.chat-message--user { align-items: flex-end; }

.chat-bubble--ai {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble--user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble--loading { opacity: 0.6; }

.chat-bubble {
  animation: aicfo-fade-up 280ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-ai-label {
  font-size: 11px; font-weight: 600; color: var(--accent);
  margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.05em;
}

.chat-input-area {
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-suggestions {
  display: flex; gap: var(--s-2); overflow-x: auto;
  padding-bottom: var(--s-2); margin-bottom: var(--s-2);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chat-suggestions::-webkit-scrollbar { display: none; }

.chat-suggestion {
  flex-shrink: 0;
  padding: var(--s-2) var(--s-3);
  min-height: 36px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  background: var(--accent-subtle);
  color: var(--accent);
  border: none; cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  transition: opacity 0.1s;
}
.chat-suggestion:active { opacity: 0.6; }

.chat-input-row {
  display: flex; gap: var(--s-2); align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  font-family: var(--font-ui); font-size: 14px;
  background: var(--bg); color: var(--text-1);
  resize: none; min-height: 44px; max-height: 120px;
  outline: none;
}

.chat-input:focus { border-color: var(--accent); }

.chat-send {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--accent); color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  touch-action: manipulation;
  transition: opacity 0.1s, transform 0.1s;
}
.chat-send:active:not(:disabled) {
  opacity: 0.7;
  transform: scale(0.93);
}

.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

.provider-toggle {
  display: flex; gap: 4px;
  background: var(--accent-subtle);
  padding: 2px; border-radius: var(--r-sm);
  flex-shrink: 0;
}

.provider-btn {
  padding: 4px 12px;
  border-radius: var(--r-sm);
  border: none;
  font-size: 11px; font-weight: 600;
  font-family: var(--font-ui);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 150ms;
}

.provider-btn.active {
  background: var(--accent);
  color: #fff;
}
