
.tg-bot-fab {
  position: fixed;
  right: max(1.5rem, env(safe-area-inset-right, 0px));
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: block;
  text-decoration: none;
  color: var(--color-ink, #2a1f19);
  font-family: var(--font-sans, "Manrope", system-ui, sans-serif);
  -webkit-tap-highlight-color: transparent;
  animation: tg-bot-fab-in 0.85s var(--ease-rise, cubic-bezier(0.16, 1, 0.3, 1)) 0.3s both;
  transition: bottom 0.35s var(--ease-soft, cubic-bezier(0.4, 0, 0.2, 1));
}

@keyframes tg-bot-fab-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tg-bot-fab__shell {
  position: relative;
  display: inline-flex;
}

.tg-bot-fab__ring {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill, 999px);
  background: var(--color-accent, #b8674b);
  opacity: 0.3;
  pointer-events: none;
  animation: tg-bot-pulse 2.6s ease-out infinite;
}

.tg-bot-fab__ring--delay {
  animation-delay: 1.3s;
}

@keyframes tg-bot-pulse {
  0% {
    transform: scale(1);
    opacity: 0.35;
  }
  70% {
    transform: scale(1.12);
    opacity: 0;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

.tg-bot-fab__inner {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0.4375rem 1rem 0.4375rem 0.4375rem;
  border-radius: var(--radius-pill, 999px);
  background: var(--color-surface, #fbf7f1);
  border: 1px solid var(--color-border, #e5dacb);
  box-shadow: var(--shadow-soft, 0 4px 24px rgba(42, 31, 25, 0.08));
  transition:
    transform 0.35s var(--ease-soft, cubic-bezier(0.4, 0, 0.2, 1)),
    box-shadow 0.35s var(--ease-soft, cubic-bezier(0.4, 0, 0.2, 1)),
    border-color 0.35s var(--ease-soft, cubic-bezier(0.4, 0, 0.2, 1));
}

.tg-bot-fab__icon {
  flex: 0 0 2.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 50%;
  line-height: 0;
  background: #2aabee;
}

.tg-bot-fab__logo {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.tg-bot-fab__label {
  display: block;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--color-ink, #2a1f19);
  padding-inline-end: 0.125rem;
}

.tg-bot-fab__label [data-lang-section] {
  display: none;
}

html[lang="uk"] .tg-bot-fab__label [data-lang-section="uk"],
html[lang="ru"] .tg-bot-fab__label [data-lang-section="ru"] {
  display: inline;
}

@media (hover: hover) and (pointer: fine) {
  .tg-bot-fab:hover .tg-bot-fab__inner,
  .tg-bot-fab:focus-visible .tg-bot-fab__inner {
    transform: translateY(-2px);
    border-color: color-mix(
      in srgb,
      var(--color-accent, #b8674b) 42%,
      var(--color-border, #e5dacb)
    );
    box-shadow: var(--shadow-soft-lg, 0 12px 40px rgba(42, 31, 25, 0.12));
  }
}

.tg-bot-fab:focus-visible .tg-bot-fab__inner {
  outline: 2px solid var(--color-accent, #b8674b);
  outline-offset: 3px;
}

.tg-bot-fab:active .tg-bot-fab__inner {
  transform: translateY(0) scale(0.98);
}

body:has(.cookie-consent.is-open) .tg-bot-fab {
  bottom: max(7.5rem, calc(env(safe-area-inset-bottom, 0px) + 6rem));
}

@media (max-width: 767px) {
  .tg-bot-fab__inner {
    min-height: 3rem;
    padding: 0.375rem 0.875rem 0.375rem 0.375rem;
    gap: 0.625rem;
  }

  .tg-bot-fab__label {
    font-size: 0.8125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tg-bot-fab {
    animation: none;
  }

  .tg-bot-fab__ring {
    animation: none;
    opacity: 0;
  }

  .tg-bot-fab__inner {
    transition: none;
  }
}
