
#Flatsomee-chat-widget,
#Flatsomee-chat-widget * {
  box-sizing: border-box;
}

.Flatsomee-chat-widget {
  --fs-primary: #5546e8;
  --fs-primary-dark: #4134c4;
  --fs-primary-light: #eef0fe;
  --fs-grad: linear-gradient(135deg, #6a5cf5 0%, #4b3bea 100%);
  --fs-text: #1d1e2c;
  --fs-muted: #9a9cae;

  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  font-family: inherit;
  direction: rtl;
}

.Flatsomee-toggle-btn {
  position: relative;
  z-index: 3;
  display: grid !important;
  place-items: center;
  width: 58px !important;
  height: 58px !important;
  min-width: 58px;
  min-height: 58px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  padding: 0 !important;
  margin: 0;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--fs-grad);
  color: #fff;
  box-shadow: 0 10px 24px rgba(75, 59, 234, 0.35), 0 2px 6px rgba(75, 59, 234, 0.2);
  cursor: pointer;
  overflow: visible;
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s ease;
}

.Flatsomee-toggle-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 30px rgba(75, 59, 234, 0.4), 0 2px 8px rgba(75, 59, 234, 0.25);
}

.Flatsomee-toggle-btn:active {
  transform: translateY(-1px) scale(0.97);
}

.Flatsomee-toggle-icon {
  position: relative;
  width: 22px;
  height: 22px;
}

.Flatsomee-toggle-icon::before,
.Flatsomee-toggle-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.Flatsomee-toggle-icon::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M4 4h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H9l-5 4v-4H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M4 4h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H9l-5 4v-4H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1z'/></svg>");
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.Flatsomee-toggle-icon::after {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M6 6l12 12M18 6L6 18' stroke='white' stroke-width='2.6' stroke-linecap='round'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M6 6l12 12M18 6L6 18' stroke='white' stroke-width='2.6' stroke-linecap='round'/></svg>");
  opacity: 0;
  transform: scale(0.4) rotate(-90deg);
}

.Flatsomee-toggle-btn.is-active .Flatsomee-toggle-icon::before {
  opacity: 0;
  transform: scale(0.4) rotate(90deg);
}

.Flatsomee-toggle-btn.is-active .Flatsomee-toggle-icon::after {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.Flatsomee-toggle-btn span:not([aria-hidden]) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.Flatsomee-toggle-btn:focus-visible,
.Flatsomee-close-btn:focus-visible,
.Flatsomee-send-btn:focus-visible,
.Flatsomee-end-btn:focus-visible {
  outline: 2px solid var(--fs-primary);
  outline-offset: 2px;
}

[data-tooltip] {
  position: relative;
  overflow: visible !important;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  right: 50%;
  transform: translateX(50%) translateY(4px);
  background: #22223b;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(50%) translateY(0);
}

.Flatsomee-chat-window {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 86px;
  display: flex;
  flex-direction: column;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 500px;
  max-height: calc(100vh - 160px);
  overflow: hidden;
  border: 1px solid rgba(85, 70, 232, 0.08);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 26px 60px rgba(29, 24, 86, 0.18), 0 4px 14px rgba(29, 24, 86, 0.08);

  opacity: 0;
  transform: translateY(14px) scale(0.96);
  visibility: hidden;
  pointer-events: none;
  transform-origin: bottom left;
  transition: opacity 0.2s ease, transform 0.26s cubic-bezier(.22,1,.36,1), visibility 0.2s;
}

.Flatsomee-chat-window.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}

.Flatsomee-chat-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: linear-gradient(135deg, #f3f1ff 0%, #eceaff 100%);
  border-bottom: 1px solid rgba(85, 70, 232, 0.08);
  color: var(--fs-text);
}

.Flatsomee-chat-header::after {
  content: '';
  position: absolute;
  inset-inline-start: 20px;
  bottom: -1px;
  width: 36px;
  height: 3px;
  border-radius: 3px;
  background: var(--fs-grad);
}

.Flatsomee-chat-header h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: #332e8c;
}

