.takeone-chat-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9997;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 77, 26, 0.72);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 77, 26, 0.98), rgba(255, 166, 32, 0.92)),
    #ff4d1a;
  color: #06080a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 1px rgba(255, 77, 26, 0.16),
    0 0 24px rgba(255, 77, 26, 0.42),
    0 16px 42px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.96);
  pointer-events: none;
  overflow: visible;
  transition:
    width 0.24s ease,
    border-radius 0.24s ease,
    box-shadow 0.24s ease,
    transform 0.24s ease,
    opacity 0.24s ease;
  animation: takeoneFabPulse 3.2s ease-in-out infinite;
}

.takeone-chat-fab.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

.takeone-chat-fab:hover,
.takeone-chat-fab:focus-visible {
  width: 168px;
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 0 32px rgba(255, 77, 26, 0.62),
    0 18px 54px rgba(0, 0, 0, 0.58);
  transform: translate3d(0, -3px, 0) scale(1.01);
  outline: none;
}

.takeone-chat-fab::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(255, 77, 26, 0.28);
  border-radius: 24px;
  opacity: 0.65;
  pointer-events: none;
}

.takeone-chat-fab::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 13px;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.18),
      rgba(255, 255, 255, 0.18) 1px,
      transparent 1px,
      transparent 5px
    );
  mix-blend-mode: soft-light;
  opacity: 0.28;
  pointer-events: none;
}

.takeone-chat-fab svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

.takeone-chat-fab-label {
  position: relative;
  z-index: 2;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #06080a;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: max-width 0.24s ease, opacity 0.18s ease, margin-left 0.24s ease;
}

.takeone-chat-fab:hover .takeone-chat-fab-label,
.takeone-chat-fab:focus-visible .takeone-chat-fab-label {
  max-width: 108px;
  opacity: 1;
  margin-left: 10px;
}

.takeone-chat-fab-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  padding: 8px 10px;
  border: 1px solid rgba(255, 77, 26, 0.32);
  border-radius: 4px;
  background: rgba(6, 8, 10, 0.92);
  color: #e8dfc8;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.takeone-chat-fab:hover .takeone-chat-fab-tooltip,
.takeone-chat-fab:focus-visible .takeone-chat-fab-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.takeone-chat-fab-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 3;
  min-width: 21px;
  height: 21px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: #00d4ff;
  color: #06080a;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.5);
}

.takeone-chat-fab-badge.is-visible {
  display: inline-flex;
}

.takeone-chat-fab-ripple {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.9);
  opacity: 0;
  pointer-events: none;
}

.takeone-chat-fab.is-rippling .takeone-chat-fab-ripple {
  animation: takeoneFabRipple 0.46s ease-out;
}

.takeone-chat-fab.is-chat-page {
  bottom: max(104px, calc(env(safe-area-inset-bottom) + 92px));
}

@keyframes takeoneFabPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 77, 26, 0.16),
      0 0 22px rgba(255, 77, 26, 0.36),
      0 16px 42px rgba(0, 0, 0, 0.5);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 77, 26, 0.22),
      0 0 36px rgba(255, 77, 26, 0.58),
      0 18px 52px rgba(0, 0, 0, 0.56);
  }
}

@keyframes takeoneFabRipple {
  0% {
    opacity: 0.85;
    transform: scale(0.92);
  }
  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

@media (max-width: 768px) {
  .takeone-chat-fab {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .takeone-chat-fab:hover,
  .takeone-chat-fab:focus-visible {
    width: 52px;
    border-radius: 16px;
  }

  .takeone-chat-fab:hover .takeone-chat-fab-label,
  .takeone-chat-fab:focus-visible .takeone-chat-fab-label {
    max-width: 0;
    opacity: 0;
    margin-left: 0;
  }

  .takeone-chat-fab-tooltip {
    display: none;
  }

  .takeone-chat-fab.is-chat-page {
    bottom: max(90px, calc(env(safe-area-inset-bottom) + 82px));
  }
}
