.lc-chat-root {
  position: fixed;
  bottom: 22px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --lc-accent: #213647;
  --lc-accent-rgb: 33, 54, 71;
  --lc-accent-dark-rgb: 23, 38, 51;
  --lc-accent-light-rgb: 95, 113, 126;
}

.lc-chat-root.lc-left {
  left: 22px;
}

.lc-chat-root.lc-right {
  right: 22px;
}

.lc-icon,
.lc-fa-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
}

.lc-icon svg,
.lc-icon-image {
  width: 100%;
  height: 100%;
  display: block;
}

.lc-icon-image {
  object-fit: contain;
}

.lc-chat-window {
  width: min(360px, calc(100vw - 28px));
  height: min(650px, 80vh);
  max-height: 80vh;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 246, 250, 0.92)),
    linear-gradient(145deg, rgba(var(--lc-accent-rgb), 0.06), rgba(var(--lc-accent-dark-rgb), 0.1));
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
  transform-origin: right bottom;
}

.lc-chat-window.is-open {
  display: flex;
  animation: lcChatWindowIn 0.24s ease;
}

@keyframes lcChatWindowIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lc-chat-header {
  position: relative;
  color: #111827;
  padding: 16px 18px 10px;
  padding-right: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.76)),
    linear-gradient(135deg, rgba(var(--lc-accent-rgb), 0.14), rgba(var(--lc-accent-light-rgb), 0.08)) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.lc-chat-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.lc-chat-header-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  flex: 0 0 44px;
  background: linear-gradient(135deg, rgb(var(--lc-accent-rgb)), rgb(var(--lc-accent-light-rgb)));
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(var(--lc-accent-rgb), 0.26);
}

.lc-chat-header-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lc-chat-header-avatar[hidden] {
  display: none !important;
}

.lc-chat-header-avatar-icon {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
}

.lc-chat-header-avatar-icon .lc-icon,
.lc-chat-header-avatar-icon .lc-fa-icon {
  width: 18px;
  height: 18px;
}

.lc-chat-header-avatar-icon .lc-icon-image {
  filter: brightness(0) invert(1);
}

.lc-chat-header-avatar-wrap.is-online {
  animation: lcAvatarPulse 1.8s ease-in-out infinite;
}

@keyframes lcAvatarPulse {
  0%,
  100% {
    box-shadow: 0 14px 28px rgba(var(--lc-accent-rgb), 0.28), 0 0 0 0 rgba(var(--lc-accent-rgb), 0.34);
  }

  50% {
    box-shadow: 0 14px 28px rgba(var(--lc-accent-rgb), 0.28), 0 0 0 6px rgba(var(--lc-accent-rgb), 0.14);
  }
}

.lc-chat-header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  flex: 1;
  min-height: 44px;
}