.Flatsomee-chat-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11.5px;
  color: #726fa0;
  font-weight: 400;
}

.Flatsomee-chat-subtitle::before {
  content: '';
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: Flatsomee-pulse 2s infinite;
}

@keyframes Flatsomee-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.Flatsomee-close-btn {
  display: grid !important;
  place-items: center;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  min-height: 32px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  padding: 0 !important;
  margin: 0;
  border: 0 !important;
  border-radius: 50% !important;
  background: rgba(85, 70, 232, 0.08);
  color: #5546e8;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.Flatsomee-close-btn:hover {
  background: rgba(85, 70, 232, 0.16);
  transform: rotate(90deg);
}

.Flatsomee-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  background: #fbfaff;
  scroll-behavior: smooth;
}

.Flatsomee-empty-message {
  padding: 16px 12px;
  color: var(--fs-muted);
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
}

.Flatsomee-msg {
  display: flex;
  margin: 0 0 14px;
}

.Flatsomee-msg-user {
  justify-content: flex-end;
}

.Flatsomee-msg-admin {
  position: relative;
  justify-content: flex-start;
  padding-inline-start: 32px;
}

.Flatsomee-msg-admin::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--fs-grad);
}

.Flatsomee-msg-admin::after {
  content: '';
  position: absolute;
  inset-inline-start: 7px;
  bottom: 7px;
  width: 10px;
  height: 10px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 4h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H9l-5 4v-4H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1z' fill='white'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 4h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H9l-5 4v-4H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1z' fill='white'/></svg>") center/contain no-repeat;
}

.Flatsomee-bubble {
  max-width: 80%;
  padding: 11px 14px;
  border: 0;
  border-radius: 16px;
  line-height: 1.75;
  font-size: 13px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.Flatsomee-msg-user .Flatsomee-bubble {
  background: #eef0f6;
  color: var(--fs-text);
  border-bottom-right-radius: 4px;
}

.Flatsomee-msg-admin .Flatsomee-bubble {
  background: var(--fs-grad);
  color: #fff;
  border-bottom-left-radius: 4px;
  box-shadow: 0 6px 16px rgba(75, 59, 234, 0.22);
}

.Flatsomee-time {
  display: block;
  margin-top: 5px;
  font-size: 10px;
}

.Flatsomee-msg-user .Flatsomee-time {
  text-align: right;
  color: #adaebd;
}

.Flatsomee-msg-admin .Flatsomee-time {
  text-align: left;
  color: rgba(255, 255, 255, 0.72);
}

.Flatsomee-input-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid #f0eefc;
  background: #fff;
}

