.wlc-root,
.wlc-root * {
  box-sizing: border-box;
}

.wlc-root {
  --wlc-ink: #172033;
  --wlc-muted: #667085;
  --wlc-line: #d8dee8;
  --wlc-agent: #ffffff;
  --wlc-mine: #0f766e;
  --wlc-accent: #2563eb;
  --wlc-warn: #b45309;
  --wlc-bg: #f7f9fc;
  color: var(--wlc-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2147483000;
}

.wlc-launcher {
  align-items: center;
  background: #0f766e;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  color: #fff;
  cursor: pointer;
  display: flex;
  height: 58px;
  justify-content: center;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  width: 58px;
}

.wlc-launcher:hover {
  background: #115e59;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28);
  transform: translateY(-2px);
}

.wlc-launcher svg,
.wlc-send svg {
  fill: none;
  height: 26px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  width: 26px;
}

.wlc-badge {
  align-items: center;
  background: #ef4444;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-size: 11px;
  font-weight: 700;
  height: 22px;
  justify-content: center;
  min-width: 22px;
  padding: 0 5px;
  position: absolute;
  right: -3px;
  top: -4px;
}

.wlc-panel {
  background: var(--wlc-bg);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  bottom: 74px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.26);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: min(620px, calc(100vh - 112px));
  max-height: 620px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  right: 0;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.18s ease, transform 0.18s ease;
  width: min(380px, calc(100vw - 36px));
}

.wlc-root.is-open .wlc-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.wlc-header {
  align-items: center;
  background: #172033;
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 68px;
  padding: 14px 16px;
}

.wlc-header strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.wlc-status {
  color: #cbd5e1;
  display: block;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 4px;
}

.wlc-status[data-mode="online"] {
  color: #86efac;
}

.wlc-status[data-mode="offline"] {
  color: #fca5a5;
}

.wlc-status[data-mode="pending"] {
  color: #fcd34d;
}

.wlc-close {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 24px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  width: 34px;
}

.wlc-messages {
  overflow-y: auto;
  padding: 16px;
}

.wlc-empty {
  background: #fff;
  border: 1px solid var(--wlc-line);
  border-radius: 8px;
  color: var(--wlc-muted);
  font-size: 14px;
  line-height: 1.5;
  padding: 14px;
  text-align: center;
}

.wlc-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 12px;
}

.wlc-message-mine {
  align-items: flex-end;
}

.wlc-message-agent {
  align-items: flex-start;
}

.wlc-message-system {
  align-items: center;
  color: var(--wlc-muted);
  font-size: 12px;
  line-height: 1.45;
  padding: 2px 12px;
  text-align: center;
}

.wlc-bubble {
  border: 1px solid var(--wlc-line);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.48;
  max-width: 82%;
  overflow-wrap: anywhere;
  padding: 10px 12px;
}

.wlc-message-agent .wlc-bubble {
  background: var(--wlc-agent);
}

.wlc-message-mine .wlc-bubble {
  background: var(--wlc-mine);
  border-color: var(--wlc-mine);
  color: #fff;
}

.wlc-time {
  color: #8a94a6;
  font-size: 11px;
}

.wlc-questions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 14px 12px;
}

.wlc-question {
  background: #fff;
  border: 1px solid var(--wlc-line);
  border-radius: 999px;
  color: var(--wlc-ink);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1.2;
  max-width: 220px;
  overflow: hidden;
  padding: 8px 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wlc-form {
  align-items: center;
  background: #fff;
  border-top: 1px solid var(--wlc-line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 42px;
  padding: 12px;
}

.wlc-input {
  background: #f8fafc;
  border: 1px solid var(--wlc-line);
  border-radius: 8px;
  color: var(--wlc-ink);
  font: inherit;
  font-size: 14px;
  height: 42px;
  min-width: 0;
  outline: 0;
  padding: 0 12px;
}

.wlc-input:focus {
  border-color: var(--wlc-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.wlc-send {
  align-items: center;
  background: var(--wlc-accent);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.wlc-send:hover {
  background: #1d4ed8;
}

@media (max-width: 480px) {
  .wlc-root {
    bottom: max(14px, env(safe-area-inset-bottom));
    right: max(14px, env(safe-area-inset-right));
  }

  .wlc-panel {
    bottom: 70px;
    height: min(560px, calc(100vh - 96px));
    width: calc(100vw - 28px);
  }
}
