.gf-chatbot-toggle {
  position: fixed;
  right: 22px;
  bottom: 20px;
  width: 62px;
  height: 62px;
  border-radius: 999px;
  border: 1px solid rgba(209, 248, 1, 0.65);
  background: linear-gradient(145deg, #d1f801 0%, #9dbd00 100%);
  color: #080807;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gf-chatbot-toggle:hover {
  transform: translateY(-2px);
}

.gf-chatbot {
  position: fixed;
  right: 22px;
  bottom: 100px;
  width: min(390px, calc(100vw - 24px));
  max-height: min(78vh, 760px);
  display: none;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #080807;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.52);
  z-index: 1101;
}

.gf-chatbot.is-open {
  display: flex;
}

.gf-chat-open .gf-chatbot-toggle {
  opacity: 0;
  pointer-events: none;
}

.gf-chatbot__header {
  padding: 14px 16px;
  background: linear-gradient(165deg, rgba(209, 248, 1, 0.16), rgba(209, 248, 1, 0.04));
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gf-chatbot__title {
  color: #fff;
  font-size: 1.5rem;
  margin: 0;
  line-height: 1.35;
}

.gf-chatbot__subtitle {
  color: #d5d5d5;
  font-size: 1.2rem;
  margin: 2px 0 0;
}

.gf-chatbot__close {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
}

.gf-chatbot__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gf-chatbot__contacts a {
  color: #fff;
  font-size: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 5px 9px;
}

.gf-chatbot__contacts a:hover {
  color: #080807;
  background: #d1f801;
  border-color: #d1f801;
}

.gf-chatbot__messages {
  padding: 12px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  min-height: 230px;
}

.gf-msg {
  max-width: 88%;
  border-radius: 12px;
  padding: 10px 11px;
  line-height: 1.52;
  font-size: 1.3rem;
  white-space: pre-wrap;
}

.gf-msg--bot {
  background: rgba(255, 255, 255, 0.08);
  color: #f3f3f3;
}

.gf-msg--user {
  justify-self: end;
  background: rgba(209, 248, 1, 0.16);
  color: #fff;
}

.gf-chatbot__lead-toggle {
  margin: 0 12px 8px;
  border: 1px solid rgba(209, 248, 1, 0.6);
  color: #fff;
  background: rgba(209, 248, 1, 0.1);
  border-radius: 10px;
  font-size: 1.25rem;
  padding: 8px 10px;
  cursor: pointer;
}

.gf-chatbot__lead-form {
  margin: 0 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 10px;
  display: none;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.gf-chatbot__lead-form.is-open {
  display: grid;
}

.gf-chatbot__lead-form input,
.gf-chatbot__lead-form select,
.gf-chatbot__lead-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 8px 10px;
  font-size: 1.3rem;
}

.gf-chatbot__lead-form textarea {
  min-height: 78px;
  resize: vertical;
}

.gf-chatbot__lead-form button {
  border: 0;
  border-radius: 9px;
  background: #d1f801;
  color: #080807;
  font-weight: 700;
  padding: 9px 10px;
  cursor: pointer;
}

.gf-chatbot__composer {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
}

.gf-chatbot__input {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  padding: 10px;
  font-size: 1.35rem;
}

.gf-chatbot__send {
  border: 0;
  border-radius: 10px;
  background: #d1f801;
  color: #080807;
  min-width: 62px;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
}

.gf-chatbot__notice {
  margin: 0 12px 10px;
  font-size: 1.2rem;
  color: #d4d4d4;
}

.gf-chatbot__status {
  margin: 0 12px 10px;
  padding: 8px 9px;
  border-radius: 8px;
  font-size: 1.2rem;
  display: none;
}

.gf-chatbot__status.is-visible {
  display: block;
}

.gf-chatbot__status.ok {
  border: 1px solid rgba(209, 248, 1, 0.5);
  background: rgba(209, 248, 1, 0.1);
  color: #fff;
}

.gf-chatbot__status.err {
  border: 1px solid rgba(255, 100, 100, 0.62);
  background: rgba(255, 100, 100, 0.12);
  color: #fff;
}

@media (max-width: 640px) {
  .gf-chatbot-toggle {
    right: 14px;
    bottom: 20px;
    width: 56px;
    height: 56px;
  }

  .gf-chatbot {
    right: 10px;
    bottom: 82px;
    width: calc(100vw - 20px);
  }
}

.gf-msg p {
  margin: 0;
}

.gf-msg p + p {
  margin-top: 8px;
}

.gf-msg ul,
.gf-msg ol {
  margin: 8px 0 0 18px;
  padding: 0;
}

.gf-msg li {
  margin: 3px 0;
}

.gf-msg a {
  color: #d1f801;
  text-decoration: underline;
  word-break: break-word;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.gf-msg code {
  display: inline-block;
  border-radius: 5px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.2rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.gf-msg strong {
  font-weight: 700;
}

.gf-msg em {
  font-style: italic;
}

/* Chatbot layout fixes: prevent clipping when lead form opens */
.gf-chatbot {
  height: min(78vh, 760px);
  max-height: min(78vh, 760px);
}

.gf-chatbot__messages {
  flex: 1 1 auto;
  min-height: 0;
}

.gf-chatbot__lead-toggle {
  width: calc(100% - 24px);
  line-height: 1.32;
}

.gf-chatbot__lead-form {
  min-height: 0;
}

.gf-chatbot__lead-form.is-open {
  display: grid;
  max-height: min(38vh, 360px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.gf-chatbot__status,
.gf-chatbot__notice,
.gf-chatbot__composer {
  flex-shrink: 0;
}

.gf-chatbot__composer {
  margin-top: auto;
}

.gf-chat-open .cursor1,
.gf-chat-open .cursor2 {
  display: none !important;
}

@media (max-width: 640px) {
  .gf-chatbot {
    left: 10px;
    right: 10px;
    width: auto;
    height: min(82vh, calc(100vh - 96px));
    max-height: min(82vh, calc(100vh - 96px));
  }

  @supports (height: 100dvh) {
    .gf-chatbot {
      height: min(82dvh, calc(100dvh - 96px));
      max-height: min(82dvh, calc(100dvh - 96px));
    }
  }

  .gf-chatbot__lead-form.is-open {
    max-height: min(34vh, 300px);
  }
}

.gf-chatbot__lead-form input::placeholder,
.gf-chatbot__lead-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.gf-chatbot__lead-form input:-webkit-autofill,
.gf-chatbot__lead-form input:-webkit-autofill:hover,
.gf-chatbot__lead-form input:-webkit-autofill:focus,
.gf-chatbot__lead-form textarea:-webkit-autofill,
.gf-chatbot__lead-form textarea:-webkit-autofill:hover,
.gf-chatbot__lead-form textarea:-webkit-autofill:focus,
.gf-chatbot__lead-form select:-webkit-autofill,
.gf-chatbot__lead-form select:-webkit-autofill:hover,
.gf-chatbot__lead-form select:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.08) inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* Floating actions positioning: chatbot right, page-up left */
.progress-wrap {
  left: 20px;
  right: auto;
  bottom: 24px;
  z-index: 1090;
}

@media (max-width: 640px) {
  .progress-wrap {
    left: 12px;
    right: auto;
    bottom: 18px;
  }
}

/* Mobile layering: chatbot over fixed header */
@media (max-width: 640px) {
  .gf-chatbot-toggle {
    z-index: 10001;
  }

  .gf-chatbot {
    z-index: 10002;
  }
}
