:root {
  --lc-bg: #16181c;
  --lc-surface: #ffffff;
  --lc-text: #1c1e22;
  --lc-muted: #6b7078;
  --lc-accent: #7bc8ff;
  --lc-accent-hover: #3fa9f5;
  --lc-bubble-user: #eef1ef;
  --lc-bubble-bot: #ffffff;
  --lc-border: #e4e6e8;
  --lc-radius: 14px;
}

.lc-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7bc8ff 0%, #3fa9f5 55%, #1769aa 100%);
  color: #0b1726;
  border: 3px solid rgba(214, 238, 255, 0.95);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 34px rgba(0,0,0,0.32), 0 0 18px rgba(123,200,255,0.75), 0 0 40px rgba(63,169,245,0.45);
  z-index: 9998;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lc-launcher::before {
  content: "";
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(123,200,255,0.65);
  border-radius: inherit;
  animation: lc-launcher-pulse 2.4s infinite ease-out;
}
.lc-launcher::after {
  content: "Chat";
  position: absolute;
  right: 62px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 12px;
  border-radius: 999px;
  background: #d8ecff;
  color: #0b1726;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 0 18px rgba(123,200,255,0.35);
  white-space: nowrap;
}
.lc-launcher:hover,
.lc-launcher:focus-visible {
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 18px 42px rgba(0,0,0,0.36), 0 0 24px rgba(123,200,255,0.95), 0 0 52px rgba(63,169,245,0.7);
}
.lc-launcher:focus-visible { outline: 3px solid rgba(123,200,255,0.75); outline-offset: 4px; }
.lc-launcher svg { width: 34px; height: 34px; }
@keyframes lc-launcher-pulse {
  0% { transform: scale(0.92); opacity: 0.9; }
  70%, 100% { transform: scale(1.18); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .lc-launcher::before { animation: none; }
}

.lc-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: var(--lc-surface);
  border-radius: var(--lc-radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.lc-window.lc-open { display: flex; }

.lc-header {
  background: var(--lc-bg);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lc-header-title { font-size: 15px; font-weight: 600; }
.lc-header-sub { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; }
.lc-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
}
.lc-close:hover { color: #fff; }

.lc-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafafa;
}

.lc-msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: var(--lc-radius);
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.lc-msg-bot {
  align-self: flex-start;
  background: var(--lc-bubble-bot);
  border: 1px solid var(--lc-border);
  color: var(--lc-text);
  border-bottom-left-radius: 4px;
}
.lc-msg-user {
  align-self: flex-end;
  background: var(--lc-bubble-user);
  color: var(--lc-text);
  border-bottom-right-radius: 4px;
}

.lc-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 10px 13px;
}
.lc-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lc-muted);
  animation: lc-bounce 1.2s infinite ease-in-out;
}
.lc-typing span:nth-child(2) { animation-delay: 0.15s; }
.lc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes lc-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.lc-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 4px;
  align-self: flex-start;
  max-width: 100%;
}
.lc-menu-btn {
  border: 1px solid var(--lc-accent);
  color: var(--lc-accent);
  background: #fff;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.lc-menu-btn:hover { background: var(--lc-accent); color: #fff; }

.lc-footer {
  border-top: 1px solid var(--lc-border);
  padding: 10px;
  display: flex;
  gap: 8px;
  background: #fff;
}
.lc-input {
  flex: 1;
  border: 1px solid var(--lc-border);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
}
.lc-input:focus { border-color: var(--lc-accent); }
.lc-send {
  background: var(--lc-accent);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lc-send:hover { background: var(--lc-accent-hover); }
.lc-send:disabled { opacity: 0.5; cursor: default; }

.lc-privacy {
  font-size: 10.5px;
  color: var(--lc-muted);
  padding: 6px 14px 10px;
  background: #fff;
  border-top: 1px solid var(--lc-border);
}

@media (max-width: 420px) {
  .lc-launcher {
    right: 18px;
    bottom: 18px;
    width: 66px;
    height: 66px;
  }
  .lc-launcher::after { display: none; }
  .lc-launcher svg { width: 31px; height: 31px; }
  .lc-window {
    right: 16px;
    left: 16px;
    width: auto;
    bottom: 96px;
  }
}
