:root {
  --chatbot-green-700: #2f7a2e;
  --chatbot-green-600: #48c25a;
  --chatbot-green-500: #7dea5c;
  --chatbot-dark: #0f0f10;
  --chatbot-dark-2: #151617;
  --chatbot-border: rgba(255, 255, 255, 0.08);
}

.chatbot-fab {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 2600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(92vw, 260px);
  padding: 12px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: #0b1b0b;
  background: linear-gradient(135deg, var(--chatbot-green-600), var(--chatbot-green-500));
  box-shadow: 0 12px 30px rgba(72, 194, 90, 0.35);
  border: 1px solid rgba(255,255,255,0.55);
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease;
  animation: chatbotPulse 2.2s ease-in-out infinite, chatbotNudge 6s ease-in-out infinite;
}

.chatbot-fab::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff3b30;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.45);
  animation: chatbotBadgePulse 1.8s ease-in-out infinite;
}

.chatbot-fab:hover,
.chatbot-fab:focus {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(72, 194, 90, 0.45);
}

.chatbot-fab-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 27, 11, 0.14);
}

.chatbot-fab-copy {
  display: grid;
  gap: 2px;
}

.chatbot-fab-copy strong {
  line-height: 1.1;
  font-size: 1rem;
}

.chatbot-fab-copy span {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.2;
}

@keyframes chatbotPulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(72, 194, 90, 0.35), 0 0 0 0 rgba(125, 234, 92, 0.22); }
  50% { box-shadow: 0 16px 38px rgba(72, 194, 90, 0.48), 0 0 0 12px rgba(125, 234, 92, 0); }
}

@keyframes chatbotNudge {
  0%, 88%, 100% { transform: translateX(0); }
  90% { transform: translateX(-2px); }
  92% { transform: translateX(3px); }
  94% { transform: translateX(-3px); }
  96% { transform: translateX(2px); }
  98% { transform: translateX(0); }
}

@keyframes chatbotBadgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.45); }
  60% { box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
}

.chatbot-shell[hidden] {
  display: none;
}

.chatbot-shell {
  position: fixed;
  left: 16px;
  bottom: 84px;
  z-index: 2600;
  width: min(94vw, 420px);
  height: min(680px, calc(100dvh - 120px));
  max-height: min(680px, calc(100dvh - 120px));
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.chatbot-panel {
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(15,15,16,.98), rgba(21,22,23,.98));
  color: #fff;
  border: 1px solid var(--chatbot-border);
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
}

.chatbot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.chatbot-header h2 {
  margin: 0 0 2px;
  font-size: 1rem;
}

.chatbot-header p {
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: .84rem;
  line-height: 1.35;
}

.chatbot-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.1);
  color: #fff;
  cursor: pointer;
}

.chatbot-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 14px 14px;
  min-height: 0;
  overflow: hidden;
}

.chatbot-form,
.chatbot-messages,
.chatbot-composer {
  display: grid;
  gap: 8px;
}

.chatbot-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.chatbot-field label {
  display: block;
  margin-bottom: 4px;
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,255,255,.88);
}

.chatbot-field input,
.chatbot-composer textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: #fff;
  font: inherit;
  font-size: .9rem;
}

.chatbot-composer textarea {
  min-height: 72px;
  line-height: 1.4;
  resize: vertical;
}

.chatbot-messages {
  min-height: 0;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 6px;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: rgba(125,234,92,.75) rgba(255,255,255,.08);
}

.chatbot-messages::-webkit-scrollbar {
  width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: rgba(255,255,255,.08);
  border-radius: 999px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(125,234,92,.75);
  border-radius: 999px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(125,234,92,.92);
}

.chatbot-message {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: .9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chatbot-message strong,
.chatbot-message b {
  font-weight: 800;
}

.chatbot-message a {
  color: #b8ff9b;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chatbot-message a:hover,
.chatbot-message a:focus {
  color: #d8ffc5;
}

.chatbot-message.user {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.07);
}

.chatbot-message.assistant {
  background: rgba(125,234,92,.15);
  border: 1px solid rgba(125,234,92,.26);
}

.chatbot-message small {
  display: block;
  margin-bottom: 4px;
  color: rgba(255,255,255,.72);
  font-weight: 700;
  font-size: .76rem;
}

.chatbot-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.chatbot-action-buttons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.chatbot-status {
  font-size: .82rem;
  color: rgba(255,255,255,.76);
}

.chatbot-secondary-action,
.chatbot-send {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: .88rem;
  white-space: nowrap;
}

.chatbot-secondary-action {
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  background: rgba(255,255,255,.08);
}

.chatbot-send {
  color: #0b1b0b;
  background: linear-gradient(135deg, var(--chatbot-green-600), var(--chatbot-green-500));
}

.chatbot-secondary-action[disabled],
.chatbot-send[disabled] {
  opacity: .6;
  cursor: wait;
}

@media (max-width: 560px) {
  .chatbot-shell {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
    height: calc(100dvh - 92px);
    max-height: calc(100dvh - 92px);
  }

  .chatbot-fab {
    left: 10px;
    right: 10px;
    max-width: none;
  }

  .chatbot-form-grid {
    grid-template-columns: 1fr;
  }

  .chatbot-panel {
    border-radius: 18px;
  }

  .chatbot-body {
    gap: 9px;
    padding: 10px;
  }

  .chatbot-messages {
    min-height: 0;
  }

  .chatbot-action-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-left: 0;
  }

  .chatbot-secondary-action,
  .chatbot-send {
    width: 100%;
    min-width: 0;
    padding: 9px 10px;
    font-size: .82rem;
  }
}