.lc-chat-header-name {
  width: 100%;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lc-chat-header-name::before,
.lc-chat-header-role::before {
  content: none !important;
  display: none !important;
}

html body .lc-chat-root .lc-chat-header .lc-chat-header-meta::before,
html body .lc-chat-root .lc-chat-header .lc-chat-header-meta:before,
html body .lc-chat-root .lc-chat-header .lc-chat-header-meta .lc-chat-header-name::before,
html body .lc-chat-root .lc-chat-header .lc-chat-header-meta .lc-chat-header-name:before,
html body .lc-chat-root .lc-chat-header .lc-chat-header-meta .lc-chat-header-role::before,
html body .lc-chat-root .lc-chat-header .lc-chat-header-meta .lc-chat-header-role:before,
html body .lc-chat-root .lc-chat-header .lc-chat-header-meta .lc-chat-employee-name::before,
html body .lc-chat-root .lc-chat-header .lc-chat-header-meta .lc-chat-employee-name:before,
html body .lc-chat-root .lc-chat-header .lc-chat-header-meta .lc-chat-employee-status::before,
html body .lc-chat-root .lc-chat-header .lc-chat-header-meta .lc-chat-employee-status:before {
  content: none !important;
  display: none !important;
}

.lc-chat-header-role {
  width: 100%;
  margin-top: 0;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 500;
  text-transform: lowercase;
  color: rgba(51, 65, 85, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lc-chat-header-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.34);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #64748b;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lc-chat-header-close:hover {
  background: rgba(255, 255, 255, 0.96);
  color: #334155;
  transform: translateY(-1px);
}

.lc-chat-header-close:active {
  transform: translateY(0);
}

.lc-chat-header-close .lc-icon,
.lc-chat-header-close .lc-fa-icon {
  width: 16px;
  height: 16px;
}

.lc-chat-header-close .lc-icon-image {
  filter: none;
}

.lc-chat-messages {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 18px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.lc-chat-messages::-webkit-scrollbar {
  width: 8px;
}

.lc-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.lc-msg {
  display: inline-flex;
  flex-direction: column;
  width: fit-content;
  max-width: 88%;
  align-self: flex-start;
  padding: 14px 14px 12px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: rgba(17, 24, 39, 0.84);
  font-size: 14px;
  line-height: 1.52;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.lc-msg > :first-child {
  display: inline-block;
  max-width: 100%;
}

.lc-msg.me {
  margin-left: 0;
  align-self: flex-end;
  border-color: rgba(var(--lc-accent-rgb), 0.24);
  background: linear-gradient(180deg, rgba(var(--lc-accent-rgb), 0.15), rgba(var(--lc-accent-rgb), 0.08));
  box-shadow: 0 10px 24px rgba(var(--lc-accent-rgb), 0.2);
}

.lc-msg.them {
  margin-right: 0;
  align-self: flex-start;
}

.lc-msg-time {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: rgba(51, 65, 85, 0.62);
  text-align: right;
}

.lc-chat-typing {
  padding: 6px 18px 2px;
  color: rgba(17, 24, 39, 0.56);
  font-size: 12px;
}

.lc-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 0 18px 18px;
}

.lc-chat-tools {
  display: none;
}

.lc-chat-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
}

.lc-chat-input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
}

.lc-chat-input::placeholder {
  color: rgba(17, 24, 39, 0.45);
}

.lc-chat-input:focus {
  border-color: rgba(var(--lc-accent-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--lc-accent-rgb), 0.14);
}

.lc-chat-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgb(var(--lc-accent-rgb));
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 22px 40px rgba(var(--lc-accent-rgb), 0.34);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lc-chat-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 26px 46px rgba(var(--lc-accent-rgb), 0.46);
}

.lc-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lc-chat-send .lc-icon,
.lc-chat-send .lc-fa-icon {
  width: 16px;
  height: 16px;
}

.lc-chat-send .lc-icon-image {
  filter: brightness(0) invert(1);
}

.lc-chat-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  background: linear-gradient(135deg, rgb(var(--lc-accent-rgb)), rgb(var(--lc-accent-dark-rgb)));
  box-shadow: 0 22px 40px rgba(var(--lc-accent-rgb), 0.34);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.2s ease;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.lc-chat-root.lc-shape-round .lc-chat-toggle {
  border-radius: 999px;
}

.lc-chat-toggle:hover {
  animation-play-state: paused;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 28px 52px rgba(var(--lc-accent-rgb), 0.44);
}

.lc-chat-root.lc-anim-pulse .lc-chat-toggle {
  animation: lcTogglePulse 2.8s ease-in-out infinite;
}

@keyframes lcTogglePulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 22px 40px rgba(var(--lc-accent-rgb), 0.34);
  }

  50% {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 28px 54px rgba(var(--lc-accent-rgb), 0.44);
  }
}

.lc-chat-root.lc-anim-float .lc-chat-toggle {
  animation: lcToggleFloat 3.4s ease-in-out infinite;
}

@keyframes lcToggleFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 22px 40px rgba(var(--lc-accent-rgb), 0.34);
  }

  50% {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 30px 52px rgba(var(--lc-accent-rgb), 0.42);
  }
}

.lc-chat-root.lc-anim-bounce .lc-chat-toggle {
  animation: lcToggleBounce 1.7s cubic-bezier(0.25, 0.82, 0.34, 1) infinite;
}

