#acl-widget {
  --acl-color: #2563eb;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#acl-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--acl-color);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
#acl-toggle:hover { transform: scale(1.05); }

#acl-panel {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 100px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#acl-header {
  background: var(--acl-color);
  color: #fff;
  padding: 12px 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#acl-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

#acl-status {
  background: #d3f9d8;
  color: #2b8a3e;
  padding: 6px 12px;
  font-size: 12px;
  text-align: center;
}

#acl-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #fafafa;
}

.acl-msg {
  margin: 6px 0;
  display: flex;
}
.acl-msg .acl-bubble {
  padding: 8px 12px;
  border-radius: 12px;
  max-width: 80%;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.acl-msg.acl-visitor { justify-content: flex-end; }
.acl-msg.acl-visitor .acl-bubble { background: var(--acl-color); color: #fff; border-bottom-right-radius: 4px; }
.acl-msg.acl-ai .acl-bubble { background: #e7f5ff; color: #1c3d5a; border-bottom-left-radius: 4px; }
.acl-msg.acl-human .acl-bubble { background: #d3f9d8; color: #1b4332; border-bottom-left-radius: 4px; }

.acl-label { font-size: 10px; color: #888; margin-bottom: 2px; }

#acl-contact {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-top: 1px solid #eee;
  background: #fff;
}
#acl-contact input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 12px;
}

#acl-form {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid #eee;
  background: #fff;
}
#acl-input {
  flex: 1;
  resize: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  max-height: 120px;
}
#acl-form button {
  background: var(--acl-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#acl-human-btn {
  background: transparent;
  border: none;
  color: var(--acl-color);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  border-top: 1px solid #eee;
  background: #fff;
}
#acl-human-btn:hover { text-decoration: underline; }

.acl-typing { font-style: italic; color: #888; font-size: 12px; padding: 4px 12px; }
