.flo-widget {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1200;
  font-family: var(--aio-font, "Source Sans 3", sans-serif);
}

.flo-widget__launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  background: var(--aio-red, #e30613);
  color: #fff;
  box-shadow: 0 12px 30px rgba(227, 6, 19, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.flo-widget__launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(227, 6, 19, 0.42);
}

.flo-widget__launcher.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}

.flo-widget__launcher-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: #fff;
}

.flo-widget__launcher-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flo-widget__launcher-text {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.flo-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(22rem, calc(100vw - 2rem));
  height: min(34rem, calc(100vh - 6rem));
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.flo-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.flo-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  background: var(--aio-red, #e30613);
  color: #fff;
}

.flo-panel__identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.flo-panel__identity strong {
  display: block;
  font-size: 1rem;
  line-height: 1.1;
}

.flo-panel__identity span {
  display: block;
  font-size: 0.78rem;
  opacity: 0.88;
}

.flo-panel__avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: #fff;
}

.flo-panel__close {
  border: 0;
  background: transparent;
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
}

.flo-panel__close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.flo-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f8fafc;
}

.flo-message {
  display: flex;
  margin-bottom: 0.75rem;
}

.flo-message--bot {
  justify-content: flex-start;
}

.flo-message--user {
  justify-content: flex-end;
}

.flo-message__bubble {
  max-width: 88%;
  padding: 0.75rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--aio-ink, #1f2937);
}

.flo-message--sticker {
  margin-bottom: 0.35rem;
}

.flo-sticker {
  width: 8.75rem;
  height: auto;
  display: block;
  background: transparent;
  animation: flo-sticker-pop 0.35s ease;
}

@keyframes flo-sticker-pop {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.flo-message--bot .flo-message__bubble {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 0.25rem;
}

.flo-message--user .flo-message__bubble {
  background: var(--aio-red, #e30613);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}

.flo-message--typing .flo-message__bubble {
  color: #64748b;
}

.flo-message__bubble--actions {
  padding: 0.55rem;
}

.flo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.flo-action-btn,
.flo-quick-btn {
  border: 1px solid rgba(227, 6, 19, 0.25);
  background: #fff;
  color: var(--aio-red, #e30613);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.flo-action-btn:hover,
.flo-quick-btn:hover {
  background: var(--aio-red, #e30613);
  color: #fff;
}

.flo-panel__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1rem 0.75rem;
  background: #f8fafc;
}

.flo-panel__form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.flo-panel__form input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  font: inherit;
  outline: none;
}

.flo-panel__form input:focus {
  border-color: var(--aio-red, #e30613);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}

.flo-panel__form button {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--aio-red, #e30613);
  color: #fff;
  cursor: pointer;
}

.flo-panel__form button:disabled,
.flo-panel__form input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 575px) {
  .flo-widget {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .flo-panel {
    width: calc(100vw - 1.5rem);
    height: min(32rem, calc(100vh - 5rem));
  }

  .scroll-top {
    bottom: 5.5rem;
  }
}
