#ftr-chat-widget {
  --chat-blue: #078bd2;
  --chat-ink: #102431;
  --chat-muted: #73828a;
  --chat-line: #e4ebef;
  position: fixed;
  z-index: 10000;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  color: var(--chat-ink);
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#ftr-chat-widget *,
#ftr-chat-widget *::before,
#ftr-chat-widget *::after { box-sizing: border-box; }

#ftr-chat-widget button,
#ftr-chat-widget input { font: inherit; }

#ftr-chat-widget .ftr-chat-launcher {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  padding: 0;
  color: #fff;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  background: linear-gradient(145deg, #21a8ee, #087dc0 68%, #08649f);
  box-shadow: 0 14px 38px rgba(9, 92, 142, .29), inset 0 1px rgba(255,255,255,.5);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}

#ftr-chat-widget .ftr-chat-launcher:hover {
  transform: translateY(-3px) scale(1.035);
  box-shadow: 0 20px 44px rgba(9, 92, 142, .35), inset 0 1px rgba(255,255,255,.6);
  filter: saturate(1.08);
}

#ftr-chat-widget .ftr-chat-launcher svg { width: 25px; height: 25px; }

#ftr-chat-widget .ftr-chat-window {
  position: absolute;
  right: 0;
  bottom: 78px;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  height: min(590px, calc(100dvh - 118px));
  min-height: 390px;
  overflow: hidden;
  border: 1px solid rgba(220, 231, 237, .92);
  border-radius: 23px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 28px 90px rgba(10, 36, 52, .2), 0 4px 18px rgba(10,36,52,.06);
  opacity: 0;
  transform: translateY(12px) scale(.975);
  transform-origin: bottom right;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .24s cubic-bezier(.2,.8,.2,1), visibility .2s;
  backdrop-filter: blur(18px);
}

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

#ftr-chat-widget .ftr-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 18px;
  color: #fff;
  background: linear-gradient(112deg, #102431 2%, #163c54 100%);
}

#ftr-chat-widget .ftr-chat-avatar {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 14px;
  background: linear-gradient(145deg, #22aaf0, #0877b7);
  box-shadow: inset 0 1px rgba(255,255,255,.45);
}

#ftr-chat-widget .ftr-chat-avatar svg { width: 20px; height: 20px; }
#ftr-chat-widget .ftr-chat-title { min-width: 0; flex: 1; }
#ftr-chat-widget .ftr-chat-title strong { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
#ftr-chat-widget .ftr-chat-title span { display: block; margin-top: 3px; color: #b7d0de; font-size: 11px; }

#ftr-chat-widget .ftr-chat-close {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: #d9e7ef;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

#ftr-chat-widget .ftr-chat-close:hover { background: rgba(255,255,255,.17); transform: rotate(5deg); }
#ftr-chat-widget .ftr-chat-close svg { width: 16px; height: 16px; }

#ftr-chat-widget .ftr-chat-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 17px 15px 12px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(7,139,210,.065), transparent 40%),
    #f7fafb;
}

#ftr-chat-widget .ftr-chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 0 3px 9px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c6d8e2 transparent;
}

#ftr-chat-widget .ftr-chat-message {
  max-width: 86%;
  padding: 11px 13px;
  border: 1px solid var(--chat-line);
  border-radius: 16px 16px 16px 5px;
  background: #fff;
  color: #243945;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 3px 10px rgba(19,45,58,.035);
  animation: ftr-chat-in .24s ease both;
}

#ftr-chat-widget .ftr-chat-message.user {
  align-self: flex-end;
  border-color: #087fbd;
  border-radius: 16px 16px 5px 16px;
  background: linear-gradient(145deg, #149be0, #087dbc);
  color: #fff;
}

#ftr-chat-widget .ftr-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 53px;
  padding: 12px 14px;
}

#ftr-chat-widget .ftr-chat-typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6e8794;
  animation: ftr-chat-dot 1s ease-in-out infinite;
}

#ftr-chat-widget .ftr-chat-typing i:nth-child(2) { animation-delay: .14s; }
#ftr-chat-widget .ftr-chat-typing i:nth-child(3) { animation-delay: .28s; }

#ftr-chat-widget .ftr-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px 2px 2px;
}

#ftr-chat-widget .ftr-chat-suggestion {
  padding: 7px 10px;
  color: #176183;
  border: 1px solid #cde5f1;
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

#ftr-chat-widget .ftr-chat-suggestion:hover { transform: translateY(-1px); border-color: #75bfdf; background: #f2faff; }

#ftr-chat-widget .ftr-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 10px 10px 14px;
  border: 1px solid #dce7ec;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(19,45,58,.055);
}

#ftr-chat-widget .ftr-chat-input {
  width: 100%;
  min-width: 0;
  max-height: 90px;
  padding: 4px 0;
  resize: none;
  color: var(--chat-ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.4;
}

#ftr-chat-widget .ftr-chat-input::placeholder { color: #9aa8ae; }
#ftr-chat-widget .ftr-chat-input:focus { box-shadow: none; }

#ftr-chat-widget .ftr-chat-send {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  place-items: center;
  color: #fff;
  border: 0;
  border-radius: 11px;
  background: #078bd2;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}

#ftr-chat-widget .ftr-chat-send:hover { transform: translateY(-1px); background: #0578b6; }
#ftr-chat-widget .ftr-chat-send:disabled { opacity: .48; cursor: wait; }
#ftr-chat-widget .ftr-chat-send svg { width: 17px; height: 17px; }

#ftr-chat-widget .ftr-chat-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 3px 0;
  color: var(--chat-muted);
  font-size: 10px;
}

#ftr-chat-widget .ftr-chat-foot a { color: #087ebc; text-decoration: none; }
#ftr-chat-widget .ftr-chat-foot a:hover { text-decoration: underline; }

@keyframes ftr-chat-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ftr-chat-dot { 0%, 60%, 100% { opacity: .45; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 520px) {
  #ftr-chat-widget { right: max(13px, env(safe-area-inset-right)); bottom: max(13px, env(safe-area-inset-bottom)); }
  #ftr-chat-widget .ftr-chat-launcher { width: 56px; height: 56px; }
  #ftr-chat-widget .ftr-chat-window { right: -3px; bottom: 68px; width: min(390px, calc(100vw - 20px)); height: min(640px, calc(100dvh - 92px)); min-height: 350px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  #ftr-chat-widget *, #ftr-chat-widget *::before, #ftr-chat-widget *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