@keyframes lcToggleBounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 22px 40px rgba(var(--lc-accent-rgb), 0.34);
  }

  35% {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 32px 56px rgba(var(--lc-accent-rgb), 0.46);
  }

  60% {
    transform: translateY(0) scale(0.98);
  }
}

.lc-chat-root.lc-anim-wave .lc-chat-toggle {
  animation: lcToggleWave 2.6s ease-in-out infinite;
  transform-origin: 50% 85%;
}

@keyframes lcToggleWave {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
    box-shadow: 0 22px 40px rgba(var(--lc-accent-rgb), 0.34);
  }

  20% {
    transform: rotate(-4deg) scale(1.01);
  }

  40% {
    transform: rotate(4deg) scale(1.01);
    box-shadow: 0 28px 50px rgba(var(--lc-accent-rgb), 0.42);
  }

  60% {
    transform: rotate(-2deg) scale(1);
  }
}

.lc-chat-toggle::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 28px;
  border: 1px solid rgba(var(--lc-accent-rgb), 0.35);
}

.lc-chat-root.lc-shape-round .lc-chat-toggle::before {
  border-radius: 999px;
}

.lc-chat-toggle::after {
  display: none;
}

.lc-chat-toggle i {
  color: #ffffff;
}

.lc-chat-toggle .lc-icon,
.lc-chat-toggle .lc-fa-icon {
  width: 24px;
  height: 24px;
  margin: 0 auto;
}

.lc-chat-toggle .lc-icon-image {
  filter: brightness(0) invert(1);
}

.lc-chat-toggle-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

.lc-chat-toggle-badge.is-hidden {
  display: none;
}

.lc-chat-root.is-open .lc-chat-toggle {
  display: none;
  opacity: 0;
  transform: none;
  pointer-events: none;
}

.lc-contact-help {
  font-size: 15px;
  color: #64748b;
  margin: 6px 4px 10px;
}

.lc-contact-wrap {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  margin: 0 2px 6px;
}

.lc-contact-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lc-contact-input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid #e5e7eb;
  background: transparent;
  padding: 8px 2px;
  font-size: 16px;
  color: #334155;
  outline: none;
}

.lc-contact-input:focus {
  border-bottom-color: rgba(var(--lc-accent-rgb), 0.75);
}

.lc-contact-btn {
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  font-size: 17px;
  font-weight: 600;
  min-height: 48px;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .lc-chat-toggle {
    animation: none !important;
  }

  .lc-chat-window.is-open {
    animation: none !important;
  }
}

@media (max-width: 1024px) {
  .lc-chat-root.lc-left,
  .lc-chat-root.lc-right {
    left: auto;
    right: 12px;
    bottom: max(82px, calc(env(safe-area-inset-bottom, 0px) + 82px));
    width: min(calc(100vw - 16px), 356px);
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  .lc-chat-root.is-open.lc-left,
  .lc-chat-root.is-open.lc-right {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100vw;
    min-height: var(--lc-mobile-viewport-height, 100dvh);
    height: var(--lc-mobile-viewport-height, 100dvh);
    max-width: none;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
    gap: 0;
  }

  .lc-chat-root.is-open .lc-chat-toggle {
    display: none;
  }

  .lc-chat-window {
    width: 100%;
    height: min(520px, calc(var(--lc-mobile-viewport-height, 100dvh) - 128px));
    max-height: calc(var(--lc-mobile-viewport-height, 100dvh) - 128px);
    border-radius: 24px;
    margin: 0;
  }

  .lc-chat-root.is-open .lc-chat-window {
    width: 100vw;
    flex: 1 1 auto;
    height: auto;
    max-height: none;
    margin: 0;
    min-height: 0;
    border-radius: 0;
    border: 0;
    padding-bottom: 0;
    box-sizing: border-box;
  }

  .lc-chat-root.is-open .lc-chat-form {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .lc-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 20px;
  }

  .lc-chat-header {
    padding: 14px 14px 10px;
    padding-right: 54px;
  }

  .lc-chat-messages {
    padding: 4px 14px 4px;
  }

  .lc-chat-header-close {
    top: max(10px, calc(env(safe-area-inset-top, 0px) + 8px));
    right: 12px;
  }

  .lc-chat-form {
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }
}
