/* Farm2You assistant — Faces2Names shell, forest branding */
:root {
  --cb-forest: #104020;
  --cb-forest-mid: #1a5c2e;
  --cb-leaf: #74b72e;
  --cb-leaf-deep: #5a9a22;
  --cb-ink: #163524;
  --cb-muted: #5a7260;
  --cb-line: #c5d6c8;
  --cb-mist: #eef6f0;
  --cb-panel: #f7fbf7;
  --cb-white: #ffffff;
}

.ChatbotRoot {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  z-index: 2147482000;
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  overflow: visible;
}

.ChatbotRoot.ChatbotCollapsed .ChatbotPanel {
  display: none;
  pointer-events: none;
}

.ChatbotLauncher {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cb-forest-mid) 0%, var(--cb-forest) 100%);
  color: var(--cb-white);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  box-shadow: 0 10px 26px rgba(16, 64, 32, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 5;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.ChatbotLauncher i {
  font-size: 21px;
  line-height: 1;
}

.ChatbotLauncherFallback {
  display: none;
}

.ChatbotLauncher:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.ChatbotPanel {
  position: absolute;
  right: 0;
  bottom: calc(56px + 8px);
  z-index: 2;
  width: min(380px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 24px));
  background: var(--cb-white);
  border: 1px solid var(--cb-line);
  border-radius: 16px;
  box-shadow: 0 14px 42px rgba(16, 64, 32, 0.23);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ChatbotPanelIn 0.22s ease;
}

@keyframes ChatbotPanelIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.ChatbotHeader {
  background: linear-gradient(180deg, var(--cb-forest-mid) 0%, var(--cb-forest) 55%, #0a3018 100%);
  color: var(--cb-white);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}

.ChatbotTitle {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-family: Nunito, "Segoe UI", sans-serif;
}

.ChatbotHeaderActions {
  display: flex;
  gap: 6px;
}

.ChatbotHeaderButton {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: var(--cb-white);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  font-size: 16px;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.ChatbotHeaderButton:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.48);
}

.ChatbotHubView,
.ChatbotChatView {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.ChatbotHubView[hidden],
.ChatbotChatView[hidden] {
  display: none !important;
}

.ChatbotHubView {
  background: var(--cb-mist);
}

.ChatbotHubIntro {
  padding: 14px 14px 10px;
}

.ChatbotHubNewBtn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #d4e3d8;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%);
  color: var(--cb-forest);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 4px 14px rgba(16, 64, 32, 0.08);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.ChatbotHubNewBtn:hover {
  border-color: var(--cb-leaf);
  box-shadow: 0 8px 20px rgba(16, 64, 32, 0.12);
  transform: translateY(-1px);
}

.ChatbotHubNewBtnIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--cb-leaf) 0%, var(--cb-leaf-deep) 100%);
  color: #0a3018;
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.ChatbotHubNewBtnCopy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.ChatbotHubNewBtnLabel {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--cb-forest);
}

.ChatbotHubNewBtnHint {
  font-size: 12px;
  line-height: 1.35;
  color: var(--cb-muted);
}

.ChatbotHubNewBtnArrow {
  color: #7a9482;
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}

.ChatbotHubSectionLabel {
  padding: 4px 16px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cb-muted);
}

.ChatbotConversationList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--cb-mist);
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ChatbotConversationListItem {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid #d4dee0;
  background: var(--cb-white);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
}

.ChatbotConversationListItem:hover {
  border-color: var(--cb-leaf);
  background: #f7fbf4;
}

.ChatbotConversationListTitle {
  font-size: 12px;
  font-weight: 700;
  color: var(--cb-forest);
}

.ChatbotConversationListPreview {
  font-size: 12px;
  color: #41586b;
  line-height: 1.35;
}

.ChatbotConversationListMeta {
  font-size: 11px;
  color: var(--cb-muted);
}

.ChatbotConversationListEmpty,
.ChatbotConversationListLoading {
  font-size: 12px;
  color: var(--cb-muted);
  padding: 6px 4px;
}

.ChatbotChatNav {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background: var(--cb-white);
  border-bottom: 1px solid #e3ebe4;
  flex-shrink: 0;
}

.ChatbotBackBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: var(--cb-forest-mid);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  transition: background 0.18s ease, color 0.18s ease;
}

