/* AllSafe chat — darker blue theme */
#allsafe-chat-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 2147483000;
  min-width: 172px;
  height: auto;
  padding: 14px 22px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, #134875, #0a2540);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(6, 21, 37, 0.45);
  font-family: "Segoe UI", Arial, sans-serif;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.02em;
}
#allsafe-chat-launcher:hover {
  background: linear-gradient(135deg, #175a8f, #134875);
  transform: translateY(-2px);
}
.allsafe-chat-icon { font-size: 18px; line-height: 1; }
.allsafe-chat-label { white-space: nowrap; }

#allsafe-chat-panel {
  display: none;
  position: fixed;
  bottom: 96px;
  right: 28px;
  z-index: 2147483646;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border: 1px solid #4a85a8;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(6, 21, 37, 0.3);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  flex-direction: column;
  overflow: hidden;
}
#allsafe-chat-panel.open { display: flex; }

#allsafe-chat-header {
  background: linear-gradient(135deg, #134875, #0a2540);
  color: #fff;
  padding: 16px 18px;
  font-weight: 700;
  font-size: 15px;
}
#allsafe-chat-header small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  margin-top: 4px;
  color: #a8d4ef;
}

#allsafe-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #b0cfe0;
}
.allsafe-chat-msg {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 1.5;
  max-width: 92%;
  font-size: 14px;
}
.allsafe-chat-msg.bot {
  background: #fff;
  border: 1px solid #4a85a8;
  color: #061525;
}
.allsafe-chat-msg.user {
  background: #134875;
  color: #fff;
  margin-left: auto;
  text-align: right;
}
.allsafe-chat-msg a { color: #134875; font-weight: 600; }
.allsafe-chat-msg.user a { color: #cce5f5; text-decoration: underline; }

#allsafe-chat-quick {
  padding: 10px 12px 6px;
  border-top: 1px solid #4a85a8;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#allsafe-chat-quick button {
  font-size: 11px;
  padding: 6px 12px;
  border: 1px solid #175a8f;
  background: #cce5f5;
  color: #0a2540;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
}
#allsafe-chat-quick button:hover { background: #a8d4ef; }
#allsafe-chat-quick button.allsafe-chat-staff-quick {
  background: #134875;
  color: #fff;
  border-color: #0a2540;
}
#allsafe-chat-quick button.allsafe-chat-staff-quick:hover { background: #175a8f; }

#allsafe-chat-staff-form {
  padding: 12px 14px 10px;
  border-top: 1px solid #4a85a8;
  background: #fff;
}
#allsafe-chat-staff-form[hidden] { display: none !important; }
.allsafe-chat-staff-intro {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: #334155;
}
.allsafe-chat-staff-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #0a2540;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.allsafe-chat-staff-label input,
.allsafe-chat-staff-label textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}
.allsafe-chat-staff-label textarea { resize: vertical; min-height: 72px; }
.allsafe-chat-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.allsafe-chat-staff-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
.allsafe-chat-staff-actions button {
  border: 1px solid #175a8f;
  background: #fff;
  color: #134875;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
#allsafe-chat-staff-send {
  background: #134875;
  color: #fff;
  border-color: #0a2540;
}
#allsafe-chat-staff-send:hover { background: #175a8f; }
#allsafe-chat-staff-send:disabled { opacity: 0.6; cursor: wait; }

#allsafe-chat-form {
  display: flex;
  border-top: 1px solid #4a85a8;
  background: #fff;
}
#allsafe-chat-input {
  flex: 1;
  border: none;
  padding: 14px;
  font-size: 14px;
  outline: none;
}
#allsafe-chat-send {
  border: none;
  background: #134875;
  color: #fff;
  padding: 0 22px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
#allsafe-chat-send:hover { background: #175a8f; }

@media (max-width: 480px) {
  #allsafe-chat-panel {
    right: 8px;
    bottom: 88px;
    width: calc(100vw - 16px);
  }
  #allsafe-chat-launcher {
    right: 16px;
    bottom: 16px;
    min-width: 52px;
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .allsafe-chat-label { display: none; }
}