.Flatsomee-input {
  min-width: 0;
  flex: 1;
  height: 44px;
  max-height: 110px;
  resize: none;
  padding: 11px 14px;
  border: 1.5px solid #eceaf8;
  border-radius: 16px;
  background: #faf9ff;
  color: var(--fs-text);
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.Flatsomee-input:focus {
  border-color: var(--fs-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(85, 70, 232, 0.12);
}

.Flatsomee-send-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.Flatsomee-end-btn {
  display: grid !important;
  place-items: center;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  min-height: 32px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #f5f4fb;
  color: #8a88a3;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.Flatsomee-end-btn:hover {
  background: #fde8e8;
  color: #dc2626;
}

.Flatsomee-end-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.Flatsomee-send-btn {
  position: relative;
  display: grid !important;
  place-items: center;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px;
  min-height: 34px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--fs-grad);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(75, 59, 234, 0.3);
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.Flatsomee-send-btn:hover {
  transform: translateY(-1px);
}

.Flatsomee-send-btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.Flatsomee-send-icon {
  font-size: 17px;
  line-height: 1;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.Flatsomee-spinner {
  display: none;
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: Flatsomee-spin 0.7s linear infinite;
}

.Flatsomee-send-btn.is-loading .Flatsomee-send-icon {
  opacity: 0;
  transform: scale(0.7);
}

.Flatsomee-send-btn.is-loading .Flatsomee-spinner {
  display: block;
}

@keyframes Flatsomee-spin {
  to { transform: rotate(360deg); }
}

.Flatsomee-messages::-webkit-scrollbar {
  width: 6px;
}

.Flatsomee-messages::-webkit-scrollbar-thumb {
  background: #d9d5f7;
  border-radius: 6px;
}

.Flatsomee-messages::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 480px) {
  .Flatsomee-chat-widget {
    right: 12px;
    bottom: 12px;
  }

  .Flatsomee-chat-window {
    bottom: 78px;
    right: 0;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    height: min(72vh, 540px);
    max-height: calc(100vh - 150px);
  }
}

.Flatsomee-chat-widget [hidden] {
  display: none !important;
}

.Flatsomee-toggle-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fb7185, #e11d48);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 21px;
  text-align: center;
  box-shadow: 0 0 0 2.5px #fff;
  animation: Flatsomee-badge-pop 1.8s ease-in-out infinite;
}

@keyframes Flatsomee-badge-pop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.Flatsomee-load-older {
  display: block;
  margin: 0 auto 10px;
  padding: 5px 14px;
  border: 1px solid #e3e0fb;
  border-radius: 999px;
  background: #fff;
  color: var(--fs-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.Flatsomee-load-older:hover {
  background: var(--fs-primary-light);
}

.Flatsomee-load-older:disabled {
  opacity: 0.6;
  cursor: default;
}

.Flatsomee-gate {
  display: grid;
  gap: 12px;
  padding: 22px 18px 18px;
  direction: rtl;
}

.Flatsomee-gate-title {
  font-size: 16px;
  font-weight: 700;
  color: #332e8c;
}

.Flatsomee-gate-text {
  font-size: 12.5px;
  line-height: 1.8;
  color: #726fa0;
}

.Flatsomee-gate-form {
  display: grid;
  gap: 9px;
}

.Flatsomee-gate-form input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid #eceaf8;
  border-radius: 14px;
  background: #faf9ff;
  font: inherit;
  font-size: 13px;
  color: var(--fs-text);
  direction: rtl;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.Flatsomee-gate-form input:focus {
  outline: none;
  border-color: var(--fs-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(85, 70, 232, 0.12);
}

.Flatsomee-gate-btn {
  padding: 11px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--fs-grad);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(75, 59, 234, 0.3);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.Flatsomee-gate-btn:hover {
  transform: translateY(-1px);
}

.Flatsomee-gate-btn:disabled {
  opacity: 0.6;
  transform: none;
}

.Flatsomee-form-error {
  margin: 6px 12px 0;
  color: #dc2626;
  font-size: 12px;
}

.Flatsomee-gate-error {
  margin: 0;
}

.Flatsomee-chat-widget .Flatsomee-messages {
  background-color: #fbfaff;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(85, 70, 232, 0.055) 0 38px, transparent 39px),
    radial-gradient(circle at 88% 40%, rgba(85, 70, 232, 0.07) 0 54px, transparent 55px),
    radial-gradient(circle at 26% 78%, rgba(85, 70, 232, 0.045) 0 30px, transparent 31px),
    radial-gradient(circle at 80% 92%, rgba(85, 70, 232, 0.06) 0 42px, transparent 43px),
    radial-gradient(rgba(85, 70, 232, 0.06) 1px, transparent 1.2px);
  background-size: auto, auto, auto, auto, 18px 18px;
  background-attachment: local;
}

.Flatsomee-chat-widget .Flatsomee-send-btn {
  display: grid;
  place-items: center;
  padding: 0;
}

.Flatsomee-chat-widget .Flatsomee-send-btn .Flatsomee-send-icon {
  display: grid;
  place-items: center;
  line-height: 0;
  transform: none;
}

.Flatsomee-chat-widget .Flatsomee-send-btn svg {
  display: block;
  margin: 0;
}

.Flatsomee-chat-widget .Flatsomee-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.Flatsomee-chat-widget .Flatsomee-ticks {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 4px;
  color: #c3c1e0;
  vertical-align: middle;
  line-height: 0;
}

.Flatsomee-chat-widget .Flatsomee-ticks.is-read {
  color: #ffffff;
}