.ChatbotBackBtn:hover {
  background: #eef5ef;
  color: var(--cb-forest);
}

.ChatbotMessages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: var(--cb-panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ChatbotMessage {
  display: flex;
  animation: ChatbotMsgIn 0.2s ease;
}

@keyframes ChatbotMsgIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.ChatbotMessageAssistant {
  justify-content: flex-start;
  flex-direction: column;
  align-items: flex-start;
}

.ChatbotMessageUser {
  justify-content: flex-end;
}

.ChatbotMessageSupport {
  justify-content: flex-start;
  flex-direction: column;
  align-items: flex-start;
}

.ChatbotBubble {
  max-width: 82%;
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.ChatbotMessageAssistant .ChatbotBubble {
  background: var(--cb-white);
  border: 1px solid #dfe8e1;
  color: var(--cb-ink);
  text-align: left;
}

.ChatbotMessageSupport .ChatbotBubble {
  background: #fff8e8;
  border: 1px solid #e6d39a;
  color: var(--cb-ink);
  text-align: left;
}

.ChatbotMessageUser .ChatbotBubble {
  background: var(--cb-forest-mid);
  color: var(--cb-white);
  text-align: left;
}

.ChatbotTyping {
  display: flex;
  flex-direction: row;
  align-items: center;
  font-size: 12px;
  color: var(--cb-muted);
  padding: 6px 12px 8px;
  font-style: italic;
  gap: 8px;
  background: linear-gradient(90deg, rgba(116, 183, 46, 0.1), rgba(116, 183, 46, 0.02));
  border-left: 3px solid var(--cb-leaf);
  flex-shrink: 0;
}

.ChatbotTyping[hidden] {
  display: none !important;
}

.ChatbotTypingPulse {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--cb-leaf);
  flex-shrink: 0;
  animation: ChatbotTypingDot 1s ease-in-out infinite;
}

@keyframes ChatbotTypingDot {
  0%, 100% { opacity: 0.35; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

.ChatbotQuickActions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 12px 10px;
  border-top: 1px solid #e8efe9;
  background: #f9fbf9;
  flex-shrink: 0;
}

.ChatbotQuickAction {
  border: 1px solid var(--cb-line);
  background: var(--cb-white);
  color: var(--cb-forest);
  border-radius: 999px;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.ChatbotQuickAction:hover,
.ChatbotQuickAction.isActive {
  background: #eef8e4;
  border-color: var(--cb-leaf);
  transform: translateY(-1px);
}

.ChatbotComposer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #ecefec;
  background: var(--cb-white);
  flex-shrink: 0;
}

.ChatbotComposerTools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ChatbotToolBtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--cb-line);
  border-radius: 8px;
  background: #f7faf7;
  color: var(--cb-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  cursor: pointer;
  line-height: 1.2;
}

.ChatbotToolBtn:hover {
  border-color: var(--cb-leaf);
  background: #eef8e4;
}

.ChatbotComposerRow {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.ChatbotInput {
  flex: 1;
  border: 1px solid var(--cb-line);
  border-radius: 10px;
  font-size: 13px;
  font: inherit;
  resize: none;
  padding: 8px 10px;
  outline: none;
  min-height: 42px;
  max-height: 110px;
  color: var(--cb-ink);
  background: var(--cb-white);
}

.ChatbotInput:focus {
  border-color: var(--cb-leaf);
  box-shadow: 0 0 0 3px rgba(116, 183, 46, 0.18);
}

.ChatbotInput:disabled {
  background: #f3f5f3;
  color: #6a7d70;
}

.ChatbotSend {
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--cb-leaf) 0%, var(--cb-leaf-deep) 100%);
  color: #0a3018;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.ChatbotSend:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.ChatbotSend:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ChatbotFeedbackRow {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--cb-muted);
}

.ChatbotFeedbackRow button {
  border: 1px solid var(--cb-line);
  background: var(--cb-white);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
}

.ChatbotFeedbackRow button:hover {
  border-color: var(--cb-leaf);
  background: #eef8e4;
}

@media (max-width: 767px) {
  .ChatbotRoot:not(.ChatbotCollapsed) {
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    height: auto;
  }
  .ChatbotLauncher {
    left: auto;
    right: 0;
  }
  .ChatbotPanel {
    width: auto;
    left: 0;
    right: 0;
    height: min(78vh, 640px);
  }
}
