.sl-chat {
  --sl-chat-accent: #2563eb;
  --sl-chat-text: #172033;
  --sl-chat-muted: #667085;
  --sl-chat-border: #e4e7ec;
  --sl-chat-panel: #ffffff;
  --sl-chat-soft: #f6f8fb;
  color: var(--sl-chat-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1040;
}

.sl-chat * {
  box-sizing: border-box;
}

.sl-chat-launcher {
  align-items: center;
  background: var(--sl-chat-accent);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.2);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px;
}

.sl-chat-launcher svg,
.sl-chat-close svg,
.sl-chat-send svg {
  display: block;
  fill: currentColor;
  height: 20px;
  width: 20px;
}

.sl-chat-launcher-label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.sl-chat-panel {
  background: var(--sl-chat-panel);
  border: 1px solid var(--sl-chat-border);
  border-radius: 8px;
  bottom: 66px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  display: none;
  flex-direction: column;
  height: min(620px, calc(100vh - 110px));
  overflow: hidden;
  position: absolute;
  right: 0;
  width: min(390px, calc(100vw - 28px));
}

.sl-chat.is-open .sl-chat-panel {
  display: flex;
}

.sl-chat.is-open .sl-chat-launcher {
  display: none;
}

.sl-chat-header {
  align-items: center;
  background: #111827;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 16px;
}

.sl-chat-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.sl-chat-status {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 3px;
}

.sl-chat-close,
.sl-chat-send {
  align-items: center;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
}

.sl-chat-close {
  background: transparent;
  color: #ffffff;
  height: 36px;
  width: 36px;
}

.sl-chat-messages {
  background: var(--sl-chat-soft);
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px;
}

.sl-chat-message {
  display: flex;
}

.sl-chat-message.is-mine {
  justify-content: flex-end;
}

.sl-chat-bubble {
  background: #ffffff;
  border: 1px solid var(--sl-chat-border);
  border-radius: 8px;
  color: var(--sl-chat-text);
  font-size: 14px;
  line-height: 1.45;
  max-width: 82%;
  overflow-wrap: anywhere;
  padding: 10px 12px;
}

.sl-chat-message.is-mine .sl-chat-bubble {
  background: var(--sl-chat-accent);
  border-color: var(--sl-chat-accent);
  color: #ffffff;
}

.sl-chat-identity {
  border-top: 1px solid var(--sl-chat-border);
  padding: 12px;
}

.sl-chat-identity-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.sl-chat-identity-grid {
  display: grid;
  gap: 8px;
}

.sl-chat-identity input,
.sl-chat-input {
  background: #ffffff;
  border: 1px solid var(--sl-chat-border);
  border-radius: 8px;
  color: var(--sl-chat-text);
  font-size: 14px;
  min-height: 40px;
  outline: none;
  padding: 0 12px;
  width: 100%;
}

.sl-chat-identity input:focus,
.sl-chat-input:focus {
  border-color: var(--sl-chat-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sl-chat-accent), transparent 84%);
}

.sl-chat-identity-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

.sl-chat-identify,
.sl-chat-skip {
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  min-height: 36px;
  padding: 0 12px;
}

.sl-chat-identify {
  background: var(--sl-chat-accent);
  border: 1px solid var(--sl-chat-accent);
  color: #ffffff;
}

.sl-chat-skip {
  background: #ffffff;
  border: 1px solid var(--sl-chat-border);
  color: var(--sl-chat-muted);
}

.sl-chat-composer {
  align-items: center;
  border-top: 1px solid var(--sl-chat-border);
  display: flex;
  gap: 8px;
  padding: 12px;
}

.sl-chat-send {
  background: var(--sl-chat-accent);
  border-radius: 8px;
  color: #ffffff;
  flex: 0 0 42px;
  height: 42px;
}

.sl-chat-error {
  border-top: 1px solid #fecaca;
  color: #b42318;
  font-size: 13px;
  padding: 10px 12px;
}

@media (max-width: 640px) {
  .sl-chat {
    bottom: 14px;
    left: 14px;
    right: 14px;
  }

  .sl-chat-launcher {
    float: right;
  }

  .sl-chat-panel {
    border-radius: 8px 8px 0 0;
    bottom: -14px;
    height: min(690px, calc(100vh - 24px));
    right: 0;
    width: 100%;
  }
}
